Archive: Can I use MUILicense variable in File command?


Can I use MUILicense variable in File command?
My MUI installer uses different language specific files for licensing. And I would like to install just one of them (the one that corresponds to the installation language) on user's machine. I am having problems figuring out the correct syntax. Below is a fragment of what I have so far.

...
!insertmacro MUI_PAGE_LICENSE $(MUILicense)
...
LicenseLangString MUILicense ${LANG_ENGLISH} "EULA.en.txt"
LicenseLangString MUILicense ${LANG_FRENCH} "EULA.fr.txt"
...
Section "MainSection" SEC01
...
File /oname=EULA.txt "${MUILicense}"

The File command would not compile. Am I doing something wrong?
Thanks for your help.


Remove the File command, you do not need it.


If I remove File command then even though user can see the license during installation I don't think she'd have any file left to read license terms afterward. I was looking for a way to leave a file on user machine so they can refer to it after install. I also wanted to make the name of this file non-variable so I can uninstall it easily.
Based on your response I thought for second that NSIS and MUI are super smart and do that automatically but a quick check shows absence of such file.


Sorry, I did not read your message properly.

You can test which language has been selected and then extract the appropriate EULA file.

If you only have French and English then use something like this to replace the line that fails to compile

  StrCmp $LANGUAGE ${LANG_FRENCH} french
File /oname=EULA.txt "EULA.en.txt"
Goto continue

french:
File /oname=EULA.txt "EULA.fr.txt"

continue:
If you have a lot of languages to choose from, you may find it easier to use the Logic Library (LogicLib.nsh) supplied with NSIS.

Thanks