Вопрос

I'm currently working on a package installer of several Anti-Virus' for a client and I'm running into an issue with the descriptive text not working as it's documented to do for 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

It installs everything correctly, I'm just in the finishing stages of making it look professional. I've headed each section with the proper format (I believe).

Section "AVG Anti-Virus" SectionAVG

;Install everything here

SectionEnd

;other sections...

The problem is that it compiles, but doesn't show any of the described information. Is there some scripting error I'm running across that isn't in the documentation? Maybe some other step that wasn't covered first?

Thank you for any assistance in advance. I've only begun learning how to use NSIS, but it seems like a really powerful tool once you know what you're doing.

Это было полезно?

Решение

It works as documented but you did not follow the documentation!

The MUI_FUNCTION_DESCRIPTION_BEGIN/END block has to come after the sections in the .nsi (The MUI helpfile documents this in the "Components page descriptions" section). The reason for this is that ${SectionAVG} is not going to be defined util after the section has been declared. When using LangString strings you also need to use the correct syntax: $(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 с атрибуция
Не связан с StackOverflow
scroll top