gfx.nsi 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. ; gfx.nsi
  2. ;
  3. ; This script shows some examples of using all of the new
  4. ; graphic related additions introduced in NSIS 2
  5. ;
  6. ; Written by Amir Szkeley 22nd July 2002
  7. ;--------------------------------
  8. !macro BIMAGE IMAGE PARMS
  9. Push $0
  10. GetTempFileName $0
  11. File /oname=$0 "${IMAGE}"
  12. SetBrandingImage ${PARMS} $0
  13. Delete $0
  14. Pop $0
  15. !macroend
  16. ;--------------------------------
  17. Name "Graphical effects"
  18. OutFile "gfx.exe"
  19. ; Adds an XP manifest to the installer
  20. XPStyle on
  21. ; Add branding image to the installer (an image placeholder on the side).
  22. ; It is not enough to just add the placeholder, we must set the image too...
  23. ; We will later set the image in every pre-page function.
  24. ; We can also set just one persistent image in .onGUIInit
  25. AddBrandingImage left 100
  26. ; Sets the font of the installer
  27. SetFont "Comic Sans MS" 8
  28. ; Just to make it three pages...
  29. SubCaption 0 ": Yet another page..."
  30. SubCaption 2 ": Yet another page..."
  31. LicenseText "License page"
  32. LicenseData "gfx.nsi"
  33. DirText "Lets make a third page!"
  34. ; Install dir
  35. InstallDir "${NSISDIR}\Examples"
  36. ; Request application privileges for Windows Vista
  37. RequestExecutionLevel user
  38. ;--------------------------------
  39. ; Pages
  40. Page license licenseImage
  41. Page custom customPage
  42. Page directory dirImage
  43. Page instfiles instImage
  44. ;--------------------------------
  45. Section ""
  46. ; You can also use the BI_NEXT macro here...
  47. MessageBox MB_YESNO "We can change the branding image from within a section too!$\nDo you want me to change it?" IDNO done
  48. !insertmacro BIMAGE "${NSISDIR}\Contrib\Graphics\Wizard\nsis.bmp" ""
  49. done:
  50. WriteUninstaller uninst.exe
  51. SectionEnd
  52. ;--------------------------------
  53. Function licenseImage
  54. !insertmacro BIMAGE "${NSISDIR}\Contrib\Graphics\Header\nsis.bmp" /RESIZETOFIT
  55. MessageBox MB_YESNO 'Would you like to skip the license page?' IDNO no
  56. Abort
  57. no:
  58. FunctionEnd
  59. Function customPage
  60. !insertmacro BIMAGE "${NSISDIR}\Contrib\Graphics\Checks\modern.bmp" /RESIZETOFIT
  61. MessageBox MB_OK 'This is a nice custom "page" with yet another image :P'
  62. #insert install options/start menu/<insert plugin name here> here
  63. FunctionEnd
  64. Function dirImage
  65. !insertmacro BIMAGE "${NSISDIR}\Contrib\Graphics\Header\win.bmp" /RESIZETOFIT
  66. FunctionEnd
  67. Function instImage
  68. !insertmacro BIMAGE "${NSISDIR}\Contrib\Graphics\Wizard\llama.bmp" /RESIZETOFIT
  69. FunctionEnd
  70. ;--------------------------------
  71. ; Uninstall pages
  72. UninstPage uninstConfirm un.uninstImage
  73. UninstPage custom un.customPage
  74. UninstPage instfiles un.instImage
  75. Function un.uninstImage
  76. !insertmacro BIMAGE "${NSISDIR}\Contrib\Graphics\Checks\modern.bmp" /RESIZETOFIT
  77. FunctionEnd
  78. Function un.customPage
  79. !insertmacro BIMAGE "${NSISDIR}\Contrib\Graphics\Header\win.bmp" /RESIZETOFIT
  80. MessageBox MB_OK 'This is a nice uninstaller custom "page" with yet another image :P'
  81. #insert install options/start menu/<insert plugin name here> here
  82. FunctionEnd
  83. Function un.instImage
  84. !insertmacro BIMAGE "${NSISDIR}\Contrib\Graphics\Wizard\llama.bmp" /RESIZETOFIT
  85. FunctionEnd
  86. ;--------------------------------
  87. ; Uninstaller
  88. ; Another page for uninstaller
  89. UninstallText "Another page..."
  90. Section uninstall
  91. MessageBox MB_OK "Bla"
  92. SectionEnd