testimgs.nsi 1.9 KB

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