📄 installer.nsi
字号:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Copyright (C) 2007-2007 Trolltech ASA. All rights reserved.;;;; This file is part of the Windows installer of the Qt Toolkit.;;;; This file may be used under the terms of the GNU General Public;; License version 2.0 as published by the Free Software Foundation;; and appearing in the file LICENSE.GPL included in the packaging of;; this file. Please review the following information to ensure GNU;; General Public Licensing requirements will be met:;; http://trolltech.com/products/qt/licenses/licensing/opensource/;;;; If you are unsure which license is appropriate for your use, please;; review the following information:;; http://trolltech.com/products/qt/licenses/licensing/licensingoverview;; or contact the sales department at sales@trolltech.com.;;;; In addition, as a special exception, Trolltech gives you certain;; additional rights. These rights are described in the Trolltech GPL;; Exception version 1.0, which can be found at;; http://www.trolltech.com/products/qt/gplexception/ and in the file;; GPL_EXCEPTION.txt in this package.;;;; In addition, as a special exception, Trolltech, as the sole copyright;; holder for Qt Designer, grants users of the Qt/Eclipse Integration;; plug-in the right for the Qt/Eclipse Integration to link to;; functionality provided by Qt Designer and its related libraries.;;;; Trolltech reserves all rights not expressly granted herein.;;;; This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE;; WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Script generated by the HM NIS Edit Script Wizard.!include "config.nsh"!include "includes\global.nsh"!define PRODUCT_PUBLISHER "Trolltech ASA"!define PRODUCT_WEB_SITE "http://www.trolltech.com"!define INSTALL_ICON "images\install.ico"!define WELCOME_PAGE_ICON "images\qt-wizard.bmp"!define PAGE_HEADER_ICON "images\qt-header.bmp"!include "MUI.nsh"; modules!include "modules\mingw.nsh"!include "modules\opensource.nsh"!include "includes\instdir.nsh"!include "modules\environment.nsh"!include "modules\registeruiext.nsh"!ifndef OPENSOURCE_BUILD!include "modules\msvc.nsh"!include "modules\addin7x.nsh"!include "modules\qsa.nsh"!include "modules\addin60.nsh"!include "modules\debugext.nsh"!include "modules\license.nsh"!include "modules\vsip.nsh"!include "modules\help.nsh"!include "modules\evaluation.nsh"!include "modules\eclipse.nsh"!include "modules\qtjambieclipse.nsh"!endif; MUI Settings!define MUI_ABORTWARNING!define MUI_ICON "${INSTALL_ICON}"!define MUI_UNICON "${INSTALL_ICON}"!define MUI_HEADERIMAGE!define MUI_HEADERIMAGE_BITMAP "${PAGE_HEADER_ICON}"!define MUI_HEADERIMAGE_UNBITMAP "${PAGE_HEADER_ICON}"!define MUI_WELCOMEFINISHPAGE_BITMAP "${WELCOME_PAGE_ICON}"!define MUI_UNWELCOMEFINISHPAGE_BITMAP "${WELCOME_PAGE_ICON}"!ifdef WELCOME_NOTE !define MUI_WELCOMEPAGE_TEXT "${WELCOME_NOTE}"!endif!insertmacro MUI_PAGE_WELCOME!insertmacro OPENSOURCE_INITIALIZE!ifndef OPENSOURCE_BUILD!insertmacro EVALUATION_INITIALIZE!insertmacro LICENSECHECK_INITIALIZE!insertmacro MSVC_INITIALIZE!insertmacro ADDIN7X_INITIALIZE!insertmacro ADDIN60_INITIALIZE!insertmacro DEBUGEXT_INITIALIZE!insertmacro HELP_INITIALIZE!insertmacro VSIP_INITIALIZE!endif !ifdef USE_COMPONENT_PAGE !insertmacro MUI_PAGE_COMPONENTS!endif!ifdef USE_DIRECTORY_PAGE !insertmacro INSTDIR_INITIALIZE!endif!ifdef USE_STARTMENU_PAGE !define MUI_STARTMENUPAGE_NODISABLE !define MUI_STARTMENUPAGE_DEFAULTFOLDER "${DEFAULT_STARTMENU_STRING}" !insertmacro MUI_PAGE_STARTMENU 1 $STARTMENU_STRING!endif!insertmacro MINGW_INITIALIZE!insertmacro ENVIRONMENT_INITIALIZE!insertmacro REGISTERUIEXT_INITIALIZE!ifndef OPENSOURCE_BUILD!insertmacro QSA_INITIALIZE!insertmacro ECLIPSE_INITIALIZE!insertmacro QTJAMBIECLIPSE_INITIALIZE!endif !define MUI_FINISHPAGE_NOAUTOCLOSE!insertmacro MUI_PAGE_INSTFILES!ifdef README_FILE !define MUI_FINISHPAGE_SHOWREADME ${README_FILE}!else !ifdef README_FUNCTION !define MUI_FINISHPAGE_SHOWREADME !define MUI_FINISHPAGE_SHOWREADME_TEXT "${README_FUNCTION}" !define MUI_FINISHPAGE_SHOWREADME_FUNCTION "CommonReadmeFunction" !endif!endif!ifdef RUN_FUNCTION !define MUI_FINISHPAGE_RUN !define MUI_FINISHPAGE_RUN_TEXT "${RUN_FUNCTION}" !define MUI_FINISHPAGE_RUN_FUNCTION "CommonRunFunction"!endif!insertmacro MUI_PAGE_FINISH!insertmacro MUI_UNPAGE_WELCOME!define UNINSTALLER_CONFIRM_PAGE "confirmpage.ini"UninstPage custom un.UninstallerConfirmPage!insertmacro MUI_UNPAGE_INSTFILES!insertmacro MUI_UNPAGE_FINISH!insertmacro MUI_LANGUAGE "English"Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"OutFile ${OUTPUT_FILE}Section -PreCommonSection!ifdef INSTDIR_0 ;the default one, must exist strcpy $INSTDIR $${INSTDIR_0}_INSTDIR ${StrRep} $PRODUCT_UNIQUE_KEY "${PRODUCT_NAME} ${PRODUCT_VERSION} - $INSTDIR" "\" "_" strcpy $PRODUCT_UNIQUE_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\$PRODUCT_UNIQUE_KEY" WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "${INSTDIR_0}_INSTDIR" "$${INSTDIR_0}_INSTDIR"!endif!ifdef INSTDIR_1 WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "${INSTDIR_1}_INSTDIR" "$${INSTDIR_1}_INSTDIR"!endif!ifdef INSTDIR_2 WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "${INSTDIR_2}_INSTDIR" "$${INSTDIR_2}_INSTDIR"!endif!ifdef INSTDIR_3 WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "${INSTDIR_3}_INSTDIR" "$${INSTDIR_3}_INSTDIR"!endif!ifdef INSTDIR_4 WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "${INSTDIR_4}_INSTDIR" "$${INSTDIR_4}_INSTDIR"!endif!ifdef INSTDIR_5 WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "${INSTDIR_5}_INSTDIR" "$${INSTDIR_5}_INSTDIR"!endif WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "StartMenu" "$STARTMENU_STRING" CreateDirectory "$SMPROGRAMS\$STARTMENU_STRING"SectionEnd!insertmacro OPENSOURCE_SECTIONS!insertmacro MINGW_SECTIONS!insertmacro ENVIRONMENT_SECTIONS!insertmacro REGISTERUIEXT_SECTIONS!ifndef OPENSOURCE_BUILD!insertmacro MSVC_SECTIONS!insertmacro ADDIN7X_SECTIONS!insertmacro ADDIN60_SECTIONS!insertmacro VSIP_SECTIONS!insertmacro HELP_SECTIONS!insertmacro DEBUGEXT_SECTIONS!insertmacro LICENSECHECK_SECTIONS!insertmacro QSA_SECTIONS!insertmacro EVALUATION_SECTIONS!insertmacro ECLIPSE_SECTIONS!insertmacro QTJAMBIECLIPSE_SECTIONS!endif!insertmacro INSTDIR_FUNCTIONSSection -CommonSection WriteUninstaller "$INSTDIR\uninst.exe" WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "DisplayName" "$(^Name)" WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "UninstallString" "$INSTDIR\uninst.exe" WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "DisplayVersion" "${PRODUCT_VERSION}" WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "URLInfoAbout" "${PRODUCT_WEB_SITE}" WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "Publisher" "${PRODUCT_PUBLISHER}" WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}" CreateShortCut "$SMPROGRAMS\$STARTMENU_STRING\Trolltech.com.lnk" "$INSTDIR\${PRODUCT_NAME}.url" CreateShortCut "$SMPROGRAMS\$STARTMENU_STRING\Uninstall ${PRODUCT_NAME} ${PRODUCT_VERSION}.lnk" "$INSTDIR\uninst.exe" SetOutPath "$INSTDIR"SectionEndFunction CheckLocalLicenseProduct!ifdef MODULE_LICENSECHECK !insertmacro QSA_CHECKLICENSEPRODUCT!endifFunctionEndFunction .onInit StrCpy $STARTMENU_STRING "${DEFAULT_STARTMENU_STRING}"!ifdef USE_UNINSTALL_PREVIOUS push "${PRODUCT_NAME}" call GetExistsPreviousInstallationOfProduct exch $0 StrCmp $0 true 0 +3 MessageBox MB_OK|MB_ICONSTOP "A previous installation of ${PRODUCT_NAME} was detected.$\nPlease uninstall it before running this installer." Abort pop $0!endif call SetAdminVar StrCmp "$RUNNING_AS_ADMIN" "false" 0 common_running_as_admin!ifdef USE_ADMIN_CHECK MessageBox MB_OK|MB_ICONSTOP "You need to have administrator rights to install this software!" Abort!endif SetShellVarContext current goto common_admin_check_done common_running_as_admin: SetShellVarContext all common_admin_check_done: !insertmacro INSTDIR_STARTUP !insertmacro OPENSOURCE_STARTUP !insertmacro ENVIRONMENT_STARTUP !insertmacro REGISTERUIEXT_STARTUP !insertmacro MINGW_STARTUP!ifndef OPENSOURCE_BUILD !insertmacro LICENSECHECK_STARTUP !insertmacro MSVC_STARTUP !insertmacro EVALUATION_STARTUP !insertmacro ADDIN7X_STARTUP !insertmacro ADDIN60_STARTUP !insertmacro DEBUGEXT_STARTUP !insertmacro VSIP_STARTUP !insertmacro HELP_STARTUP !insertmacro QSA_STARTUP
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -