Old 19th April 2004, 05:57   #1
DarkAkuma
Junior Member
 
Join Date: Apr 2004
Posts: 4
Using a nsis installer with mIRC

Anyone have any advice on using nsis with mIRC? More specificly, im using a nsis installer to install a mIRC script ini file, and want my installer to properly load the script into mIRC. I first tried useing WriteINIStr, but ran into a problem with the way values are stored within mIRC ini's. Alot of the values are store with a entry name like n1=, n23=, n745=, or whatever. I need it to see what the last n* entry name is in the [rfiles] section of the mirc.ini, and basicly make the entry for my srcipt use the next number up, like:

if the last entry anme and value was:

n21=SomeScript.ini

id want mine to be:

n22=MyScriptDir/MyScript.ini

If im missing something, due to my little nsis experiance, that could help me. Or if theres a totaly different way to do this. Please help me out.

I looked into SendMessage too, thinking i may be able to use that to preform a command in mirc to load the script. But i dont understand it to well, so i dont even know if im interperting it right or not.

So anyone have any advice on getting my nsis installer to load my script into mirc after its installed? Preffered it to be done while mirc is closed, or both closed and open. Just while its open may complicate my install more then what im wanting. Not sure yet. Im tired, and burnt out right now. need sleep.
DarkAkuma is offline   Reply With Quote
Old 19th April 2004, 08:11   #2
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
Create a loop that reads every key until it finds the last one.
Joost Verburg is offline   Reply With Quote
Old 19th April 2004, 12:25   #3
Comm@nder21
Major Dude
 
Join Date: Jul 2003
Location: germany, b-w
Posts: 734
Send a message via ICQ to Comm@nder21
isn't there a enum-function available? like with registry-keys?
Comm@nder21 is offline   Reply With Quote
Old 19th April 2004, 12:27   #4
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
Yes, but you'll have to use the System plug-in.
Joost Verburg is offline   Reply With Quote
Old 19th April 2004, 19:44   #5
DarkAkuma
Junior Member
 
Join Date: Apr 2004
Posts: 4
Any help on finding the codeing commands i need to know to use a loop, in the help file? Or the lines of code themselves to do it?

Thats exactly what id do with mirc scripting if i ran into this problem, but when i looked through the nsis help files to find any info that might do that, i didnt find anything. =(
DarkAkuma is offline   Reply With Quote
Old 19th April 2004, 20:09   #6
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
You can easily create a loop using a label and a Goto command.
Joost Verburg is offline   Reply With Quote
Old 20th April 2004, 03:50   #7
DarkAkuma
Junior Member
 
Join Date: Apr 2004
Posts: 4
Ok. I'm just not getting this. Only been useing nsis for about 2 days now, and how to do this just isnt makeing sence. As bad as the help file was for a tutorial with mirc, the help file for nsis is about 5 times worse. I just dont understand codeing until i see an example, or it used in a script. And ive done a bunch of searching, but cant find anything that will help me understand this.

Can anyone help me out here, and give me the lines i need?

To sum it up again. When my install is run, i need it to read mirc.ini, look at the [rfiles] section, and see what the last n1, n23, n65, type number is in that section, and write to the ini in that section, n plus the next number up like "n45=MyScriptDir/MyScript.ini".
DarkAkuma is offline   Reply With Quote
Old 20th April 2004, 10:01   #8
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
The NSIS Archive contains many script examples. Example of a loop:
code:
Var COUNT
Var VALUE

loop:

IntOp $COUNT $COUNT + 1
ReadIniStr $VALUE "myini.ini" "section" "n$COUNT"
StrCmp $VALUE "" done loop

done:

MessageBox MB_OK $COUNT

Joost Verburg is offline   Reply With Quote
Old 20th April 2004, 20:24   #9
DarkAkuma
Junior Member
 
Join Date: Apr 2004
Posts: 4
Thanks. Finaly got it working. Even put in a Check to make sure the entry for my ini isnt allready there from previous versons of my script. Seems to be working as intended. Heres how i have it now. Let me know if anything is done wrong, or if theirs any redundancy.

loop:

IntOp $COUNT $COUNT + 1
ReadIniStr $VALUE "$INSTDIR\mirc.ini" "rfiles" "n$COUNT"
StrCmp $VALUE "MyScriptDir\MyScript.ini" done2 loop2

loop2:

StrCmp $VALUE "" done loop

done:
WriteINIStr "$INSTDIR\mirc.ini" "rfiles" "n$COUNT" "MyScriptDir\MyScript.ini"

done2:
DarkAkuma is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump