[英]NSIS Use selected language for uninstaller
I am working on NSIS installer and I just added multi language to the installer.我正在开发 NSIS 安装程序,我刚刚在安装程序中添加了多语言。 I wanted the Installer to show the language dialog everytime the user click on the installer, so I removed those two lines from my nsi file
我希望每次用户单击安装程序时安装程序都显示语言对话框,所以我从我的 nsi 文件中删除了这两行
!define MUI_LANGDLL_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
this one also force the uninstaller to show the language dialog everytime the user click on it.这也强制卸载程序在用户每次单击时显示语言对话框。
I would like to disable the language dialog in the installer OR to make it use the language the user selected when installed the program << this way is better.我想禁用安装程序中的语言对话框,或者使其使用用户在安装程序时选择的语言<<这种方式更好。
Thanks for the helpers.感谢帮助者。
You can save the $language variable in the registry during install and read it into $language in un.onInit.您可以在安装过程中将 $language 变量保存在注册表中,并在 un.onInit 中将其读入 $language。 If you don't want to display the language dialog, don't call it in .onInit
如果您不想显示语言对话框,请不要在 .onInit 中调用它
Use this:用这个:
Function un.onInit
!insertmacro MUI_UNGETLANGUAGE
FunctionEnd
You need to have MUI_LANGDLL_REGISTRY_* setup as well like this:您还需要像这样设置 MUI_LANGDLL_REGISTRY_*:
!define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
!define MUI_LANGDLL_REGISTRY_KEY "Software\YourAppName"
!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.