2002-12-15 19:03:34 +00:00
|
|
|
;InstallOptions Test Script
|
2002-11-01 20:46:42 +00:00
|
|
|
;Written by Joost Verburg
|
2002-12-15 19:03:34 +00:00
|
|
|
;--------------------------
|
2002-08-02 10:01:35 +00:00
|
|
|
|
2002-11-02 12:28:49 +00:00
|
|
|
!define TEMP1 $R0 ;Temp variable
|
2002-08-02 10:01:35 +00:00
|
|
|
|
2002-11-01 20:46:42 +00:00
|
|
|
;The name of the installer
|
2002-12-15 19:03:34 +00:00
|
|
|
Name "InstallOptions Test"
|
2002-08-02 10:01:35 +00:00
|
|
|
|
2002-11-02 12:28:49 +00:00
|
|
|
;The file to write
|
2002-11-01 20:46:42 +00:00
|
|
|
OutFile "Test.exe"
|
2002-08-02 10:01:35 +00:00
|
|
|
|
2002-11-02 12:28:49 +00:00
|
|
|
;The default installation directory
|
2002-11-01 20:46:42 +00:00
|
|
|
InstallDir "$PROGRAMFILES\IOTest"
|
2002-08-02 10:01:35 +00:00
|
|
|
|
2002-11-02 12:28:49 +00:00
|
|
|
;Things that need to be extracted on startup (keep these lines before any File command!)
|
2002-11-24 15:30:13 +00:00
|
|
|
;Only useful for BZIP2 compression
|
2002-12-15 19:03:34 +00:00
|
|
|
;Use ReserveFile for your own InstallOptions INI files too!
|
2002-11-24 15:30:13 +00:00
|
|
|
|
2002-11-02 12:28:49 +00:00
|
|
|
ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
|
2002-12-21 16:16:57 +00:00
|
|
|
ReserveFile "test.ini"
|
2002-11-02 12:28:49 +00:00
|
|
|
|
|
|
|
;Texts on the dialogs
|
2002-11-01 20:46:42 +00:00
|
|
|
DirText "Choose a directory"
|
|
|
|
LicenseText "A license"
|
|
|
|
LicenseData "..\..\License.txt"
|
2002-08-02 10:01:35 +00:00
|
|
|
ComponentText "Choose components"
|
|
|
|
|
2002-11-02 12:28:49 +00:00
|
|
|
;Order of pages
|
2002-11-01 20:46:42 +00:00
|
|
|
Page license
|
2002-12-15 19:03:34 +00:00
|
|
|
Page custom SetCustom ": Testing InstallOptions" ;Custom page. InstallOptions gets called in SetCustom.
|
2002-11-01 20:46:42 +00:00
|
|
|
Page components
|
|
|
|
Page directory
|
|
|
|
Page instfiles
|
|
|
|
|
|
|
|
Section "Components"
|
2002-11-02 12:28:49 +00:00
|
|
|
|
|
|
|
;Get Install Options dialog user input
|
|
|
|
|
|
|
|
ReadINIStr ${TEMP1} "$PLUGINSDIR\test.ini" "Field 1" "State"
|
2003-01-06 15:10:48 +00:00
|
|
|
MessageBox MB_OK "Install X=${TEMP1}"
|
2002-11-02 12:28:49 +00:00
|
|
|
ReadINIStr ${TEMP1} "$PLUGINSDIR\test.ini" "Field 2" "State"
|
2003-01-06 15:10:48 +00:00
|
|
|
MessageBox MB_OK "Install Y=${TEMP1}"
|
2002-11-02 12:28:49 +00:00
|
|
|
ReadINIStr ${TEMP1} "$PLUGINSDIR\test.ini" "Field 3" "State"
|
2003-01-06 15:10:48 +00:00
|
|
|
MessageBox MB_OK "Install Z=${TEMP1}"
|
2002-11-02 12:28:49 +00:00
|
|
|
ReadINIStr ${TEMP1} "$PLUGINSDIR\test.ini" "Field 4" "State"
|
2003-01-06 15:10:48 +00:00
|
|
|
MessageBox MB_OK "File=${TEMP1}"
|
2002-11-02 12:28:49 +00:00
|
|
|
ReadINIStr ${TEMP1} "$PLUGINSDIR\test.ini" "Field 5" "State"
|
2003-01-06 15:10:48 +00:00
|
|
|
MessageBox MB_OK "Dir=${TEMP1}"
|
2002-11-02 12:28:49 +00:00
|
|
|
|
2002-08-02 10:01:35 +00:00
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
Function .onInit
|
2002-11-02 12:28:49 +00:00
|
|
|
|
2002-12-15 19:03:34 +00:00
|
|
|
;Extract InstallOptions files
|
2002-11-02 12:28:49 +00:00
|
|
|
;$PLUGINSDIR will automatically be removed when the installer closes
|
|
|
|
|
2002-11-10 16:32:46 +00:00
|
|
|
InitPluginsDir
|
2002-12-21 16:16:57 +00:00
|
|
|
File /oname=$PLUGINSDIR\test.ini "test.ini"
|
2002-11-02 12:28:49 +00:00
|
|
|
|
2002-08-02 10:01:35 +00:00
|
|
|
FunctionEnd
|
|
|
|
|
2002-11-01 20:46:42 +00:00
|
|
|
Function SetCustom
|
2002-08-02 10:01:35 +00:00
|
|
|
|
2002-12-15 19:03:34 +00:00
|
|
|
;Display the InstallOptions dialog
|
|
|
|
|
2002-11-09 12:50:00 +00:00
|
|
|
Push ${TEMP1}
|
2002-08-02 10:01:35 +00:00
|
|
|
|
2002-12-15 19:03:34 +00:00
|
|
|
InstallOptions::dialog "$PLUGINSDIR\test.ini"
|
|
|
|
Pop ${TEMP1}
|
|
|
|
|
2002-11-01 20:46:42 +00:00
|
|
|
Pop ${TEMP1}
|
2002-08-02 10:01:35 +00:00
|
|
|
|
|
|
|
FunctionEnd
|