/************************************************************************* * * NSIS Setup script * * (c) 2009 by Pharo Community, All rights reserved * * Requires: NSIS 2.42 http://nsis.sourceforge.net * ZIP DLL http://nsis.sourceforge.net/ZipDLL *************************************************************************/ SetCompressor /SOLID lzma ;use LZMA algorithm ################################### # Includes ################################### !include "MUI.nsh" !include "ZipDLL.nsh" ################################### # Definitions ################################### ; General definitions !define /date TIMESTAMP "%Y-%m-%d-%H-%M-%S" !define PROVIDER "Pharo Community" !define PRODUCT "Pharo" !define PRODUCT_LOWERCASE "pharo" !define VERSION 0.0.0.3 !define URL "http://www.pharo-project.org" !define YEAR "2009" !define LAUNCHER "pharo.exe" !define APP_NAME "${PRODUCT}" !define REG_KEY "SOFTWARE\${APP_NAME}" !define MGROUP "${PRODUCT}" ; SOURCE Definitions !define SETUP_NAME "setup_${PRODUCT_LOWERCASE}_${VERSION}.exe" !define OUTPUT_TARGET "${SETUP_NAME}" ; TARGET Definitions !define TARGET_DIR "$LOCALAPPDATA\${PRODUCT}" ################################### # Compiler commands ################################### Name "${PRODUCT}" OutFile "${OUTPUT_TARGET}" InstallDir "${TARGET_DIR}" ;Default installation InstallDirRegKey HKCU "${REG_KEY}" "" ;Get installation from registry if available RequestExecutionLevel user ;Request application privileges for Windows Vista BrandingText "${APP_NAME} Version ${VERSION}" ;brand the installer so now NSIS stuff is shown XPStyle on CRCCheck on ;do a CRC check SetOverwrite on ;force overwrite SetCompress force ;force compression ################################### # Infos for Software control panel ################################### VIProductVersion 0.0.0.2 VIAddVersionKey ProductName "${APP_NAME}" VIAddVersionKey ProductVersion "${VERSION}" VIAddVersionKey CompanyName "${PROVIDER}" VIAddVersionKey CompanyWebsite "${URL}" VIAddVersionKey FileVersion "" VIAddVersionKey FileDescription "" VIAddVersionKey LegalCopyright "(c) ${YEAR} by ${PROVIDER}" ################################### # Modern User Interface settings ################################### ; Other Definitions !define MUI_ICON "pharo.ico" ; icon for the installer !define MUI_HEADERIMAGE !define MUI_HEADERIMAGE_BITMAP "header.bmp" ; optional !define MUI_WELCOMEFINISHPAGE_BITMAP "welcome.bmp" ; optional !define MUI_FINISHPAGE_NOAUTOCLOSE ; Do not automatically jump to the finish page, to allow the user to check the install log. !define MUI_UNFINISHPAGE_NOAUTOCLOSE ; Do not automatically jump to the finish page, to allow the user to check the uninstall log. !define MUI_FINISHPAGE_RUN "$INSTDIR\${LAUNCHER}" ; allows to run the application after install ################################### # Pages ################################### ;Installer pages !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_LICENSE "license.rtf" !insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_FINISH ;Uninstaller pages !insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_INSTFILES ################################### # Language ################################### !insertmacro MUI_LANGUAGE "English" ################################### # Installer section ################################### Section "Pharo VM" Section1 SetOutPath "$INSTDIR" SetOverwrite on DetailPrint "Installation Started." File license.rtf File Pharo.exe File Pharo.ini File splash.bmp File SqueakFFIPrims.dll File FT2Plugin.dll SetOutPath $INSTDIR\Fonts SetOutPath $INSTDIR\Fonts\DejaVu File Fonts\DejaVu\AUTHORS File Fonts\DejaVu\BUGS File Fonts\DejaVu\DejaVuSans.ttf File Fonts\DejaVu\DejaVuSans-Bold.ttf File Fonts\DejaVu\DejaVuSans-BoldOblique.ttf File Fonts\DejaVu\DejaVuSansCondensed.ttf File Fonts\DejaVu\DejaVuSansCondensed-Bold.ttf File Fonts\DejaVu\DejaVuSansCondensed-BoldOblique.ttf File Fonts\DejaVu\DejaVuSansCondensed-Oblique.ttf File Fonts\DejaVu\DejaVuSans-ExtraLight.ttf File Fonts\DejaVu\DejaVuSansMono.ttf File Fonts\DejaVu\DejaVuSansMono-Bold.ttf File Fonts\DejaVu\DejaVuSansMono-BoldOblique.ttf File Fonts\DejaVu\DejaVuSansMono-Oblique.ttf File Fonts\DejaVu\DejaVuSans-Oblique.ttf File Fonts\DejaVu\DejaVuSerif.ttf File Fonts\DejaVu\DejaVuSerif-Bold.ttf File Fonts\DejaVu\DejaVuSerif-BoldItalic.ttf File Fonts\DejaVu\DejaVuSerifCondensed.ttf File Fonts\DejaVu\DejaVuSerifCondensed-Bold.ttf File Fonts\DejaVu\DejaVuSerifCondensed-BoldItalic.ttf File Fonts\DejaVu\DejaVuSerifCondensed-Italic.ttf File Fonts\DejaVu\DejaVuSerif-Italic.ttf File Fonts\DejaVu\langcover.txt File Fonts\DejaVu\LICENSE File Fonts\DejaVu\NEWS File Fonts\DejaVu\README File Fonts\DejaVu\status.txt File Fonts\DejaVu\unicover.txt ;Store installation WriteRegStr HKCU "${REG_KEY}" "" $INSTDIR ;Create uninstaller WriteUninstaller "$INSTDIR\Uninstall.exe" SetOutPath $INSTDIR DetailPrint "Create Program group" CreateDirectory "$SMPROGRAMS\${MGROUP}" CreateShortCut "$SMPROGRAMS\${MGROUP}\${PRODUCT}.lnk" "$INSTDIR\${LAUNCHER}" CreateShortCut "$SMPROGRAMS\${MGROUP}\Uninstall.lnk" "$INSTDIR\Uninstall.exe" SectionEnd Section "Image and Sources" Section2 SetOutPath "$INSTDIR" File pharo.changes File pharo.image File SqueakV39.sources SectionEnd ################################### # Section description ################################### LangString DESC_Section1 ${LANG_ENGLISH} "The pharo virtual machine and components" LangString DESC_Section2 ${LANG_ENGLISH} "The pharo image and sources" !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${Section1} $(DESC_Section1) !insertmacro MUI_DESCRIPTION_TEXT ${Section2} $(DESC_Section2) !insertmacro MUI_FUNCTION_DESCRIPTION_END ################################### # Uninstaller section ################################### Section "Uninstall" SetOutPath $INSTDIR DetailPrint "Start uninstalling" Delete "$INSTDIR\license.rtf" Delete "$INSTDIR\Pharo.exe" Delete "$INSTDIR\Pharo.ini" Delete "$INSTDIR\splash.bmp" Delete "$INSTDIR\SqueakFFIPrims.dll" Delete "$INSTDIR\FT2Plugin.dll" Delete "$INSTDIR\pharo.changes" Delete "$INSTDIR\pharo.image" Delete "$INSTDIR\SqueakV39.sources" Delete "$INSTDIR\Fonts\DejaVu\AUTHORS" Delete "$INSTDIR\Fonts\DejaVu\BUGS" Delete "$INSTDIR\Fonts\DejaVu\DejaVuSans.ttf" Delete "$INSTDIR\Fonts\DejaVu\DejaVuSans-Bold.ttf" Delete "$INSTDIR\Fonts\DejaVu\DejaVuSans-BoldOblique.ttf" Delete "$INSTDIR\Fonts\DejaVu\DejaVuSansCondensed.ttf" Delete "$INSTDIR\Fonts\DejaVu\DejaVuSansCondensed-Bold.ttf" Delete "$INSTDIR\Fonts\DejaVu\DejaVuSansCondensed-BoldOblique.ttf" Delete "$INSTDIR\Fonts\DejaVu\DejaVuSansCondensed-Oblique.ttf" Delete "$INSTDIR\Fonts\DejaVu\DejaVuSans-ExtraLight.ttf" Delete "$INSTDIR\Fonts\DejaVu\DejaVuSansMono.ttf" Delete "$INSTDIR\Fonts\DejaVu\DejaVuSansMono-Bold.ttf" Delete "$INSTDIR\Fonts\DejaVu\DejaVuSansMono-BoldOblique.ttf" Delete "$INSTDIR\Fonts\DejaVu\DejaVuSansMono-Oblique.ttf" Delete "$INSTDIR\Fonts\DejaVu\DejaVuSans-Oblique.ttf" Delete "$INSTDIR\Fonts\DejaVu\DejaVuSerif.ttf" Delete "$INSTDIR\Fonts\DejaVu\DejaVuSerif-Bold.ttf" Delete "$INSTDIR\Fonts\DejaVu\DejaVuSerif-BoldItalic.ttf" Delete "$INSTDIR\Fonts\DejaVu\DejaVuSerifCondensed.ttf" Delete "$INSTDIR\Fonts\DejaVu\DejaVuSerifCondensed-Bold.ttf" Delete "$INSTDIR\Fonts\DejaVu\DejaVuSerifCondensed-BoldItalic.ttf" Delete "$INSTDIR\Fonts\DejaVu\DejaVuSerifCondensed-Italic.ttf" Delete "$INSTDIR\Fonts\DejaVu\DejaVuSerif-Italic.ttf" Delete "$INSTDIR\Fonts\DejaVu\langcover.txt" Delete "$INSTDIR\Fonts\DejaVu\LICENSE" Delete "$INSTDIR\Fonts\DejaVu\NEWS" Delete "$INSTDIR\Fonts\DejaVu\README" Delete "$INSTDIR\Fonts\DejaVu\status.txt" Delete "$INSTDIR\Fonts\DejaVu\unicover.txt" RmDir $INSTDIR\Fonts\DejaVu RmDir $INSTDIR\Fonts ;delete uninstaller Delete "$INSTDIR\Uninstall.exe" RmDir /r /REBOOTOK "$SMPROGRAMS\${MGROUP}" RmDir /REBOOTOK $INSTDIR DeleteRegKey /ifempty HKCU "${REG_KEY}" SectionEnd ################################# # Utilities ################################# # Installer functions Function .onInit InitPluginsDir Push $R1 File /oname=$PLUGINSDIR\spltmp.bmp splash.bmp advsplash::show 3000 600 400 -1 $PLUGINSDIR\spltmp Pop $R1 Pop $R1 FunctionEnd