NSIS“MUI_DESCRIPTION_TEXT”没有按照记录的方式工作

时间:2014-02-11 20:04:33

标签: nsis mui

我目前正在为一个客户端开发一个针对几个Anti-Virus的软件包安装程序,而我遇到的问题是描述性文本无法正常工作,因为它记录为MUI2做了。

!insertmacro MUI_LANGUAGE "English"

LangString DESC_avg ${LANG_ENGLISH} "Install AVG Anti-Virus: Because Norton doesn't work."
LangString DESC_cc ${LANG_ENGLISH} "Install CCleaner PC Optimizer: Clearing your junk files since 2005."
LangString DESC_mb ${LANG_ENGLISH} "Install MalwareBytes Anti-Virus: Because no anti-virus is perfect."
LangString DESC_ff ${LANG_ENGLISH} "Install Firefox Internet Browser: Friends don't let friends use Internet Explorer"
LangString DESC_sb ${LANG_ENGLISH} "Install Spybot Virus Removal: Only for getting rid of those particularly pesky virus$\'"

!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
    !insertmacro MUI_DESCRIPTION_TEXT ${SectionAVG} ${DESC_avg}
    !insertmacro MUI_DESCRIPTION_TEXT ${SectionCC} ${DESC_cc}
    !insertmacro MUI_DESCRIPTION_TEXT ${SectionMB} ${DESC_mb}
    !insertmacro MUI_DESCRIPTION_TEXT ${SectionFF} ${DESC_ff}
    !insertmacro MUI_DESCRIPTION_TEXT ${SectionSB} ${DESC_sb}
!insertmacro MUI_FUNCTION_DESCRIPTION_END

它正确地安装了所有东西,我只是处于使它看起来很专业的最后阶段。我已经以适当的格式领导每个部分(我相信)。

Section "AVG Anti-Virus" SectionAVG

;Install everything here

SectionEnd

;other sections...

问题是它编译,但没有显示任何描述的信息。我运行的是否存在一些脚本错误,而不是在文档中?也许还有一些其他步骤没有首先涉及?

感谢您提前获得任何帮助。我刚刚开始学习如何使用NSIS,但一旦你知道你在做什么,它似乎是一个非常强大的工具。

1 个答案:

答案 0 :(得分:3)

它的工作原理如下,但您没有按照文档进行操作!

MUI_FUNCTION_DESCRIPTION_BEGIN / END块必须在.nsi中的部分之后(MUI帮助文件在“组件页面描述”部分中对此进行了说明)。这样做的原因是,在声明该部分之后,${SectionAVG}不会被定义为util。使用LangString字符串时,您还需要使用正确的语法:$(lang_string_id)

!include MUI2.nsh
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE English

LangString DESC_avg ${LANG_ENGLISH} "foo foo foo foo foo foo foo foo foo"
LangString DESC_cc ${LANG_ENGLISH} "bar BAR bar"

Section "AVG Anti-Virus" SectionAVG
SectionEnd
Section "CCleaner" SectionCC
SectionEnd

!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SectionAVG} $(DESC_avg)
!insertmacro MUI_DESCRIPTION_TEXT ${SectionCC} $(DESC_cc)
!insertmacro MUI_FUNCTION_DESCRIPTION_END