home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 March / CMCD0304.ISO / Software / Freeware / Programare / nullsoft / nsis20.exe / Examples / gfx.nsi < prev    next >
Text File  |  2003-09-23  |  3KB  |  121 lines

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