简体   繁体   English

NSIS 为卸载程序使用选定的语言

[英]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.

相关问题 如何将所选语言用于卸载程序? - How I can use selected language for uninstaller? 如何更改 NSIS 中字幕的字体? - How can I change the font of the captions in NSIS? 在 NSIS 安装程序中调用 MUI 的 PRE 函数,在 NSIS 安装程序中跳过页面/对话框 - Calling PRE functions of MUI in NSIS installer, skipping pages/dialogs in NSIS installer 设置在 nsis 安装程序的自定义对话框页面上添加的自定义 label 的字体 - set the font of a custom label added on a custom dialog page in nsis installer NSIS-使用命令行参数跳过某些对话框吗? - NSIS - Skip certain dialogs using command-line arguments? 在NSIS中,如何在运行时将onClick事件应用于对话框控件? - In NSIS, how to apply a onClick event on a dialog control at runtime? 如何在nsis的ABORT消息框中禁用关闭按钮? - How to disable close button in the ABORT Message box in nsis? NSIS:单击“下一步” /“后​​退”按钮后,如何保持上一个对话框的输入值? - NSIS : How to keep input value from previous dialog after click Next/Back button? 在自定义用户界面中找不到IDOK(1)! 如何在NSIS中添加自定义“确定”按钮? - Can't find IDOK (1) in the custom UI! How to add a custom OK Button in NSIS? 如何更改 NSIS 中欢迎页面和完成页面中图像的宽度,使其看起来像背景? - How can I change the width of the image in the welcome and finish pages in NSIS so that it will look like a background?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM