Archive: Adding a checkbox to ioSpecial.ini at Finish


Adding a checkbox to ioSpecial.ini at Finish
I've been using NSIS for a little while now and had pretty much resolved myself to having only 2 checkboxes on the page. But lo and behold, my mind picked up on the "you can edit iospecial.ini" in the Modern UI documentation's notes on the finish page.

"Eureka" I cried, as a wave of euphoria broke out at the thought of customizing this beautiful page and forgoing the original idea of using a custom page instead.

So I tried adding a checkbox to the iospecial.ini file at finish time. It worked! Except with one caveat....

The checkbox that gets added has the grey background of a button. :cry:

Does anyone have an idea why this happens and how to make it go away?


Following forum thread might help you,

http://forums.winamp.com/showthread....hreadid=264181


Thanks Red Wine. I guess I didn't put the right text into the search box. :D

I did manage to find something similar to what you have posted in that other thread. I managed to find my way to http://forums.winamp.com/showthread.php?s=&threadid=205674 through the NSIS wiki. Based on that example, I've got a couple of lines like this in the show function

GetDlgItem $0 $MUI_HWND 1205
SetCtlColors $0 "" "FFFFFF"

and this achieves the desired result. :up:

My only question at this point is "Where on Earth did they get 1203 (handle of the first checkbox) from?!?" :weird:

And I'm also a little curious how your code works too.
Function fin_show
ReadINIStr $0 "$PLUGINSDIR\iospecial.ini" "Field 6" "HWND"
SetCtlColors $0 0x000000 0xFFFFFF
FunctionEnd

Function fin_pre
WriteINIStr "$PLUGINSDIR\iospecial.ini" "Settings" "NumFields" "6"
WriteINIStr "$PLUGINSDIR\iospecial.ini" "Field 6" "Type" "CheckBox"
WriteINIStr "$PLUGINSDIR\iospecial.ini" "Field 6" "Text" "&Create Quicklaunch Shortcut"
WriteINIStr "$PLUGINSDIR\iospecial.ini" "Field 6" "Left" "120"
WriteINIStr "$PLUGINSDIR\iospecial.ini" "Field 6" "Right" "315"
WriteINIStr "$PLUGINSDIR\iospecial.ini" "Field 6" "Top" "130"
WriteINIStr "$PLUGINSDIR\iospecial.ini" "Field 6" "Bottom" "140"
WriteINIStr "$PLUGINSDIR\iospecial.ini" "Field 6" "State" "1"
FunctionEnd


Obviously, the HWND for Field 6 wasn't written to the INI file. So how can you read it in the Show function?:weird:

My only question at this point is "Where on Earth did they get 1203 (handle of the first checkbox) from?!?"
Keep on searching the forum... :)

Obviously, the HWND for Field 6 wasn't written to the INI file. So how can you read it in the Show function?
Obviously you haven't read the documentation yet :)

InstallOptions adds the HWND field to the INI file after it creates the page. 1203 is 1200 + field 4 - 1.


Many thanks to both of you.