NSIS:将文本“执行:*******”更改为自定义文本

时间:2016-10-13 10:00:50

标签: nsis

我是NSIS的新手,并创建了一个脚本来以链式方式安装我的所有程序。该脚本运行良好但我想更改突出显示框中的文本以显示正在安装的程序的名称。例如,如果安装程序正在安装Acrobat Reader,则应该说“安装:Adobe Acrobat Reader”。

以下是截图: Image

    ; Script generated by the HM NIS Edit Script Wizard.

    ; HM NIS Edit Wizard helper defines
    !define PRODUCT_NAME "Deployment"
    !define PRODUCT_VERSION "1.0"
    !define PRODUCT_PUBLISHER "NoNe"


    ; 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 "..\..\..\path\to\licence\YourSoftwareLicence.txt"
    ; Instfiles page
    !insertmacro MUI_PAGE_INSTFILES
    ; Finish page
    ;!insertmacro MUI_PAGE_FINISH

    ; Language files
    !insertmacro MUI_LANGUAGE "English"

    ; MUI end ------

    Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
    OutFile "Deploy.exe"
    InstallDir "$TEMP"
    ShowInstDetails show

    Section -SETTINGS
      SetOutPath "$TEMP"
      SetOverwrite on
    SectionEnd

    Section "Adobe Acrobat Reader XI" SEC01
   ;Should display "Installing: Acrobat Reader" when installing this section
      File "E:\Applications\AdbeRdr11002_en_US.exe"
      ExecWait "$TEMP\AdbeRdr11002_en_US.exe /msi EULA_ACCEPT=YES /qn"
    SectionEnd

Section "Mozilla Firefox" SEC02
;Should display "Installing: Mozilla Firefox" when installing this section
  File "E:\Applications\Firefox4901.exe"
  ExecWait "$TEMP\Firefox.exe -ms"
SectionEnd

有办法做到这一点吗?

提前致谢...:)

1 个答案:

答案 0 :(得分:1)

您可以使用说明 DetailPrint"安装:Adobe Acrobat Reader"

添加字符串"安装:Adobe Acrobat Reader"到安装程序的详细信息视图。

但是下一个命令(在你的脚本中)将覆盖这个文本(例如"提取文件......")所以你可以使用 SetDetailsPrint none | listonly | textonly | both | lastused命令用于设置输出的应用位置:

SetDetailsPrint both
DetailPrint "Installing: Adobe Acrobat Reader"
SetDetailsPrint listonly
... Extract all your files here while "Installing: Adobe Acrobat Reader" is displayed ...
SetDetailsPrint both