I tried the last three days to find the solution,
but I couldn't managed it.
I will use a custom finish page for the classic installer.
I have used follow ini file (finish_page.ini):
and this working InstallOption page:
[Settings]
NumFields=3
[Field 1]
Type=GroupBox
Left=0
Right=-1
Top=0
Bottom=-5
Text=Installation Complete
[Field 2]
Type=checkbox
Text=Create a shortcut on your desktop?
Left=10
Right=-10
Top=17
Bottom=25
State=1
Flags=GROUP
[Field 3]
Type=checkbox
Text=Launch MyApp!
Left=10
Right=-10
Top=43
Bottom=51
State=1
Flags=GROUP
Please can somebody add the script for the "Creating DesktopShortcut" and "Launching App"?
!define TEMP1 $R0 ;Temp variable
;The name of the installer
Name "MyApp"
;The file to write
OutFile "MyApp.exe"
InstallDir "$PROGRAMFILES\MyApp"
; Show install details
ShowInstDetails show
;Things that need to be extracted on startup
;Only useful for BZIP2 compression
;Use ReserveFile for your own InstallOptions INI files too!
ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
ReserveFile "finish_page.ini"
;Order of pages
;Custom page. InstallOptions gets called in SetCustom.
Page custom SetCustom ValidateCustom ": Finish Page"
Page instfiles
Section "Finish_page"
;Get Install Options dialog user input
ReadINIStr ${TEMP1} "$PLUGINSDIR\finish_page.ini" "Field 2" "State"
DetailPrint "Create Shortcut=${TEMP1}"
ReadINIStr ${TEMP1} "$PLUGINSDIR\finish_page.ini" "Field 3" "State"
DetailPrint "Start Game=${TEMP1}"
SectionEnd
Function .onInit
;Extract InstallOptions files
;$PLUGINSDIR will automatically be removed when the installer closes
InitPluginsDir
File /oname=$PLUGINSDIR\finish_page.ini "finish_page.ini"
FunctionEnd
Function SetCustom
;Display the InstallOptions dialog
Push ${TEMP1}
InstallOptions::dialog "$PLUGINSDIR\finish_page.ini"
Pop ${TEMP1}
Pop ${TEMP1}
FunctionEnd
Function ValidateCustom
ReadINIStr ${TEMP1} "$PLUGINSDIR\finish_page.ini" "Field 2" "State"
StrCmp ${TEMP1} 1 done
ReadINIStr ${TEMP1} "$PLUGINSDIR\finish_page.ini" "Field 3" "State"
StrCmp ${TEMP1} 1 done
done:
FunctionEnd
I doesn't understand the recognition of the used checkbox and the needed function for the checkbox.
I think for a profi it couldn't be difficult and perhaps you take a minute to help me.
Thank you! and best regards.
Rien