Return to a custom page
I have an installer project with two custom pages using InstallOptions. I've gotten it to work pretty well and as satisfied with it but I'm still having one last problem with it. When I go from the first custom page to the next and then press the back button it skips to the page before my first custom page. ie it goes from page three to page one in a single click where I would want it to go to page two.
This is the code for page two
This is the code for page threeServicePage
insertmacro MUI_HEADER_TEXT "Service account setup" "Specify the username and password for the account that the service should run as"
; Check if SEC01 is selected, if not then abort
SectionGetFlags${SEC01} $R0
IntOp $R0 $R0& ${SF_SELECTED}
IntCmp $R0 ${SF_SELECTED} ShowServicePage
Abort
ShowServicePage:
!
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "ServiceDialog.ini"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "ServiceDialog.ini"
>FunctionEnd
>!macro EnableField IniFilename SectionName Enable
Push $R0
!insertmacro MUI_INSTALLOPTIONS_READ $R0 "${IniFilename}" "${SectionName}" "HWND"
EnableWindow $R0 ${Enable}
Pop $R0
>!macroend
>Function ServicePageLeave
!insertmacro MUI_INSTALLOPTIONS_READ $0 "ServiceDialog.ini" "Settings" "State"
IntCmp $0 1 0 NextCheck NextCheck
!insertmacro EnableField "ServiceDialog.ini" "Field 3" 0
!insertmacro EnableField "ServiceDialog.ini" "Field 4" 0
!insertmacro EnableField "ServiceDialog.ini" "Field 5" 0
Abort
NextCheck:
IntCmp $0 2 0 FinishServicePage FinishServicePage
!insertmacro EnableField "ServiceDialog.ini" "Field 3" 1
!insertmacro EnableField "ServiceDialog.ini" "Field 4" 1
!insertmacro EnableField "ServiceDialog.ini" "Field 5" 1
Abort
FinishServicePage:
!insertmacro MUI_INSTALLOPTIONS_READ $0 "ServiceDialog.ini" "Field 1" "State"
IntCmp $0 1 SystemAccount
!insertmacro MUI_INSTALLOPTIONS_READ $SERVICEUSER "ServiceDialog.ini" "Field 2" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $SERVICEPASSWORD "ServiceDialog.ini" "Field 4" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $0 "ServiceDialog.ini" "Field 4" "State"
StrCmp $SERVICEPASSWORD $0 0 FinishServicePageEnd
Messagebox MB_ICONEXCLAMATION|MB_OK "The input password doesn't match"
Abort
SystemAccount:
StrCpy $SERVICEUSER ""
StrCpy $SERVICEPASSWORD ""
FinishServicePageEnd:
Delete "$Pluginsdir\ServiceDialog.ini"
>FunctionEnd
>
DatabasePage
; Check if SEC02 is selected, if not then abort
SectionGetFlags${SEC02} $R0
IntOp $R0 $R0& ${SF_SELECTED}
IntCmp $R0 ${SF_SELECTED} ShowDatabasePage
Abort
ShowDatabasePage:
ReserveFile "SQLDialog.ini"
!insertmacro MUI_HEADER_TEXT "Database setup" "Specify the necessary parameters to connect to the database"
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "SQLDialog.ini"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "SQLDialog.ini"
>FunctionEnd
>Function DatabasePageLeave
!insertmacro MUI_INSTALLOPTIONS_READ $SQLSERVER "SQLDialog.ini" "Field 2" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $SQLUSER "SQLDialog.ini" "Field 4" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $SQLPASSWORD "SQLDialog.ini" "Field 7" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $SQLDATABASE "SQLDialog.ini" "Field 8" "State"
Delete "$TEMP\SQLDialog.ini"
>FunctionEnd
>
Anyone having any ideas why this happens?/ Karl