| 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|---|
| 2 | ;;
|
|---|
| 3 | ;; Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|---|
| 4 | ;; Contact: Qt Software Information (qt-info@nokia.com)
|
|---|
| 5 | ;;
|
|---|
| 6 | ;; This file is part of the tools applications of the Qt Toolkit.
|
|---|
| 7 | ;;
|
|---|
| 8 | ;; $QT_BEGIN_LICENSE:LGPL$
|
|---|
| 9 | ;; Commercial Usage
|
|---|
| 10 | ;; Licensees holding valid Qt Commercial licenses may use this file in
|
|---|
| 11 | ;; accordance with the Qt Commercial License Agreement provided with the
|
|---|
| 12 | ;; Software or, alternatively, in accordance with the terms contained in
|
|---|
| 13 | ;; a written agreement between you and Nokia.
|
|---|
| 14 | ;;
|
|---|
| 15 | ;; GNU Lesser General Public License Usage
|
|---|
| 16 | ;; Alternatively, this file may be used under the terms of the GNU Lesser
|
|---|
| 17 | ;; General Public License version 2.1 as published by the Free Software
|
|---|
| 18 | ;; Foundation and appearing in the file LICENSE.LGPL included in the
|
|---|
| 19 | ;; packaging of this file. Please review the following information to
|
|---|
| 20 | ;; ensure the GNU Lesser General Public License version 2.1 requirements
|
|---|
| 21 | ;; will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|---|
| 22 | ;;
|
|---|
| 23 | ;; In addition, as a special exception, Nokia gives you certain
|
|---|
| 24 | ;; additional rights. These rights are described in the Nokia Qt LGPL
|
|---|
| 25 | ;; Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
|
|---|
| 26 | ;; package.
|
|---|
| 27 | ;;
|
|---|
| 28 | ;; GNU General Public License Usage
|
|---|
| 29 | ;; Alternatively, this file may be used under the terms of the GNU
|
|---|
| 30 | ;; General Public License version 3.0 as published by the Free Software
|
|---|
| 31 | ;; Foundation and appearing in the file LICENSE.GPL included in the
|
|---|
| 32 | ;; packaging of this file. Please review the following information to
|
|---|
| 33 | ;; ensure the GNU General Public License version 3.0 requirements will be
|
|---|
| 34 | ;; met: http://www.gnu.org/copyleft/gpl.html.
|
|---|
| 35 | ;;
|
|---|
| 36 | ;; If you are unsure which license is appropriate for your use, please
|
|---|
| 37 | ;; contact the sales department at qt-sales@nokia.com.
|
|---|
| 38 | ;; $QT_END_LICENSE$
|
|---|
| 39 | ;;
|
|---|
| 40 | ;; This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|---|
| 41 | ;; WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|---|
| 42 | ;;
|
|---|
| 43 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|---|
| 44 | ; Script generated by the HM NIS Edit Script Wizard.
|
|---|
| 45 |
|
|---|
| 46 | !include "config.nsh"
|
|---|
| 47 | !include "includes\global.nsh"
|
|---|
| 48 |
|
|---|
| 49 | !define PRODUCT_PUBLISHER "Nokia Corporation and/or its subsidiary(-ies)"
|
|---|
| 50 | !define PRODUCT_WEB_SITE "http://qtsoftware.com"
|
|---|
| 51 |
|
|---|
| 52 | !define INSTALL_ICON "images\install.ico"
|
|---|
| 53 | !define WELCOME_PAGE_ICON "images\qt-wizard.bmp"
|
|---|
| 54 | !define PAGE_HEADER_ICON "images\qt-header.bmp"
|
|---|
| 55 |
|
|---|
| 56 | !include "MUI.nsh"
|
|---|
| 57 |
|
|---|
| 58 | ; modules
|
|---|
| 59 | !include "modules\mingw.nsh"
|
|---|
| 60 | !include "modules\opensource.nsh"
|
|---|
| 61 | !include "includes\instdir.nsh"
|
|---|
| 62 | !include "modules\environment.nsh"
|
|---|
| 63 | !include "modules\registeruiext.nsh"
|
|---|
| 64 | !ifndef OPENSOURCE_BUILD
|
|---|
| 65 | !include "modules\msvc.nsh"
|
|---|
| 66 | !include "modules\addin7x.nsh"
|
|---|
| 67 | !include "modules\qsa.nsh"
|
|---|
| 68 | !include "modules\addin60.nsh"
|
|---|
| 69 | !include "modules\debugext.nsh"
|
|---|
| 70 | !include "modules\license.nsh"
|
|---|
| 71 | !include "modules\vsip.nsh"
|
|---|
| 72 | !include "modules\help.nsh"
|
|---|
| 73 | !include "modules\evaluation.nsh"
|
|---|
| 74 | !include "modules\eclipse.nsh"
|
|---|
| 75 | !include "modules\qtjambieclipse.nsh"
|
|---|
| 76 | !endif
|
|---|
| 77 |
|
|---|
| 78 | ; MUI Settings
|
|---|
| 79 | !define MUI_ABORTWARNING
|
|---|
| 80 | !define MUI_ICON "${INSTALL_ICON}"
|
|---|
| 81 | !define MUI_UNICON "${INSTALL_ICON}"
|
|---|
| 82 |
|
|---|
| 83 | !define MUI_HEADERIMAGE
|
|---|
| 84 | !define MUI_HEADERIMAGE_BITMAP "${PAGE_HEADER_ICON}"
|
|---|
| 85 | !define MUI_HEADERIMAGE_UNBITMAP "${PAGE_HEADER_ICON}"
|
|---|
| 86 |
|
|---|
| 87 | !define MUI_WELCOMEFINISHPAGE_BITMAP "${WELCOME_PAGE_ICON}"
|
|---|
| 88 | !define MUI_UNWELCOMEFINISHPAGE_BITMAP "${WELCOME_PAGE_ICON}"
|
|---|
| 89 |
|
|---|
| 90 | !ifdef WELCOME_NOTE
|
|---|
| 91 | !define MUI_WELCOMEPAGE_TEXT "${WELCOME_NOTE}"
|
|---|
| 92 | !endif
|
|---|
| 93 | !insertmacro MUI_PAGE_WELCOME
|
|---|
| 94 | !insertmacro OPENSOURCE_INITIALIZE
|
|---|
| 95 | !ifndef OPENSOURCE_BUILD
|
|---|
| 96 | !insertmacro EVALUATION_INITIALIZE
|
|---|
| 97 | !insertmacro LICENSECHECK_INITIALIZE
|
|---|
| 98 | !insertmacro MSVC_INITIALIZE
|
|---|
| 99 | !insertmacro ADDIN7X_INITIALIZE
|
|---|
| 100 | !insertmacro ADDIN60_INITIALIZE
|
|---|
| 101 | !insertmacro DEBUGEXT_INITIALIZE
|
|---|
| 102 | !insertmacro HELP_INITIALIZE
|
|---|
| 103 | !insertmacro VSIP_INITIALIZE
|
|---|
| 104 | !endif
|
|---|
| 105 |
|
|---|
| 106 | !ifdef USE_COMPONENT_PAGE
|
|---|
| 107 | !insertmacro MUI_PAGE_COMPONENTS
|
|---|
| 108 | !endif
|
|---|
| 109 |
|
|---|
| 110 | !ifdef USE_DIRECTORY_PAGE
|
|---|
| 111 | !insertmacro INSTDIR_INITIALIZE
|
|---|
| 112 | !endif
|
|---|
| 113 |
|
|---|
| 114 | !ifdef USE_STARTMENU_PAGE
|
|---|
| 115 | !define MUI_STARTMENUPAGE_NODISABLE
|
|---|
| 116 | !define MUI_STARTMENUPAGE_DEFAULTFOLDER "${DEFAULT_STARTMENU_STRING}"
|
|---|
| 117 | !insertmacro MUI_PAGE_STARTMENU 1 $STARTMENU_STRING
|
|---|
| 118 | !endif
|
|---|
| 119 |
|
|---|
| 120 | !insertmacro MINGW_INITIALIZE
|
|---|
| 121 | !insertmacro ENVIRONMENT_INITIALIZE
|
|---|
| 122 | !insertmacro REGISTERUIEXT_INITIALIZE
|
|---|
| 123 | !ifndef OPENSOURCE_BUILD
|
|---|
| 124 | !insertmacro QSA_INITIALIZE
|
|---|
| 125 | !insertmacro ECLIPSE_INITIALIZE
|
|---|
| 126 | !insertmacro QTJAMBIECLIPSE_INITIALIZE
|
|---|
| 127 | !endif
|
|---|
| 128 |
|
|---|
| 129 | !define MUI_FINISHPAGE_NOAUTOCLOSE
|
|---|
| 130 |
|
|---|
| 131 | !insertmacro MUI_PAGE_INSTFILES
|
|---|
| 132 | !ifdef README_FILE
|
|---|
| 133 | !define MUI_FINISHPAGE_SHOWREADME ${README_FILE}
|
|---|
| 134 | !else
|
|---|
| 135 | !ifdef README_FUNCTION
|
|---|
| 136 | !define MUI_FINISHPAGE_SHOWREADME
|
|---|
| 137 | !define MUI_FINISHPAGE_SHOWREADME_TEXT "${README_FUNCTION}"
|
|---|
| 138 | !define MUI_FINISHPAGE_SHOWREADME_FUNCTION "CommonReadmeFunction"
|
|---|
| 139 | !endif
|
|---|
| 140 | !endif
|
|---|
| 141 | !ifdef RUN_FUNCTION
|
|---|
| 142 | !define MUI_FINISHPAGE_RUN
|
|---|
| 143 | !define MUI_FINISHPAGE_RUN_TEXT "${RUN_FUNCTION}"
|
|---|
| 144 | !define MUI_FINISHPAGE_RUN_FUNCTION "CommonRunFunction"
|
|---|
| 145 | !endif
|
|---|
| 146 | !insertmacro MUI_PAGE_FINISH
|
|---|
| 147 |
|
|---|
| 148 | !insertmacro MUI_UNPAGE_WELCOME
|
|---|
| 149 | !define UNINSTALLER_CONFIRM_PAGE "confirmpage.ini"
|
|---|
| 150 | UninstPage custom un.UninstallerConfirmPage
|
|---|
| 151 | !insertmacro MUI_UNPAGE_INSTFILES
|
|---|
| 152 |
|
|---|
| 153 | !insertmacro MUI_UNPAGE_FINISH
|
|---|
| 154 |
|
|---|
| 155 | !insertmacro MUI_LANGUAGE "English"
|
|---|
| 156 |
|
|---|
| 157 | Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
|
|---|
| 158 | OutFile ${OUTPUT_FILE}
|
|---|
| 159 |
|
|---|
| 160 | Section -PreCommonSection
|
|---|
| 161 | !ifdef INSTDIR_0 ;the default one, must exist
|
|---|
| 162 | strcpy $INSTDIR $${INSTDIR_0}_INSTDIR
|
|---|
| 163 | ${StrRep} $PRODUCT_UNIQUE_KEY "${PRODUCT_NAME} ${PRODUCT_VERSION} - $INSTDIR" "\" "_"
|
|---|
| 164 | strcpy $PRODUCT_UNIQUE_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\$PRODUCT_UNIQUE_KEY"
|
|---|
| 165 | WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "${INSTDIR_0}_INSTDIR" "$${INSTDIR_0}_INSTDIR"
|
|---|
| 166 | !endif
|
|---|
| 167 | !ifdef INSTDIR_1
|
|---|
| 168 | WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "${INSTDIR_1}_INSTDIR" "$${INSTDIR_1}_INSTDIR"
|
|---|
| 169 | !endif
|
|---|
| 170 | !ifdef INSTDIR_2
|
|---|
| 171 | WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "${INSTDIR_2}_INSTDIR" "$${INSTDIR_2}_INSTDIR"
|
|---|
| 172 | !endif
|
|---|
| 173 | !ifdef INSTDIR_3
|
|---|
| 174 | WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "${INSTDIR_3}_INSTDIR" "$${INSTDIR_3}_INSTDIR"
|
|---|
| 175 | !endif
|
|---|
| 176 | !ifdef INSTDIR_4
|
|---|
| 177 | WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "${INSTDIR_4}_INSTDIR" "$${INSTDIR_4}_INSTDIR"
|
|---|
| 178 | !endif
|
|---|
| 179 | !ifdef INSTDIR_5
|
|---|
| 180 | WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "${INSTDIR_5}_INSTDIR" "$${INSTDIR_5}_INSTDIR"
|
|---|
| 181 | !endif
|
|---|
| 182 |
|
|---|
| 183 | WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "StartMenu" "$STARTMENU_STRING"
|
|---|
| 184 | CreateDirectory "$SMPROGRAMS\$STARTMENU_STRING"
|
|---|
| 185 | SectionEnd
|
|---|
| 186 |
|
|---|
| 187 | !insertmacro OPENSOURCE_SECTIONS
|
|---|
| 188 | !insertmacro MINGW_SECTIONS
|
|---|
| 189 | !insertmacro ENVIRONMENT_SECTIONS
|
|---|
| 190 | !insertmacro REGISTERUIEXT_SECTIONS
|
|---|
| 191 | !ifndef OPENSOURCE_BUILD
|
|---|
| 192 | !insertmacro MSVC_SECTIONS
|
|---|
| 193 | !insertmacro ADDIN7X_SECTIONS
|
|---|
| 194 | !insertmacro ADDIN60_SECTIONS
|
|---|
| 195 | !insertmacro VSIP_SECTIONS
|
|---|
| 196 | !insertmacro HELP_SECTIONS
|
|---|
| 197 | !insertmacro DEBUGEXT_SECTIONS
|
|---|
| 198 | !insertmacro LICENSECHECK_SECTIONS
|
|---|
| 199 | !insertmacro QSA_SECTIONS
|
|---|
| 200 | !insertmacro EVALUATION_SECTIONS
|
|---|
| 201 | !insertmacro ECLIPSE_SECTIONS
|
|---|
| 202 | !insertmacro QTJAMBIECLIPSE_SECTIONS
|
|---|
| 203 | !endif
|
|---|
| 204 |
|
|---|
| 205 | !insertmacro INSTDIR_FUNCTIONS
|
|---|
| 206 |
|
|---|
| 207 | Section -CommonSection
|
|---|
| 208 | WriteUninstaller "$INSTDIR\uninst.exe"
|
|---|
| 209 |
|
|---|
| 210 | WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "DisplayName" "$(^Name)"
|
|---|
| 211 | WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "UninstallString" "$INSTDIR\uninst.exe"
|
|---|
| 212 | WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "DisplayVersion" "${PRODUCT_VERSION}"
|
|---|
| 213 | WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
|
|---|
| 214 | WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "Publisher" "${PRODUCT_PUBLISHER}"
|
|---|
| 215 |
|
|---|
| 216 | WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
|
|---|
| 217 | CreateShortCut "$SMPROGRAMS\$STARTMENU_STRING\QtSoftware.com.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
|
|---|
| 218 | CreateShortCut "$SMPROGRAMS\$STARTMENU_STRING\Uninstall ${PRODUCT_NAME} ${PRODUCT_VERSION}.lnk" "$INSTDIR\uninst.exe"
|
|---|
| 219 | SetOutPath "$INSTDIR"
|
|---|
| 220 | SectionEnd
|
|---|
| 221 |
|
|---|
| 222 | Function CheckLocalLicenseProduct
|
|---|
| 223 | !ifdef MODULE_LICENSECHECK
|
|---|
| 224 | !insertmacro QSA_CHECKLICENSEPRODUCT
|
|---|
| 225 | !endif
|
|---|
| 226 | FunctionEnd
|
|---|
| 227 |
|
|---|
| 228 | Function .onInit
|
|---|
| 229 | StrCpy $STARTMENU_STRING "${DEFAULT_STARTMENU_STRING}"
|
|---|
| 230 |
|
|---|
| 231 | !ifdef USE_UNINSTALL_PREVIOUS
|
|---|
| 232 | push "${PRODUCT_NAME}"
|
|---|
| 233 | call GetExistsPreviousInstallationOfProduct
|
|---|
| 234 | exch $0
|
|---|
| 235 | StrCmp $0 true 0 +3
|
|---|
| 236 | MessageBox MB_OK|MB_ICONSTOP "A previous installation of ${PRODUCT_NAME} was detected.$\nPlease uninstall it before running this installer."
|
|---|
| 237 | Abort
|
|---|
| 238 | pop $0
|
|---|
| 239 | !endif
|
|---|
| 240 |
|
|---|
| 241 | call SetAdminVar
|
|---|
| 242 | StrCmp "$RUNNING_AS_ADMIN" "false" 0 common_running_as_admin
|
|---|
| 243 | !ifdef USE_ADMIN_CHECK
|
|---|
| 244 | MessageBox MB_OK|MB_ICONSTOP "You need to have administrator rights to install this software!"
|
|---|
| 245 | Abort
|
|---|
| 246 | !endif
|
|---|
| 247 | SetShellVarContext current
|
|---|
| 248 | goto common_admin_check_done
|
|---|
| 249 | common_running_as_admin:
|
|---|
| 250 | SetShellVarContext all
|
|---|
| 251 | common_admin_check_done:
|
|---|
| 252 |
|
|---|
| 253 | !insertmacro INSTDIR_STARTUP
|
|---|
| 254 |
|
|---|
| 255 | !insertmacro OPENSOURCE_STARTUP
|
|---|
| 256 | !insertmacro ENVIRONMENT_STARTUP
|
|---|
| 257 | !insertmacro REGISTERUIEXT_STARTUP
|
|---|
| 258 | !insertmacro MINGW_STARTUP
|
|---|
| 259 | !ifndef OPENSOURCE_BUILD
|
|---|
| 260 | !insertmacro LICENSECHECK_STARTUP
|
|---|
| 261 | !insertmacro MSVC_STARTUP
|
|---|
| 262 | !insertmacro EVALUATION_STARTUP
|
|---|
| 263 | !insertmacro ADDIN7X_STARTUP
|
|---|
| 264 | !insertmacro ADDIN60_STARTUP
|
|---|
| 265 | !insertmacro DEBUGEXT_STARTUP
|
|---|
| 266 | !insertmacro VSIP_STARTUP
|
|---|
| 267 | !insertmacro HELP_STARTUP
|
|---|
| 268 | !insertmacro QSA_STARTUP
|
|---|
| 269 | !insertmacro ECLIPSE_STARTUP
|
|---|
| 270 | !insertmacro QTJAMBIECLIPSE_STARTUP
|
|---|
| 271 | !endif
|
|---|
| 272 | FunctionEnd
|
|---|
| 273 |
|
|---|
| 274 | Function .onInstSuccess
|
|---|
| 275 | !insertmacro ENVIRONMENT_FINISH
|
|---|
| 276 | !insertmacro REGISTERUIEXT_FINISH
|
|---|
| 277 | !insertmacro OPENSOURCE_FINISH
|
|---|
| 278 | !insertmacro MINGW_FINISH
|
|---|
| 279 | !ifndef OPENSOURCE_BUILD
|
|---|
| 280 | !insertmacro LICENSECHECK_FINISH
|
|---|
| 281 | !insertmacro MSVC_FINISH
|
|---|
| 282 | !insertmacro EVALUATION_FINISH
|
|---|
| 283 | !insertmacro ADDIN7X_FINISH
|
|---|
| 284 | !insertmacro ADDIN60_FINISH
|
|---|
| 285 | !insertmacro DEBUGEXT_FINISH
|
|---|
| 286 | !insertmacro VSIP_FINISH
|
|---|
| 287 | !insertmacro HELP_FINISH
|
|---|
| 288 | !insertmacro QSA_FINISH
|
|---|
| 289 | !insertmacro ECLIPSE_FINISH
|
|---|
| 290 | !insertmacro QTJAMBIECLIPSE_FINISH
|
|---|
| 291 | !endif
|
|---|
| 292 | FunctionEnd
|
|---|
| 293 |
|
|---|
| 294 | Function un.onUninstSuccess
|
|---|
| 295 | !insertmacro ENVIRONMENT_UNFINISH
|
|---|
| 296 | !insertmacro REGISTERUIEXT_UNFINISH
|
|---|
| 297 | !insertmacro OPENSOURCE_UNFINISH
|
|---|
| 298 | !insertmacro MINGW_UNFINISH
|
|---|
| 299 | !ifndef OPENSOURCE_BUILD
|
|---|
| 300 | !insertmacro LICENSECHECK_UNFINISH
|
|---|
| 301 | !insertmacro MSVC_UNFINISH
|
|---|
| 302 | !insertmacro EVALUATION_UNFINISH
|
|---|
| 303 | !insertmacro ADDIN7X_UNFINISH
|
|---|
| 304 | !insertmacro ADDIN60_UNFINISH
|
|---|
| 305 | !insertmacro DEBUGEXT_UNFINISH
|
|---|
| 306 | !insertmacro VSIP_UNFINISH
|
|---|
| 307 | !insertmacro HELP_UNFINISH
|
|---|
| 308 | !insertmacro QSA_UNFINISH
|
|---|
| 309 | !insertmacro ECLIPSE_UNFINISH
|
|---|
| 310 | !insertmacro QTJAMBIECLIPSE_UNFINISH
|
|---|
| 311 | !endif
|
|---|
| 312 | FunctionEnd
|
|---|
| 313 |
|
|---|
| 314 | Function un.onInit
|
|---|
| 315 | call un.SetAdminVar
|
|---|
| 316 | StrCmp "$RUNNING_AS_ADMIN" "false" 0 common_running_as_admin
|
|---|
| 317 | !ifdef USE_ADMIN_CHECK
|
|---|
| 318 | MessageBox MB_OK|MB_ICONSTOP "You do not have the required access rights to uninstall this package."
|
|---|
| 319 | Abort
|
|---|
| 320 | !endif
|
|---|
| 321 | SetShellVarContext current
|
|---|
| 322 | goto common_admin_check_done
|
|---|
| 323 | common_running_as_admin:
|
|---|
| 324 | SetShellVarContext all
|
|---|
| 325 | common_admin_check_done:
|
|---|
| 326 |
|
|---|
| 327 | ${UnStrRep} $PRODUCT_UNIQUE_KEY "${PRODUCT_NAME} ${PRODUCT_VERSION} - $INSTDIR" "\" "_"
|
|---|
| 328 | strcpy $PRODUCT_UNIQUE_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\$PRODUCT_UNIQUE_KEY"
|
|---|
| 329 |
|
|---|
| 330 | push $0
|
|---|
| 331 | ClearErrors
|
|---|
| 332 | ReadRegStr $0 SHCTX "$PRODUCT_UNIQUE_KEY" "DisplayName"
|
|---|
| 333 | IfErrors 0 +3
|
|---|
| 334 | MessageBox MB_OK|MB_ICONSTOP "The uninstaller was unable to find the product to uninstall."
|
|---|
| 335 | Abort
|
|---|
| 336 | pop $0
|
|---|
| 337 |
|
|---|
| 338 | ReadRegStr $STARTMENU_STRING SHCTX "$PRODUCT_UNIQUE_KEY" "StartMenu"
|
|---|
| 339 | StrCmp "$STARTMENU_STRING" "" 0 +2
|
|---|
| 340 | StrCpy $STARTMENU_STRING "${DEFAULT_STARTMENU_STRING}"
|
|---|
| 341 |
|
|---|
| 342 | !ifdef INSTDIR_0 ;the default one, must exist
|
|---|
| 343 | ReadRegStr $${INSTDIR_0}_INSTDIR SHCTX "$PRODUCT_UNIQUE_KEY" "${INSTDIR_0}_INSTDIR"
|
|---|
| 344 | !endif
|
|---|
| 345 | !ifdef INSTDIR_1
|
|---|
| 346 | ReadRegStr $${INSTDIR_1}_INSTDIR SHCTX "$PRODUCT_UNIQUE_KEY" "${INSTDIR_1}_INSTDIR"
|
|---|
| 347 | !endif
|
|---|
| 348 | !ifdef INSTDIR_2
|
|---|
| 349 | ReadRegStr $${INSTDIR_2}_INSTDIR SHCTX "$PRODUCT_UNIQUE_KEY" "${INSTDIR_2}_INSTDIR"
|
|---|
| 350 | !endif
|
|---|
| 351 | !ifdef INSTDIR_3
|
|---|
| 352 | ReadRegStr $${INSTDIR_3}_INSTDIR SHCTX "$PRODUCT_UNIQUE_KEY" "${INSTDIR_3}_INSTDIR"
|
|---|
| 353 | !endif
|
|---|
| 354 | !ifdef INSTDIR_4
|
|---|
| 355 | ReadRegStr $${INSTDIR_4}_INSTDIR SHCTX "$PRODUCT_UNIQUE_KEY" "${INSTDIR_4}_INSTDIR"
|
|---|
| 356 | !endif
|
|---|
| 357 | !ifdef INSTDIR_5
|
|---|
| 358 | ReadRegStr $${INSTDIR_5}_INSTDIR SHCTX "$PRODUCT_UNIQUE_KEY" "${INSTDIR_5}_INSTDIR"
|
|---|
| 359 | !endif
|
|---|
| 360 |
|
|---|
| 361 | !insertmacro ENVIRONMENT_UNSTARTUP
|
|---|
| 362 | !insertmacro REGISTERUIEXT_UNSTARTUP
|
|---|
| 363 | !insertmacro OPENSOURCE_UNSTARTUP
|
|---|
| 364 | !insertmacro MINGW_UNSTARTUP
|
|---|
| 365 | !ifndef OPENSOURCE_BUILD
|
|---|
| 366 | !insertmacro LICENSECHECK_UNSTARTUP
|
|---|
| 367 | !insertmacro MSVC_UNSTARTUP
|
|---|
| 368 | !insertmacro EVALUATION_UNSTARTUP
|
|---|
| 369 | !insertmacro ADDIN7X_UNSTARTUP
|
|---|
| 370 | !insertmacro ADDIN60_UNSTARTUP
|
|---|
| 371 | !insertmacro DEBUGEXT_UNSTARTUP
|
|---|
| 372 | !insertmacro VSIP_UNSTARTUP
|
|---|
| 373 | !insertmacro HELP_UNSTARTUP
|
|---|
| 374 | !insertmacro QSA_UNSTARTUP
|
|---|
| 375 | !insertmacro ECLIPSE_UNSTARTUP
|
|---|
| 376 | !insertmacro QTJAMBIECLIPSE_UNSTARTUP
|
|---|
| 377 | !endif
|
|---|
| 378 |
|
|---|
| 379 | !insertmacro MUI_INSTALLOPTIONS_EXTRACT "${UNINSTALLER_CONFIRM_PAGE}"
|
|---|
| 380 | FunctionEnd
|
|---|
| 381 |
|
|---|
| 382 | !insertmacro OPENSOURCE_UNINSTALL
|
|---|
| 383 | !insertmacro ENVIRONMENT_UNINSTALL
|
|---|
| 384 | !insertmacro REGISTERUIEXT_UNINSTALL
|
|---|
| 385 | !insertmacro MINGW_UNINSTALL
|
|---|
| 386 | !ifndef OPENSOURCE_BUILD
|
|---|
| 387 | !insertmacro HELP_UNINSTALL
|
|---|
| 388 | !insertmacro DEBUGEXT_UNINSTALL
|
|---|
| 389 | !insertmacro MSVC_UNINSTALL
|
|---|
| 390 | !insertmacro EVALUATION_UNINSTALL
|
|---|
| 391 | !insertmacro QSA_UNINSTALL
|
|---|
| 392 | !insertmacro ECLIPSE_UNINSTALL
|
|---|
| 393 | !insertmacro QTJAMBIECLIPSE_UNINSTALL
|
|---|
| 394 | !endif
|
|---|
| 395 |
|
|---|
| 396 | Section Uninstall
|
|---|
| 397 | !ifndef OPENSOURCE_BUILD
|
|---|
| 398 | !insertmacro LICENSECHECK_UNINSTALL
|
|---|
| 399 | !insertmacro ADDIN7X_UNINSTALL
|
|---|
| 400 | !insertmacro ADDIN60_UNINSTALL
|
|---|
| 401 | !insertmacro VSIP_UNINSTALL
|
|---|
| 402 | !endif
|
|---|
| 403 |
|
|---|
| 404 | ; COMMON
|
|---|
| 405 | Delete "$INSTDIR\${PRODUCT_NAME}.url"
|
|---|
| 406 | Delete "$INSTDIR\uninst.exe"
|
|---|
| 407 | Delete "$SMPROGRAMS\$STARTMENU_STRING\Uninstall ${PRODUCT_NAME} ${PRODUCT_VERSION}.lnk"
|
|---|
| 408 | Delete "$SMPROGRAMS\$STARTMENU_STRING\QtSoftware.com.lnk"
|
|---|
| 409 |
|
|---|
| 410 | RMDir "$SMPROGRAMS\$STARTMENU_STRING"
|
|---|
| 411 | RMDir "$INSTDIR"
|
|---|
| 412 |
|
|---|
| 413 | DeleteRegKey SHCTX "$PRODUCT_UNIQUE_KEY"
|
|---|
| 414 | SectionEnd
|
|---|
| 415 |
|
|---|
| 416 | Function CommonRunFunction
|
|---|
| 417 | !ifndef OPENSOURCE_BUILD
|
|---|
| 418 | !insertmacro MSVC_RUN_FUNCTION
|
|---|
| 419 | !insertmacro QSA_RUN_FUNCTION
|
|---|
| 420 | !endif
|
|---|
| 421 | !insertmacro MINGW_RUN_FUNCTION
|
|---|
| 422 | DoneRunFunction:
|
|---|
| 423 | FunctionEnd
|
|---|
| 424 |
|
|---|
| 425 | Function CommonReadmeFunction
|
|---|
| 426 | !ifndef OPENSOURCE_BUILD
|
|---|
| 427 | !insertmacro MSVC_README_FUNCTION
|
|---|
| 428 | !endif
|
|---|
| 429 | !insertmacro MINGW_README_FUNCTION
|
|---|
| 430 | DoneReadmeFunction:
|
|---|
| 431 | FunctionEnd
|
|---|
| 432 |
|
|---|
| 433 | Function un.UninstallerConfirmPage
|
|---|
| 434 | !insertmacro MUI_HEADER_TEXT "Confirm" "Confirm Uninstallation Directories"
|
|---|
| 435 | !insertmacro MUI_INSTALLOPTIONS_WRITE "${UNINSTALLER_CONFIRM_PAGE}" "Field 2" "Text" "$UninstallerConfirmProduct"
|
|---|
| 436 | !insertmacro MUI_INSTALLOPTIONS_DISPLAY "${UNINSTALLER_CONFIRM_PAGE}"
|
|---|
| 437 | FunctionEnd
|
|---|
| 438 |
|
|---|
| 439 | ;pops product name from stack and as result pushes TRUE or FALSE on stack
|
|---|
| 440 | Function GetExistsPreviousInstallationOfProduct
|
|---|
| 441 | exch $0
|
|---|
| 442 | push $1
|
|---|
| 443 | push $2
|
|---|
| 444 | push $3
|
|---|
| 445 |
|
|---|
| 446 | StrCpy $1 0
|
|---|
| 447 | loop:
|
|---|
| 448 | EnumRegKey $2 HKLM Software\Microsoft\Windows\CurrentVersion\Uninstall $1
|
|---|
| 449 | StrCmp $2 "" no_reg_key_found
|
|---|
| 450 | ${StrStr} $3 $2 $0
|
|---|
| 451 | StrCmp $3 $2 reg_key_found
|
|---|
| 452 | IntOp $1 $1 + 1
|
|---|
| 453 | goto loop
|
|---|
| 454 |
|
|---|
| 455 | reg_key_found:
|
|---|
| 456 | push true
|
|---|
| 457 | goto done
|
|---|
| 458 |
|
|---|
| 459 | no_reg_key_found:
|
|---|
| 460 | push false
|
|---|
| 461 |
|
|---|
| 462 | done:
|
|---|
| 463 | exch
|
|---|
| 464 | pop $3
|
|---|
| 465 | exch
|
|---|
| 466 | pop $2
|
|---|
| 467 | exch
|
|---|
| 468 | pop $1
|
|---|
| 469 | exch
|
|---|
| 470 | pop $0
|
|---|
| 471 | FunctionEnd
|
|---|
| 472 |
|
|---|
| 473 | ;pops product name from stack
|
|---|
| 474 | Function WarnIfInstalledProductDetected
|
|---|
| 475 | exch $0
|
|---|
| 476 | push $0
|
|---|
| 477 | call GetExistsPreviousInstallationOfProduct
|
|---|
| 478 | exch $1
|
|---|
| 479 | StrCmp $1 true +1 +3
|
|---|
| 480 | MessageBox MB_YESNO|MB_ICONQUESTION "An existing installation of $0 was detected.$\nIt is recommended to deinstall $0 before continuing.$\nDo you want to continue this installation nevertheless?" IDYES +2 IDNO +1
|
|---|
| 481 | Abort
|
|---|
| 482 | pop $1
|
|---|
| 483 | pop $0
|
|---|
| 484 | FunctionEnd
|
|---|
| 485 |
|
|---|
| 486 | ;sets $RUNNING_AS_ADMIN to "true" if Admin or Power user
|
|---|
| 487 | !macro SetAdminVar UN
|
|---|
| 488 | Function ${UN}SetAdminVar
|
|---|
| 489 | push $0
|
|---|
| 490 | ClearErrors
|
|---|
| 491 | UserInfo::GetAccountType
|
|---|
| 492 | IfErrors Admin ;It's probably Win95
|
|---|
| 493 | pop $0
|
|---|
| 494 | StrCmp $0 "Admin" Admin
|
|---|
| 495 | StrCmp $0 "Power" Admin
|
|---|
| 496 |
|
|---|
| 497 | StrCpy $RUNNING_AS_ADMIN "false"
|
|---|
| 498 | goto Done
|
|---|
| 499 |
|
|---|
| 500 | Admin:
|
|---|
| 501 | StrCpy $RUNNING_AS_ADMIN "true"
|
|---|
| 502 |
|
|---|
| 503 | Done:
|
|---|
| 504 | pop $0
|
|---|
| 505 | FunctionEnd
|
|---|
| 506 | !macroend
|
|---|
| 507 | !insertmacro SetAdminVar ""
|
|---|
| 508 | !insertmacro SetAdminVar "un."
|
|---|
| 509 |
|
|---|
| 510 | !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
|
|---|
| 511 | !insertmacro OPENSOURCE_DESCRIPTION
|
|---|
| 512 | !insertmacro ENVIRONMENT_DESCRIPTION
|
|---|
| 513 | !insertmacro REGISTERUIEXT_DESCRIPTION
|
|---|
| 514 | !insertmacro MINGW_DESCRIPTION
|
|---|
| 515 | !ifndef OPENSOURCE_BUILD
|
|---|
| 516 | !insertmacro MSVC_DESCRIPTION
|
|---|
| 517 | !insertmacro EVALUATION_DESCRIPTION
|
|---|
| 518 | !insertmacro ADDIN7X_DESCRIPTION
|
|---|
| 519 | !insertmacro ADDIN60_DESCRIPTION
|
|---|
| 520 | !insertmacro DEBUGEXT_DESCRIPTION
|
|---|
| 521 | !insertmacro HELP_DESCRIPTION
|
|---|
| 522 | !insertmacro VSIP_DESCRIPTION
|
|---|
| 523 | !insertmacro QSA_DESCRIPTION
|
|---|
| 524 | !insertmacro ECLIPSE_DESCRIPTION
|
|---|
| 525 | !insertmacro QTJAMBIECLIPSE_DESCRIPTION
|
|---|
| 526 | !endif
|
|---|
| 527 | !insertmacro MUI_FUNCTION_DESCRIPTION_END
|
|---|