Install directory is not correct (wrong localization used)
Here's a sample I use:
!include "MUI.nsh"
; ...
!insertmacro MUI_LANGUAGE "Polish"
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_RESERVEFILE_LANGDLL
; Localizations
LicenseLangString LocalizedLicenseData ${LANG_ENGLISH} "..\LicenseEN.txt"
LicenseLangString LocalizedLicenseData ${LANG_POLISH} "..\LicensePL.txt"
LangString ProductNameLang ${LANG_POLISH} "${PRODUCT_POLISH_NAME}"
LangString ProductNameLang ${LANG_ENGLISH} "${PRODUCT_ENGLISH_NAME}"
!define PRODUCT_NAME "$(ProductNameLang)"
InstallDir "$PROGRAMFILES\CompanyName\${PRODUCT_NAME}"
InstallDirRegKey HKLM "Software\${PRODUCT_NAME}" ""
!define PRODUCT_NAMEANDVERSION "${PRODUCT_NAME} ${PRODUCT_VERSION}"
Name "${PRODUCT_NAMEANDVERSION}"
When I run setup I have c:\program files\CompanyName\Polish product name even I selected English from the menu when setup started. More strange is when I use browse button and select a path. Valid (english) product name is added. "Software\${PRODUCT_NAME}" reg key doesn't exists when I run setup. Next strange thing. The application title, set with Name command is in english (Setup has correct english title).
Does anyone know what is wrong with my code?