; Script generated by the HM NIS Edit Script Wizard. ; HM NIS Edit Wizard helper defines !define PRODUCT_NAME "QuteMol" !define PRODUCT_VERSION "0.4.1" !define PRODUCT_PUBLISHER "Visual Computing Lab, ISTI - CNR" !define PRODUCT_WEB_SITE "http://qutemol.sourceforge.net" !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\qutemol.exe" !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" !define PRODUCT_UNINST_ROOT_KEY "HKLM" !define DEVCPPDIR "C:\Dev-Cpp\bin" ; MUI 1.67 compatible ------ !include "MUI.nsh" ; MUI Settings !define MUI_ABORTWARNING !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico" !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico" XPStyle on Function .onInit # the plugins dir is automatically deleted when the installer exits InitPluginsDir #File /oname=$PLUGINSDIR\splash.bmp "${NSISDIR}\Contrib\Graphics\Wizard\orange-nsis.bmp" File /oname=$PLUGINSDIR\splash.bmp "installsplash.bmp" #optional #File /oname=$PLUGINSDIR\splash.wav "C:\myprog\sound.wav" splash::show 1500 $PLUGINSDIR\splash Pop $0 ; $0 has '1' if the user closed the splash screen early, ; '0' if everything closed normally, and '-1' if some error occurred. FunctionEnd !macro BIMAGE IMAGE PARMS Push $0 GetTempFileName $0 File /oname=$0 "${IMAGE}" SetBrandingImage ${PARMS} $0 Delete $0 Pop $0 !macroend ; Welcome page !insertmacro MUI_PAGE_WELCOME ; License page !insertmacro MUI_PAGE_LICENSE "license.txt" ; License page !insertmacro MUI_PAGE_LICENSE "citeware.txt" ; Directory page !insertmacro MUI_PAGE_DIRECTORY ; Instfiles page !insertmacro MUI_PAGE_INSTFILES ; Finish page !define MUI_FINISHPAGE_RUN "$INSTDIR\qutemol.exe" !insertmacro MUI_PAGE_FINISH ; Uninstaller pages !insertmacro MUI_UNPAGE_INSTFILES ; Language files !insertmacro MUI_LANGUAGE "English" !define MUI_HEADERIMAGE !define MUI_HEADERIMAGE_BITMAP "installsplash.bmp" ; optional ; MUI end ------ Name "${PRODUCT_NAME} ${PRODUCT_VERSION}" OutFile "QuteMolSetup.exe" ; Adds an XP manifest to the installer ; Add branding image to the installer (an image placeholder on the side). ; It is not enough to just add the placeholder, we must set the image too... ; We will later set the image in every pre-page function. ; We can also set just one persistent image in .onGUIInit ;AddBrandingImage left 100 InstallDir "$PROGRAMFILES\VCG\QuteMol" InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" "" ShowInstDetails show ShowUnInstDetails show Section "MainSection" SEC01 ; File /oname=$PLUGINSDIR\splash.bmp "installsplash.bmp" ; SetBrandingImage splash /RESIZETOFIT SetOutPath "$INSTDIR" SetOverwrite ifnewer File "gpl.txt" File "readme.txt" File "whatsnew.txt" File "art_example.txt" File "..\qutemol.exe" ; File "${DEVCPPDIR}\MINGWM10.dll" ; File "${DEVCPPDIR}\GLEW32.dll" ; File "${DEVCPPDIR}\JPEG62.dll" ; File "${DEVCPPDIR}\LIBPNG13.dll" ; File "${DEVCPPDIR}\ZLIB1.dll" CreateDirectory "$SMPROGRAMS\QuteMol" CreateShortCut "$SMPROGRAMS\QuteMol\QuteMol.lnk" "$INSTDIR\qutemol.exe" CreateShortCut "$DESKTOP\QuteMol.lnk" "$INSTDIR\qutemol.exe" SetOutPath "$INSTDIR\sample" File "..\sample\porin.pdb" File "..\sample\caffeine.pdb" File "..\sample\testosterone.pdb" SetOutPath "$INSTDIR\image" File "..\image\*.png" SetOutPath "$INSTDIR\presets" File "..\presets\*.preset" SectionEnd Section -AdditionalIcons SetOutPath $INSTDIR WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}" CreateShortCut "$SMPROGRAMS\QuteMol\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url" CreateShortCut "$SMPROGRAMS\QuteMol\Uninstall.lnk" "$INSTDIR\uninst.exe" CreateShortCut "$SMPROGRAMS\QuteMol\QuteMol Configuration.lnk" notepad.exe "$INSTDIR\QuteMol.cfg" SectionEnd Section -Post WriteUninstaller "$INSTDIR\uninst.exe" WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\qutemol.exe" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\qutemol.exe" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}" SectionEnd Function un.onUninstSuccess HideWindow MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer." FunctionEnd Function un.onInit MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2 Abort FunctionEnd Section Uninstall Delete "$INSTDIR\${PRODUCT_NAME}.url" Delete "$INSTDIR\uninst.exe" Delete "$INSTDIR\sample\*.pdb" Delete "$INSTDIR\sample\*.png" Delete "$INSTDIR\image\*.png" Delete "$INSTDIR\presets\*.preset" Delete "$INSTDIR\qutemol.exe" Delete "$INSTDIR\*.txt" Delete "$INSTDIR\*.dll" Delete "$INSTDIR\qutemol.cfg" Delete "$DESKTOP\QuteMol.lnk" Delete "$SMPROGRAMS\QuteMol\Uninstall.lnk" Delete "$SMPROGRAMS\QuteMol\Website.lnk" Delete "$SMPROGRAMS\QuteMol\QuteMol.lnk" Delete "$SMPROGRAMS\QuteMol\QuteMol Configuration.lnk" RMDir "$SMPROGRAMS\QuteMol" RMDir "$INSTDIR\sample" RMDir "$INSTDIR\presets" RMDir "$INSTDIR\image" RMDir "$INSTDIR" DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}" SetAutoClose true SectionEnd