none
安装项目(NSIS) 生成setup 项目 RRS feed

  • 问题


  • ; HM NIS Edit Wizard helper defines
    !define PRODUCT_NAME "Huawei eTrans Client Config"
    !define PRODUCT_VERSION "2.0"
    !define PRODUCT_PUBLISHER "Huawei company, Inc."
    !define PRODUCT_WEB_SITE ""
    !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\Silverlight.exe"

    ; MUI 1.67 compatible ------
    !include "MUI.nsh"

    ; MUI Settings
    !define MUI_ABORTWARNING
    !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"

    ; Welcome page
    ;!insertmacro MUI_PAGE_WELCOME
    ; License page
    ;!insertmacro MUI_PAGE_LICENSE "${NSISDIR}\License.txt"
    ; Directory page
    ;!insertmacro MUI_PAGE_DIRECTORY
    ; Instfiles page
    !insertmacro MUI_PAGE_INSTFILES
    ; Finish page
    ;!define MUI_FINISHPAGE_RUN "$INSTDIR\Silverlight.exe"
    ;!define MUI_FINISHPAGE_RUN_PARAMETERS "  " ;/q
    ;!insertmacro MUI_PAGE_FINISH

    ; Language files
    ;!insertmacro MUI_LANGUAGE "English"

    ; MUI end ------

    Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
    OutFile "eTransClientSetup.exe"
    InstallDir "$PROGRAMFILES\My application"
    InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
    ShowInstDetails show


    Section "MainSection" SEC01
      SetOutPath "$INSTDIR"
      SetOverwrite ifnewer
      File "D:\Work\Huawei.FileTransfer.PresentationV5\Huawei.FilTransfer.PresentationV5.Setup\Silverlight.exe"
      File "D:\Work\Huawei.FileTransfer.PresentationV5\Huawei.FilTransfer.PresentationV5.Setup\huaweica.cer"
      File "D:\Work\Huawei.FileTransfer.PresentationV5\Huawei.FilTransfer.PresentationV5.Setup\etrans.cer"
      File "D:\Work\Huawei.FileTransfer.PresentationV5\Huawei.FilTransfer.PresentationV5.Setup\CertMgr.exe"

      ;写注册表(提升Silverlight 权限)
      WriteRegDWORD HKLM "Software\WOW6432Node\Microsoft\Silverlight" "AllowElevatedTrustAppsInBrowser" 000000001
      WriteRegDWORD HKLM "Software\Microsoft\Silverlight" "AllowElevatedTrustAppsInBrowser" 000000001
     
      WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\HuaWei.com" "*" 000000002
      ;安装silverlight
      ExecWait '"$INSTDIR\silverlight.exe" /q'
      ;写入证书(站点证书)
      ExecWait '"$INSTDIR\CertMgr.exe" /add "$INSTDIR\etrans.cer" /s TrustedPublisher'
      ; 写入根证书(存在的时候,不导入)
      EnumRegKey $1 HKCU  "Software\Microsoft\SystemCertificates\Root\Certificates\3A43EFFB59D26833B0805223B490959BECB297BD"  0
      IfErrors   inputcerticate ;根证书找不到huaweica.cer
             goto   done ;如果已安装huaweica.cer 则完成
    inputcerticate:
                   DetailPrint "huaweica.cer install... "
                   ExecWait '"$INSTDIR\CertMgr.exe" /add "$INSTDIR\huaweica.cer" /s root'
    done:
       DetailPrint "客户端配置完成,请重新打开页面!"
    SectionEnd

    Section -Post
      ;WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\Silverlight.exe"
         ;Messagebox MB_OK  "安装完成!"
    SectionEnd

    2012年12月19日 2:34

全部回复