Custom dialogs -- Idea request
Hello!
I don't want to make new thread every day, but I didn't find the answer in forum. Or I searched bad...
Problem is following:
I'd like to have couple of custom pages with 2 edit-boxes. They will appear after installing files. After filling-in the information will appear similar page, but not editable - just for confirmation - and it do some post-install things. Each PAIR of this pages will appear only on user demand. My solution is following:
...
Page Custom Page1PRE Page1LEAVE
Page Custom Page1_ConfirmPRE Page1_ConfirmLEAVE
...
Function Page1PRE
${If} ${Cmd} "MessageBox MB_YESNO|MB_ICONQUESTION 'Page1?' IDYES"
StrCpy $PAGE1 "1"
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "Page1.ini"
!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "Page1.ini"
!insertmacro MUI_INSTALLOPTIONS_SHOW
${Else}
StrCpy $PAGE1 "0"
Abort
${EndIf}
FunctionEnd
...
Function Page1LEAVE
!insertmacro MUI_INSTALLOPTIONS_READ $FIELD1 "Page1.ini" "Field 1" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $FIELD2 "Page1.ini" "Field 2" "State"
FunctionEnd
...
Function Page1_ConfirmPRE
${If} $PAGE1 == "0" ;
Abort
${EndIf}
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "Page1.ini"
!insertmacro MUI_INSTALLOPTIONS_WRITE "Page1.ini" "Field 1" "Text" $FIELD1
!insertmacro MUI_INSTALLOPTIONS_WRITE "Page1.ini" "Field 2" "State" $FIELD2
!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "Page1.ini"
!insertmacro MUI_INSTALLOPTIONS_SHOW
FunctionEnd
...
Function Page1_ConfirmLEAVE
; here I would like to do some work with $FIELD1 and $FIELD2
FunctionEnd
...
Is this a good way? Can I do it better (maybe using sections instead of asking with MessageBox)? Won't this make any problems if user will step back in installer?
Thank you for your opinions! (And sorry for huge post)