Archive: Localized Readmes


Localized Readmes
I am new to NSIS and doing my first steps with since yesterday, so maybe my question is an easy one :)

I use NSIS to prepare a setup that will only copy some XLS-files together with some linked PDFs to the machine and generates some links into the start menu.

I would like to have the setup in English and German. Those things are running fine now. But now my question is:
When the setup is done the user has the option to open a readme-file. I have two of them, one in English and the other one in German. What do I have to do in my script to open the German one when the setup has been processed in German or the English one when the setup was done in English?

Thanks for your help!


Language ID is set in $LANGUAGE variable. Compare it with ${LANG_ENGLISH} or ${LANG_GERMAN}


I tried this:
!include LogicLib.nsh
[...]
${If} $LANGUAGE == ${LANG_GERMAN}
!define MUI_FINISHPAGE_SHOWREADME $INSTDIR\Info\LIESMICH.txt"
${EndIf}
${If} $LANGUAGE == ${LANG_ENGLISH}
!define MUI_FINISHPAGE_SHOWREADME $INSTDIR\Info\Readme.txt"
${EndIf}
[...]

But this won't work as the usage of StrCmp is not valid outside a section or a function.
So I tried it with an self defined function. This attempt failed too as it is not allowed to call a function here :(

What is my mistake here?


I am just guessing now - try to !define MUI_FINISHPAGE_SHOWREADME $myVar

and set this myVar in .onInit. And don't forget to tell us your results ;)


Thanks a lot for your idea - seems to work fine:)

Here is what I did:

BOF >*>*>
[...]
!include LogicLib.nsh ;Needed for the IF-Statements!
[...]
var BORG_ReadMeFile ;My global variable
[...]
!define MUI_FINISHPAGE_SHOWREADME "$BORG_ReadMeFile" ;Offers to viow the ReadMe after setup is done
[...]

Function .onInit ;BuiltIn-Function to initialize things when starting the setup
[...]
${If} $LANGUAGE == ${LANG_GERMAN} ;Set my variable depending on the selected installation language
StrCpy $BORG_ReadMeFile "$INSTDIR\Info\LIESMICH.txt"
${EndIf}
${If} $LANGUAGE == ${LANG_ENGLISH}
StrCpy $BORG_ReadMeFile "$INSTDIR\Info\Readme.txt"
${EndIf}
FunctionEnd

[...]

Section "Mainapplication" SEC01
[...]
${If} $LANGUAGE == ${LANG_GERMAN} ;Link different files to the startmenu depending on the selected installation language
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\LiesMich.lnk" "$INSTDIR\Info\LIESMICH.txt"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\LiesMich.lnk" "$INSTDIR\Info\LIESMICH.doc"
${EndIf}
${If} $LANGUAGE == ${LANG_ENGLISH}
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\ReadMe.lnk" "$INSTDIR\Info\Readme.txt"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\ReadMe.lnk" "$INSTDIR\Info\Readme.doc"
${EndIf}
[...]
SectionEnd
<*<*< EOF


deleted


not sure if it's the direct cause, but you are using %INSTDIR, rather than $INSTDIR ?


thx for your help, actually it was a stupid path error ...

But I think its better to use LangString then to check on init for the language