Archive: Mui_installoptions


Mui_installoptions
If I press back or cancel, this function repeats.
What in this code incorrectly?


Function ComponentsPage
SectionGetFlags ${ISRM} $0
StrCmp $0 1 ShowPage
abort

ShowPage:

!insertmacro MUI_HEADER_TEXT "$(TEXT_SETUPSCENARIOS_TITLE)" "$(TEXT_SETUPSCENARIOS_SUBTITLE)"

;Clearing up all radiobuttons' values
!insertmacro MUI_INSTALLOPTIONS_WRITE "setupscenarios.ini" "Field 1" "State" "0" ;All Components
!insertmacro MUI_INSTALLOPTIONS_WRITE "setupscenarios.ini" "Field 2" "State" "0" ;Server Component
!insertmacro MUI_INSTALLOPTIONS_WRITE "setupscenarios.ini" "Field 3" "State" "0" ;RMC Component

;Retrieving installed ISA Server components using external helper dll-plugin
isacInstallDll::InstalledComponents
pop $ISARequestCredentials
pop $ISAInstallationFolder
pop $InstalledISAComponents

StrCmp $InstalledISAComponents "0" NoFPC_NoRMC
StrCmp $InstalledISAComponents "1" NoFPC
StrCmp $InstalledISAComponents "2" AllComponents

AllComponents:
;Both FPC and RMC components are installed on the computer
!insertmacro MUI_INSTALLOPTIONS_WRITE "setupscenarios.ini" "Field 1" "State" "1" ;Selecting "All components" field
goto Display

NoFPC_NoRMC:
;Both FPC and RMC components are not installed on the computer. Disabling all fields except "Data Center Component"
!insertmacro MUI_INSTALLOPTIONS_WRITE "setupscenarios.ini" "Field 1" "Flags" "DISABLED" ;All Components
!insertmacro MUI_INSTALLOPTIONS_WRITE "setupscenarios.ini" "Field 2" "Flags" "DISABLED" ;Server Component
!insertmacro MUI_INSTALLOPTIONS_WRITE "setupscenarios.ini" "Field 3" "Flags" "DISABLED" ;RMC Component
goto Display

NoFPC:
;FPC component is not installed on the computer. Disabling all fields except "Data Center Component" and "RMC Component"
!insertmacro MUI_INSTALLOPTIONS_WRITE "setupscenarios.ini" "Field 1" "Flags" "DISABLED" ;All Components
!insertmacro MUI_INSTALLOPTIONS_WRITE "setupscenarios.ini" "Field 2" "Flags" "DISABLED" ;Server Component
goto Display

Display:

;Initializing the dialog and bolding radiobuttons
!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "setupscenarios.ini"
pop $R0

GetDlgItem $R1 $R0 1200
GetDlgItem $R2 $R0 1201
GetDlgItem $R3 $R0 1202
CreateFont $R5 $(^Font) $(^FontSize) 700

SendMessage $R1 ${WM_SETFONT} $R5 0
SendMessage $R2 ${WM_SETFONT} $R5 0
SendMessage $R3 ${WM_SETFONT} $R5 0

;Let's show the dialog
!insertmacro MUI_INSTALLOPTIONS_SHOW
pop $R0
MessageBox MB_OK|MB_ICONSTOP "$R0"
MessageBox MB_OK|MB_ICONSTOP "$R1"
MessageBox MB_OK|MB_ICONSTOP "$R2"
MessageBox MB_OK|MB_ICONSTOP "$R3"
MessageBox MB_OK|MB_ICONSTOP "$MUI_TEMP"
MessageBox MB_OK|MB_ICONSTOP "$MUI_TEMP1"
;saving result of dialog execution(cancel, back or success)

StrCpy $R1 $MUI_TEMP1

;User have selected components to install. Let's save this value for future use
!insertmacro MUI_INSTALLOPTIONS_READ $R2 "setupscenarios.ini" "Field 1" "State" ;All Components
!insertmacro MUI_INSTALLOPTIONS_READ $R3 "setupscenarios.ini" "Field 2" "State" ;Server Component
!insertmacro MUI_INSTALLOPTIONS_READ $R4 "setupscenarios.ini" "Field 3" "State" ;RMC Component

StrCpy $SetupScenario "0" ; By default no one scenario is selected

StrCmp $R2 "1" 0 +2
StrCpy $SetupScenario "1"

StrCmp $R3 "1" 0 +2
StrCpy $SetupScenario "2"

StrCmp $R4 "1" 0 +2
StrCpy $SetupScenario "3"

;If $SetupScenario is "0", this means that user have not selected any setup scenario
StrCmp $R1 "success" 0 do
abort
do:
MessageBox MB_OK|MB_ICONSTOP "$R1"
StrCmp $SetupScenario "0" 0 Done
goto Display
MessageBox MB_OK|MB_ICONSTOP "Please select setup scenario and try again"

Done:
FunctionEnd

Please help!!