Archive: Problems with MUI custom dialog


Problems with MUI custom dialog
I have two problems with custom dialogs using MUI:

1) If I enable the back button, how do I jump to a previous custom dialog? I tried call CustDialog1 where CustDialog1 is the function to process the previous dialog (see code below). This shows the dialog but when clicking on one of its standard buttons (back, next, cancel) it terminates the installer

2) I use the following code to process a custom dialog:

Function CustDialog2
${If} $IsNewSubscriber = 0
; call !insertmacro MUI_HEADER_TEXT
; call !insertmacro MUI_INSTALLOPTIONS_WRITE to write multilanguage Field and validation messages
......
; -- Show page
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "SubscriptionKey.ini"
; -- Read data
!insertmacro MUI_INSTALLOPTIONS_DISPLAY_RETURN "SubscriptionKey.ini"
Pop $R0
${if} $R0 == "cancel"
Quit
${EndIf}
${if} $R0 == "back"
call CustDialog1
${EndIf}

!insertmacro MUI_INSTALLOPTIONS_READ $SubscriberLicense "SubscriptionKey.ini" "Field 3" "State"

Loop:

;.... do some processing here

${EndIf}
FunctionEnd

Since I added 'Pop $R0' to find out which button was pressed users need to click the NEXT button TWICE to get one step forward. Any idea why and what the problem is????

Many thanks for your help.

Tom


You should be reading data from the INI file in the Leave function. You don't need to manage the Cancel or Back buttons at all. NSIS will do that for you.

-Stu


Many thanks for the quick reply. However I fear I do not quite understand:

Do I need to define a pre and leave function for every custom dialog I create?

In which order are they processed? Is there any documentation about it? My main job is to write complex software, installation programms I only write very rarely and therefore I do not understand how these things really work.

So it would help me a lot, if you could point me to articles on that topic.

Many thanks
Tom


Page Custom ShowFunc LeaveFunc

-Stu