| 1 |
;InstallOptions Test Script |
| 2 |
;Written by Joost Verburg |
| 3 |
;-------------------------- |
| 4 |
|
| 5 |
;The name of the installer |
| 6 |
Name "InstallOptions Test" |
| 7 |
|
| 8 |
;The file to write |
| 9 |
OutFile "Test.exe" |
| 10 |
|
| 11 |
; Show install details |
| 12 |
ShowInstDetails show |
| 13 |
|
| 14 |
;Things that need to be extracted on startup (keep these lines before any File command!) |
| 15 |
;Only useful for BZIP2 compression |
| 16 |
;Use ReserveFile for your own InstallOptions INI files too! |
| 17 |
|
| 18 |
ReserveFile /plugin InstallOptions.dll |
| 19 |
ReserveFile "testimgs.ini" |
| 20 |
ReserveFile "${NSISDIR}\Contrib\Graphics\Checks\colorful.bmp" |
| 21 |
ReserveFile "${NSISDIR}\Contrib\Graphics\Checks\modern.bmp" |
| 22 |
ReserveFile "${NSISDIR}\Contrib\Graphics\Icons\pixel-install.ico" |
| 23 |
|
| 24 |
;Order of pages |
| 25 |
Page custom SetCustom "" ": Testing InstallOptions" ;Custom page. InstallOptions gets called in SetCustom. |
| 26 |
Page instfiles |
| 27 |
|
| 28 |
Section |
| 29 |
SectionEnd |
| 30 |
|
| 31 |
Function .onInit |
| 32 |
|
| 33 |
;Extract InstallOptions files |
| 34 |
;$PLUGINSDIR will automatically be removed when the installer closes |
| 35 |
|
| 36 |
InitPluginsDir |
| 37 |
File /oname=$PLUGINSDIR\testimgs.ini "testimgs.ini" |
| 38 |
File /oname=$PLUGINSDIR\image.bmp "${NSISDIR}\Contrib\Graphics\Checks\colorful.bmp" |
| 39 |
File /oname=$PLUGINSDIR\image2.bmp "${NSISDIR}\Contrib\Graphics\Checks\modern.bmp" |
| 40 |
File /oname=$PLUGINSDIR\icon.ico "${NSISDIR}\Contrib\Graphics\Icons\pixel-install.ico" |
| 41 |
|
| 42 |
;Write image paths to the INI file |
| 43 |
|
| 44 |
WriteINIStr $PLUGINSDIR\testimgs.ini "Field 2" "Text" $PLUGINSDIR\image.bmp |
| 45 |
WriteINIStr $PLUGINSDIR\testimgs.ini "Field 3" "Text" $PLUGINSDIR\image2.bmp |
| 46 |
WriteINIStr $PLUGINSDIR\testimgs.ini "Field 4" "Text" $PLUGINSDIR\image.bmp |
| 47 |
WriteINIStr $PLUGINSDIR\testimgs.ini "Field 5" "Text" $PLUGINSDIR\image2.bmp |
| 48 |
WriteINIStr $PLUGINSDIR\testimgs.ini "Field 6" "Text" $PLUGINSDIR\icon.ico |
| 49 |
;No Text for Field 7 so it'll show the installer's icon |
| 50 |
|
| 51 |
FunctionEnd |
| 52 |
|
| 53 |
Function SetCustom |
| 54 |
|
| 55 |
;Display the InstallOptions dialog |
| 56 |
InstallOptions::dialog "$PLUGINSDIR\testimgs.ini" |
| 57 |
Pop $0 |
| 58 |
|
| 59 |
FunctionEnd |