/************************************************************************* * * 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.2 !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 ;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 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