home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 May / CMCD0505.ISO / Software / Freeware / Grafica / gallerymage / GalleryMage-2.4.1.exe / GallMage2.nsi < prev    next >
Text File  |  2005-04-03  |  7KB  |  221 lines

  1. ;Gallery Mage install script (basedon basic example script by Joost Verburg)
  2. ;William Denniss
  3.  
  4. !define PRODUCT "Gallery Mage" ;Define your own software name here
  5. !define VERSION "2.4.1" ;Define your own software version here
  6.  
  7.  
  8. !include "MUI.nsh"
  9.  
  10. ;--------------------------------
  11. ;Configuration
  12.  
  13.   ;General
  14.   Name "Gallery Mage 2.4"      
  15.   OutFile "GalleryMage.exe"
  16.  
  17.   ;Folder selection page
  18.   InstallDir "$PROGRAMFILES\${PRODUCT}"
  19.   
  20.   ;Remember install folder
  21.   InstallDirRegKey HKCU "Software\${PRODUCT}" ""
  22.  
  23.  
  24. ShowInstDetails show
  25. ShowUninstDetails show
  26.  
  27. ;Set the installation icon
  28. !define MUI_ICON "data\tsins.ico"
  29.  
  30. ;Set the uninstall icon
  31. !define MUI_UNICON "data\tsunins.ico"
  32.  
  33.  
  34. ;--------------------------------
  35. ;Modern UI Configuration
  36.  
  37.   !insertmacro MUI_PAGE_WELCOME
  38.   !insertmacro MUI_PAGE_LICENSE "COPYING.txt"
  39.   !insertmacro MUI_PAGE_COMPONENTS
  40.   !insertmacro MUI_PAGE_DIRECTORY
  41.   !insertmacro MUI_PAGE_INSTFILES
  42.       !define MUI_FINISHPAGE_RUN "$INSTDIR\GallMage2-javaw.bat"
  43.   !insertmacro MUI_PAGE_FINISH
  44.   !insertmacro MUI_UNPAGE_WELCOME
  45.   !insertmacro MUI_UNPAGE_CONFIRM
  46.   !insertmacro MUI_UNPAGE_INSTFILES
  47.   !insertmacro MUI_UNPAGE_FINISH
  48.  
  49.   
  50. ;--------------------------------
  51. ;Languages
  52.  
  53.   !insertmacro MUI_LANGUAGE "English"
  54.   
  55. ;--------------------------------
  56. ;Language Strings
  57.  
  58.   ;Description
  59.   LangString DESC_SecCopyUI ${LANG_ENGLISH} "Gallery Mage program files"
  60.   LangString DESC_SecShortcuts ${LANG_ENGLISH} "Shortcuts to Gallery Mage placed in your start menu."
  61.   LangString DESC_SecSource ${LANG_ENGLISH} "The Gallery Mage source code (GPL'd).  Required if you want to modify the program itself."
  62.   LangString DESC_SecSample ${LANG_ENGLISH} "Sample photo gallery."
  63.   LangString DESC_SecShortcutsDesk ${LANG_ENGLISH} "Places a shortcut on your desktop."
  64.   ;LangString MUI_TEXT_FINISH_RUN ${LANG_ENGLISH} "empty"
  65.  
  66. ;--------------------------------
  67. ;Data
  68.   
  69.   LicenseData "COPYING.txt"
  70.  
  71. ;--------------------------------
  72. ;Installer Sections
  73.  
  74. InstType "Normal"
  75. InstType "Full"
  76. InstType "Minimal"
  77.  
  78. Section "Gallery Mage (required)" SecCopyUI
  79.  
  80.   SectionIn 1 2 3 RO
  81.  
  82.   ;ADD YOUR OWN STUFF HERE!
  83.  
  84.   SetOutPath "$INSTDIR"
  85.   File "*.bat"
  86.   File "README.txt"
  87.   File "COPYING.txt"
  88.   File "ChangeLog"
  89.   File "gallmage.jar"
  90.   File /r lib
  91.   SetOverwrite off
  92.   File /r conf
  93.   SetOverwrite on
  94.   File /r data
  95.  
  96.   SetOutPath "$INSTDIR\doc\"
  97.   File "doc\gallmage.pdf"
  98.   SetOutPath "$INSTDIR\doc\gallmage\"
  99.   File /r "doc\gallmage\"
  100.  
  101.   SetOutPath "$INSTDIR"
  102.   
  103.   ;Store install folder
  104.   WriteRegStr HKCU "Software\${PRODUCT}" "" $INSTDIR
  105.   
  106.   ;Create uninstaller
  107.   ; Write the uninstall keys for Windows
  108.   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GallMage" "DisplayName" "Gallery Mage"
  109.   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GallMage" "UninstallString" '"$INSTDIR\uninstall.exe"'
  110.   WriteUninstaller "$INSTDIR\Uninstall.exe"
  111.  
  112. SectionEnd
  113.  
  114. ; optional section (can be disabled by the user)
  115. Section "Start Menu Shortcuts" SecShortcuts
  116.  
  117.   SectionIn 1 2 3
  118.  
  119.   CreateDirectory "$SMPROGRAMS\Gallery Mage"
  120.   CreateShortCut "$SMPROGRAMS\${PRODUCT}\${PRODUCT}.lnk" "$SYSDIR\javaw.exe" '-Xms32m -Xmx512m -jar "$INSTDIR\gallmage.jar"' "$INSTDIR\data\gm.ico" 0
  121.   CreateShortCut "$SMPROGRAMS\Gallery Mage\${PRODUCT} (debug).lnk" "$INSTDIR\GallMage2.bat" "" "" 0
  122.   WriteINIStr "$SMPROGRAMS\Gallery Mage\Get Java 1.4+ (needed to run).url" "InternetShortcut" "URL" "http://java.com/"
  123.   WriteINIStr "$SMPROGRAMS\Gallery Mage\Gallery Mage Web Site.url" "InternetShortcut" "URL" "http://TankSoftware.com/gallmage/"
  124.   CreateShortCut "$SMPROGRAMS\${PRODUCT}\Ini Editor.lnk" "$SYSDIR\javaw.exe" '-cp "$INSTDIR\lib\jtank.jar" net.jtank.io.IniEditor' "" 0
  125.   CreateShortCut "$SMPROGRAMS\Gallery Mage\Readme.lnk" "$INSTDIR\README.txt" "" "" 0
  126.   CreateShortCut "$SMPROGRAMS\Gallery Mage\Manual.lnk" "$INSTDIR\doc\gallmage.pdf" "" "" 0
  127.   CreateShortCut "$SMPROGRAMS\Gallery Mage\Manual (html).lnk" "$INSTDIR\doc\gallmage\index.html" "" "" 0
  128.   CreateShortCut "$SMPROGRAMS\Gallery Mage\License.lnk" "$INSTDIR\COPYING.txt" "" "" 0
  129.   CreateShortCut "$SMPROGRAMS\Gallery Mage\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
  130.   
  131. SectionEnd
  132.  
  133. Section "Desktop Shortcut"  SecShortcutsDesk
  134.  
  135.     SectionIn 1 2
  136.         CreateShortCut "$DESKTOP\${PRODUCT}.lnk" "$SYSDIR\javaw.exe" '-Xms32m -Xmx512m -jar "$INSTDIR\gallmage.jar"' "$INSTDIR\data\gm.ico" 0
  137.  
  138. SectionEnd
  139.  
  140.  
  141. ; optional section (can be disabled by the user)
  142. Section "Sample Gallery" SecSample
  143.  
  144.   SectionIn 1 2
  145.  
  146.   SetOutPath "$INSTDIR"
  147.   File /r sample
  148.   
  149. SectionEnd
  150.  
  151.  
  152. ; optional section (can be disabled by the user)
  153. Section "Source Code" SecSource
  154.  
  155.   SectionIn 2
  156.   
  157.   SetOutPath "$INSTDIR"
  158.   File "build.xml"
  159.   File "*.nsi"
  160.   File /r src
  161.  
  162.   
  163. SectionEnd
  164.  
  165.  
  166.  
  167. ;Display the Finish header
  168. ;Insert this macro after the sections if you are not using a finish page
  169. ;!insertmacro MUI_SECTIONS_FINISHHEADER
  170.  
  171. ;--------------------------------
  172. ;Descriptions
  173.  
  174. !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
  175.   !insertmacro MUI_DESCRIPTION_TEXT ${SecCopyUI} $(DESC_SecCopyUI)
  176.   !insertmacro MUI_DESCRIPTION_TEXT ${SecShortcuts} $(DESC_SecShortcuts)
  177.   !insertmacro MUI_DESCRIPTION_TEXT ${SecSource} $(DESC_SecSource)
  178.   !insertmacro MUI_DESCRIPTION_TEXT ${SecSample} $(DESC_SecSample)
  179.   !insertmacro MUI_DESCRIPTION_TEXT ${SecShortcutsDesk} $(DESC_SecShortcutsDesk)
  180.  
  181. !insertmacro MUI_FUNCTION_DESCRIPTION_END
  182.  
  183. ;--------------------------------
  184. ;Uninstaller Section
  185.  
  186. Section "Uninstall"
  187.  
  188.   ; remove registry keys
  189.   DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GallMage"
  190.   DeleteRegKey HKCU "Software\${PRODUCT}" 
  191.  
  192.   ; remove shortcuts, if any
  193.   Delete "$SMPROGRAMS\Gallery Mage\*.*"
  194.   RMDir /r "$SMPROGRAMS\Gallery Mage"
  195.  
  196.   Delete "$INSTDIR\Uninstall.exe"
  197.   RMDir /r "$INSTDIR\doc"
  198.   RMDir /r "$INSTDIR\sample"
  199.   RMDir /r "$INSTDIR\lib"
  200.   RMDir /r "$INSTDIR\data"
  201.   RMDir /r "$INSTDIR\src"
  202.   Delete "$INSTDIR\build.xml"
  203.   Delete "$INSTDIR\GallMage.nsi"
  204.   Delete "$INSTDIR\gallmage.jar"
  205.   Delete "$INSTDIR\GallMage2"
  206.   Delete "$INSTDIR\*.bat"
  207.   Delete "$INSTDIR\README.txt"
  208.   Delete "$INSTDIR\COPYING.txt"
  209.   Delete "$INSTDIR\ChangeLog"
  210.  
  211.  
  212.  
  213.   RMDir "$INSTDIR"
  214.  
  215.   DeleteRegKey /ifempty HKCU "Software\${PRODUCT}"
  216.   
  217.   ;Display the Finish header
  218. ;  !insertmacro MUI_UNFINISHHEADER
  219.  
  220. SectionEnd
  221.