簡體   English   中英

NSIS“MUI_DESCRIPTION_TEXT”未按文檔工作

[英]NSIS “MUI_DESCRIPTION_TEXT” not working as documented

我目前正在為一個客戶端開發多個 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,但是一旦您知道自己在做什么,它似乎是一個非常強大的工具。

它按文檔工作,但您沒有遵循文檔!

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM