Archive: Howto build up dynamic license file name


Howto build up dynamic license file name
Hi all,

I want to target different licenses files, depending on the language. For that, I defined earlier a $RESSOURCES_DIR and a $LICENSE_NAME, but I would like to build up the $LICENSE_PREFIX on runtime.

!insertmacro MUI_PAGE_LICENSE "${RESSOURCES_DIR}\${LICENSE_PREFIX}${LICENSE_NAME}"


The $LICENSE_PREFIX could be filled in by the following code:

 Var /GLOBAL LICENSE_PREFIX
StrCmp $LANGUAGE ${LANG_ENGLISH} 0 +2
StrCpy $LICENSE_PREFIX "en_"
StrCmp $LANGUAGE ${LANG_FRENCH} 0 +2
StrCpy $LICENSE_PREFIX "fr_"


The problem is the nsis compiler try to load the license file at compile time (grrrr).... so, what do you do to target the different license files ?

Thanks for your help.


Gal'

OKay, I think I ve found a soluce: I am lucky the switch is done on the language criteria, so I can use a LangString variable to bring my prefix.... lucky but dirty.


But can't work since MUY_PAGE_XXX are above LangString definitions..... still need help !


LicenseLangString myLicenseData ${LANG_ENGLISH} license_en.txt
LicenseLangString myLicenseData ${LANG_RUSSIAN} license_ru.txt
LicenseLangString myLicenseData ${LANG_ITALIAN} license_it.txt
LicenseLangString myLicenseData ${LANG_JAPANESE} license_jp.txt
LicenseLangString myLicenseData ${LANG_GERMAN} license_ge.txt
LicenseData $(myLicenseData)


You are the king !

Sorry ;)

Gal'