- NSIS Discussion
- Using a nsis installer with mIRC
Archive: Using a nsis installer with mIRC
DarkAkuma
19th April 2004 06:57 UTC
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.
Joost Verburg
19th April 2004 09:11 UTC
Create a loop that reads every key until it finds the last one.
Comm@nder21
19th April 2004 13:25 UTC
isn't there a enum-function available? like with registry-keys?
Joost Verburg
19th April 2004 13:27 UTC
Yes, but you'll have to use the System plug-in.
DarkAkuma
19th April 2004 20:44 UTC
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. =(
Joost Verburg
19th April 2004 21:09 UTC
You can easily create a loop using a label and a Goto command.
DarkAkuma
20th April 2004 04:50 UTC
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".
Joost Verburg
20th April 2004 11:01 UTC
The NSIS Archive contains many script examples. Example of a loop:
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
DarkAkuma
20th April 2004 21:24 UTC
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: