Check boxes not working
Hi,
I have tried several scripts with checkboxes including the one below. For some reason when the checkbox is checked, the functions associated with the checkbox are not running.
Any Ideas??
;Pages
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE $(MUILicense)
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
; Finish page
CheckBitmap "${NSISDIR}\Contrib\Graphics\Checks\aquachecks.bmp"
!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_NOTCHECKED
!define MUI_FINISHPAGE_RUN_TEXT "Edit Agent.ini Configuration File"
!define MUI_FINISHPAGE_RUN_FUNCTION "runfile"
!define MUI_FINISHPAGE_SHOWREADME
!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
!define MUI_FINISHPAGE_SHOWREADME_TEXT "Edit Default.txt Configuraton File"
!define MUI_FINISHPAGE_SHOWREADME_FUNCTION "runfile2"
Function "runfile"
ExecWait "$INSTDIR\${PROJ_NAME}Agent.ini"
FunctionEnd
Function "runfile2"
ExecWait "$INSTDIR\${PROJ_NAME}default.txt"
FunctionEnd
!define MUI_PAGE_CUSTOMFUNCTION_PRE PreFinishPage
!define MUI_PAGE_CUSTOMFUNCTION_SHOW ShowFinishPage
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE LeaveFinishPage
Function PreFinishPage
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "NumFields" "6"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 6" "Type" "CheckBox"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 6" "Text" "Start ${PROJ_NAME} Service"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 6" "Left" "120"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 6" "Right" "315"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 6" "Top" "130"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 6" "Bottom" "140"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 6" "State" "0"
;line above: Initial state of the control: 0=Unchecked, 1=Checked
FunctionEnd
Function ShowFinishPage
GetDlgItem $MUI_TEMP1 $MUI_HWND 1205 ;ID for the 6th InstallOptions control
SetCtlColors $MUI_TEMP1 "" "${MUI_BGCOLOR}"
FunctionEnd
Function LeaveFinishPage
!insertmacro MUI_INSTALLOPTIONS_READ $MUI_TEMP1 "ioSpecial.ini" "Field 6" "State"
StrCmp $MUI_TEMP1 1 Checked Unchecked
Checked: nsSCM::start /NOUNLOAD "${PROJ_NAME}"
Goto end
Unchecked:
end:
FunctionEnd
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_COMPONENTS
!insertmacro MUI_UNPAGE_INSTFILES