简体   繁体   English

如何从 .msi 安装程序到电子生成器 (nsis)

[英]How to go from .msi installer to electron-builder (nsis)

I currently have an application out in the field that was distributed as a .msi installer (Built with Wix ).我目前在该领域有一个应用程序,它作为 .msi 安装程序分发(使用Wix构建)。 I've just finished porting this application over to Electron to take advantage of all of the latest and greatest features including using Electron Builder and Auto Updates.我刚刚完成将这个应用程序移植到 Electron 以利用所有最新和最伟大的功能,包括使用 Electron Builder 和自动更新。

Any wix/msi gurus know the best way I could uninstall the old msi and run the new installer?任何 wix/msi 大师都知道我可以卸载旧 msi 并运行新安装程序的最佳方法吗? The solutions I have found involve searching through the Windows Registry to find the msi UUID then using msiexec.我找到的解决方案涉及通过 Windows 注册表搜索以找到 msi UUID,然后使用 msiexec。

Is it possible to just create a new version of the .msi that cleans up everything?是否可以创建一个新版本的 .msi 来清理所有内容?

If I understand correctly you want to migrate from MSI to NSIS format?如果我理解正确,您想从 MSI 迁移到 NSIS 格式吗? There is an article on this here: https://nsis.sourceforge.io/Uninstalling_a_previous_MSI .这里有一篇文章: https : //nsis.sourceforge.io/Uninstalling_a_previous_MSI


I would suggest, however, that you find the product code for the MSI and invoke msiexec.exe with the product code and your own uninstall string (not the one gotten from the registry as shown in the above documentation).不过我建议,你找到了MSI并调用产品代码msiexec.exe与产品代码和你自己的卸载字符串(而不是一个如上述文档中从注册表中得到)。 This way you can add a few constructs to prevent spontaneous reboot and to enforce proper silent running .通过这种方式,您可以添加一些结构来防止自发重启强制执行适当的静默运行 This approach is described below.下面描述这种方法。


Uninstall MSI : You can uninstall the previous MSI version by running an uninstall command in any number of ways: Uninstalling an MSI file from the command line without using msiexec .卸载 MSI :您可以通过多种方式运行卸载命令来卸载以前的 MSI 版本: 从命令行卸载 MSI 文件而不使用 msiexec

Find Product Code : You can find the product GUID of the MSI as follows: How can I find the product GUID of an installed MSI setup?查找产品代码:您可以按如下方式查找MSI 的产品 G​​UID: 如何查找已安装的 MSI 设置的产品 G​​UID?

Command Line : Combining approach 3.5 from first link above and the product code found using the information in the second link, you can use a command line like this to invoke from your NSIS installer:命令行:结合上面第一个链接中的方法 3.5 和使用第二个链接中的信息找到的产品代码,您可以使用这样的命令行从您的 NSIS 安装程序中调用:

msiexec.exe /x {11111111-1111-1111-1111-11111111111X} /QN /L*V "C:\msilog.log" REBOOT=ReallySuppress

Quick Parameter Explanation :快速参数说明

/X = run uninstall sequence
{11111111-1111-1111-1111-11111111111X} = product guid of app to uninstall
/QN = run completely silently
/L*V "C:\msilog.log"= verbose logging at path specified
REBOOT=ReallySuppress = prevent unexpected reboot of computer

ExecWait : NSIS requires its own peculiar command format: Running MSIEXEC in a NSIS script with installer switches . ExecWait :NSIS 需要它自己特殊的命令格式: 在 NSIS 脚本中使用安装程序开关运行 MSIEXEC Haven't tested this yet, but a suggestion:还没有测试过这个,但一个建议:

StrCpy $R0 "{11111111-1111-1111-1111-11111111111X}";  the MSI's ProductID of my package
ExecWait '"msiexec.exe" /x $R0 /QN REBOOT=ReallySuppress'

Check here for fine-tuning the command line: https://nsis.sourceforge.io/Uninstalling_a_previous_MSI .检查此处以对命令行进行微调: https : //nsis.sourceforge.io/Uninstalling_a_previous_MSI


Links :链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM