Skip to content
⌘ NSIS Forum Archive

Adding a checkbox to ioSpecial.ini at Finish

6 posts

Zinkyu#

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. 😢

Does anyone have an idea why this happens and how to make it go away?
Red Wine#
Following forum thread might help you,

Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.
Zinkyu#
Thanks Red Wine. I guess I didn't put the right text into the search box. 😁

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. 👍

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

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?🤪
Red Wine#
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 🙂
kichik#
InstallOptions adds the HWND field to the INI file after it creates the page. 1203 is 1200 + field 4 - 1.