|
| 1 | +; Script generated by the HM NIS Edit Script Wizard. |
| 2 | + |
| 3 | +; HM NIS Edit Wizard helper defines |
| 4 | +!define PRODUCT_NAME "Quantum GIS" |
| 5 | +!define PRODUCT_VERSION "0.8preview3-debug" |
| 6 | +!define PRODUCT_PUBLISHER "qgis.org" |
| 7 | +!define PRODUCT_WEB_SITE "http://qgis.org" |
| 8 | +!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\qgis-debug.exe" |
| 9 | +!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" |
| 10 | +!define PRODUCT_UNINST_ROOT_KEY "HKLM" |
| 11 | +!define PRODUCT_STARTMENU_REGVAL "NSIS:StartMenuDir" |
| 12 | + |
| 13 | +SetCompressor zlib |
| 14 | +; Added by Tim for setting env vars (see this file on disk) |
| 15 | +!include WriteEnvStr.nsh |
| 16 | + |
| 17 | +; MUI 1.67 compatible ------ |
| 18 | +!include "MUI.nsh" |
| 19 | + |
| 20 | +; MUI Settings |
| 21 | +!define MUI_ABORTWARNING |
| 22 | +!define MUI_ICON "C:\dev\cpp\qgis\win_build\qgis64x64.ico" |
| 23 | +!define MUI_UNICON "C:\dev\cpp\qgis\win_build\qgis64x64.ico" |
| 24 | +; Added by Tim for side image |
| 25 | +!define MUI_WELCOMEFINISHPAGE_BITMAP "C:\dev\cpp\qgis\win_build\sidebar.bmp" |
| 26 | +; Welcome page |
| 27 | +!insertmacro MUI_PAGE_WELCOME |
| 28 | +; License page |
| 29 | +!define MUI_LICENSEPAGE_RADIOBUTTONS |
| 30 | +!insertmacro MUI_PAGE_LICENSE "C:\dev\cpp\qgis\LICENSE.txt" |
| 31 | +; Components page |
| 32 | +!insertmacro MUI_PAGE_COMPONENTS |
| 33 | +; Directory page |
| 34 | +!insertmacro MUI_PAGE_DIRECTORY |
| 35 | +; Start menu page |
| 36 | +var ICONS_GROUP |
| 37 | +!define MUI_STARTMENUPAGE_NODISABLE |
| 38 | +!define MUI_STARTMENUPAGE_DEFAULTFOLDER "Quantum GIS Debug" |
| 39 | +!define MUI_STARTMENUPAGE_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}" |
| 40 | +!define MUI_STARTMENUPAGE_REGISTRY_KEY "${PRODUCT_UNINST_KEY}" |
| 41 | +!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "${PRODUCT_STARTMENU_REGVAL}" |
| 42 | +!insertmacro MUI_PAGE_STARTMENU Application $ICONS_GROUP |
| 43 | +; Instfiles page |
| 44 | +!insertmacro MUI_PAGE_INSTFILES |
| 45 | +; Finish page |
| 46 | +!define MUI_FINISHPAGE_RUN "$INSTDIR\qgis-debug.exe" |
| 47 | +!insertmacro MUI_PAGE_FINISH |
| 48 | + |
| 49 | +; Uninstaller pages |
| 50 | +!insertmacro MUI_UNPAGE_INSTFILES |
| 51 | + |
| 52 | +; Language files |
| 53 | +!insertmacro MUI_LANGUAGE "English" |
| 54 | + |
| 55 | +; Reserve files |
| 56 | +!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS |
| 57 | + |
| 58 | +; MUI end ------ |
| 59 | + |
| 60 | +Name "${PRODUCT_NAME} ${PRODUCT_VERSION}" |
| 61 | +OutFile "qgis_debug_setup.exe" |
| 62 | +InstallDir "$PROGRAMFILES\Quantum GIS Debug" |
| 63 | +InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" "" |
| 64 | +ShowInstDetails show |
| 65 | +ShowUnInstDetails show |
| 66 | + |
| 67 | +Section "MainSection" SEC01 |
| 68 | + SetOutPath "$INSTDIR" |
| 69 | + SetOverwrite try |
| 70 | +;------- Qt |
| 71 | + File "C:\dev\cpp\qgis\qgis-debug\QtCored4.dll" |
| 72 | + File "C:\dev\cpp\qgis\qgis-debug\QtGuid4.dll" |
| 73 | + File "C:\dev\cpp\qgis\qgis-debug\QtNetworkd4.dll" |
| 74 | + File "C:\dev\cpp\qgis\qgis-debug\QtXmld4.dll" |
| 75 | + File "C:\dev\cpp\qgis\qgis-debug\QtSvgd4.dll" |
| 76 | + File "C:\dev\cpp\qgis\qgis-debug\mingwm10.dll" |
| 77 | +;------- qgis Related |
| 78 | + File "C:\dev\cpp\qgis\qgis-debug\*.dll" |
| 79 | + File "C:\dev\cpp\qgis\qgis-debug\*.exe" |
| 80 | +;------- proj and gdal Related |
| 81 | + File "C:\dev\cpp\qgis\qgis-debug\*.csv" |
| 82 | +;subdirs |
| 83 | + File /r "C:\dev\cpp\qgis\qgis-debug\lib" |
| 84 | + File /r "C:\dev\cpp\qgis\qgis-debug\share" |
| 85 | + File /r "C:\dev\cpp\qgis\qgis-debug\nad" |
| 86 | + |
| 87 | +; Shortcuts |
| 88 | +; Next line is important - added by Tim |
| 89 | +; if its not there the application working dir will be the last used |
| 90 | +; outpath |
| 91 | + SetOutPath "$INSTDIR" |
| 92 | + !insertmacro MUI_STARTMENU_WRITE_BEGIN Application |
| 93 | + CreateDirectory "$SMPROGRAMS\$ICONS_GROUP" |
| 94 | + CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Quantum GIS debug.lnk" "$INSTDIR\qgis-debug.exe" |
| 95 | + CreateShortCut "$DESKTOP\Quantum GIS debug.lnk" "$INSTDIR\qgis-debug.exe" |
| 96 | + !insertmacro MUI_STARTMENU_WRITE_END |
| 97 | +; Added by Tim to set the PROJ_LIB env var so teh nad dir can be located by Proj |
| 98 | + Push PROJ_LIB |
| 99 | + Push "$INSTDIR\nad" |
| 100 | + Call WriteEnvStr |
| 101 | + |
| 102 | +SectionEnd |
| 103 | + |
| 104 | +Section "Sample Data" SEC02 |
| 105 | + ; SetOutPath "$INSTDIR\SampleData\EnvironmentLayers\2050\A1F" |
| 106 | + ; File "C:\dev/cpp/qgis/\qgis-debug\SampleData\EnvironmentLayers\2050\A1F\Annual_dev/cpp/qgis/erature_range.asc" |
| 107 | + |
| 108 | +; Shortcuts |
| 109 | + !insertmacro MUI_STARTMENU_WRITE_BEGIN Application |
| 110 | + !insertmacro MUI_STARTMENU_WRITE_END |
| 111 | +SectionEnd |
| 112 | + |
| 113 | +Section -AdditionalIcons |
| 114 | + SetOutPath $INSTDIR |
| 115 | + !insertmacro MUI_STARTMENU_WRITE_BEGIN Application |
| 116 | + WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}" |
| 117 | + CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url" |
| 118 | + CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Uninstall.lnk" "$INSTDIR\uninst.exe" |
| 119 | + !insertmacro MUI_STARTMENU_WRITE_END |
| 120 | +SectionEnd |
| 121 | + |
| 122 | +Section -Post |
| 123 | + WriteUninstaller "$INSTDIR\uninst.exe" |
| 124 | + WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\qgis-debug.exe" |
| 125 | + WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)" |
| 126 | + WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe" |
| 127 | + WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\qgis.exe" |
| 128 | + WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}" |
| 129 | + WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}" |
| 130 | + WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}" |
| 131 | +SectionEnd |
| 132 | + |
| 133 | +; Section descriptions |
| 134 | +!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN |
| 135 | + !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} "Main application files - you really need this!" |
| 136 | + !insertmacro MUI_DESCRIPTION_TEXT ${SEC02} "Sample data (not required if you have your own data already)" |
| 137 | +!insertmacro MUI_FUNCTION_DESCRIPTION_END |
| 138 | + |
| 139 | + |
| 140 | +Function un.onUninstSuccess |
| 141 | + HideWindow |
| 142 | + MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer." |
| 143 | +FunctionEnd |
| 144 | + |
| 145 | +Function un.onInit |
| 146 | + MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2 |
| 147 | + Abort |
| 148 | +FunctionEnd |
| 149 | + |
| 150 | +Section Uninstall |
| 151 | + # remove the variable |
| 152 | + Push PROJ_LIB |
| 153 | + Call un.DeleteEnvStr |
| 154 | + |
| 155 | + !insertmacro MUI_STARTMENU_GETFOLDER "Application" $ICONS_GROUP |
| 156 | + Delete "$INSTDIR\${PRODUCT_NAME}.url" |
| 157 | + Delete "$INSTDIR\uninst-debug.exe" |
| 158 | + Delete "$INSTDIR\*.exe" |
| 159 | + Delete "$INSTDIR\*.dll" |
| 160 | + Delete "$INSTDIR\*.csv" |
| 161 | +;----------------- subdirs |
| 162 | + RMDir /r "$INSTDIR/lib" |
| 163 | + RMDir /r "$INSTDIR/share" |
| 164 | + RMDir /r "$INSTDIR/nad" |
| 165 | +;----------------- icons and shortcuts |
| 166 | + Delete "$SMPROGRAMS\$ICONS_GROUP\Uninstall.lnk" |
| 167 | + Delete "$SMPROGRAMS\$ICONS_GROUP\Website.lnk" |
| 168 | + Delete "$DESKTOP\Quantum GIS.lnk" |
| 169 | + Delete "$SMPROGRAMS\$ICONS_GROUP\Quantum GIS.lnk" |
| 170 | + RMDir "$SMPROGRAMS\$ICONS_GROUP" |
| 171 | + |
| 172 | + ;RMDir "$INSTDIR\plugins" |
| 173 | + RMDir "$INSTDIR" |
| 174 | + |
| 175 | + |
| 176 | + DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" |
| 177 | + DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}" |
| 178 | + SetAutoClose true |
| 179 | +SectionEnd |
0 commit comments