Archive: Read-only (greyed) checkbox!


Read-only (greyed) checkbox!
Hi,
Thanks to this great help - http://forums.winamp.com/showthread.php?t=264181 - I was able to add a third checkbox on the FinishPage.

What I would like now is this third checkbox to be read-only (so greyed out).

How should I please do to achieve this?

Thanks for any kind help/tip :)

; Finish page
!define MUI_PAGE_CUSTOMFUNCTION_PRE fin_pre
!define MUI_PAGE_CUSTOMFUNCTION_SHOW fin_show
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE fin_leave
!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_FUNCTION LaunchRunway
!define MUI_FINISHPAGE_RUN_TEXT "Start"
!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\history.rtf"
!insertmacro MUI_PAGE_FINISH

;Installer Functions
Function LaunchRunway
ExecWait "$INSTDIR\Runway.exe"
FunctionEnd

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" "&Update database"
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

Function fin_leave
ReadINIStr $0 "$PLUGINSDIR\iospecial.ini" "Field 6" "State"
StrCmp $0 "0" end
ExecWait "$INSTDIR\update.exe"
FunctionEnd

WriteINIStr "$PLUGINSDIR\iospecial.ini" "Field 6" "Flags" "DISABLED" maybe but does it even make sense to disable a checkbox?

Also, why are you using ExecWait and not Exec/ExecShell?


Anders,
Thanks for your reply! That works ! ;-)

Yes, for me that make sense to use a checkbox, this is a way to show the user that his database is being updated.
I use ExecWait to be sure that this updater (launched under 'checkbox 3) has finished before launching the next application (checkbox 1)...which needs the database to be updated before running. (but I should use 'Exec in the 'LaunchRunway' function, that's right!!)


You should not be making any changes to the system after the installation has finished. All changes should be made on the INSTFILES page, and on the INSTFILES page only.

If you want to make things optional, you can use sections with a COMPONENTS page before the INSTFILES page. Or create a custom page with checkboxes that sets some variables which you then use in your sections.

To show the user that something is being done in the background, you could for example use the Banner plugin.