我可以使用 WiX 创建一个 MSI,其唯一目的是卸载软件吗?
我已经通过 WiX 生成的安装程序交付了软件 1.0 版,现在我想交付/传播 1.1 版。如果可能的话,我想避免告诉人们在安装 1.1 之前先手动删除 1.0 的情况。
但是,由于各种技术原因,我必须修改 InstallScope
,将其从 perUser
更改为 perMachine
。没什么大不了的,只是它让升级变得很麻烦。
我看到发生的事情与 这篇文章提到,其中即使您已经完成了所有正确执行升级,完成后您会在已安装程序列表中看到两个不同的条目,一个是 1.0,另一个是 1.1。这会导致软件出现问题。
所以看来基本的“删除以前的版本”逻辑在这里不起作用,所以我需要一些其他方法来卸载以前的版本。我尝试沿着正确的 msiexec /x
命令通过 ShellExecute CustomAction
删除以前的版本的路径走下去,但除非我错过了一些东西,否则没有地方可以使用这是可行的顺序,因为您在另一个运行过程中触发了一个 msiexec
命令。
然后我偶然发现了此页面,其中详细介绍了一种记录很少的“链接”方法MSI 在一起:
setupbld.exe -out $(TargetDir)setup.exe -msu FirstInstaller.msi -msu SecondInstaller.msi -setup $(ProjectDir)setup.exe
听起来很棒 - 我现在需要的只是一些 MSI,其唯一功能是删除 1.0 版本,然后我可以将其与旧版本链接在一起。
但我没有找到很多关于如何做到这一点的文档。事实上,由于理论上这可能用于删除您最初未安装的软件,因此出于安全原因,我不确定这在技术上是否可行。
有谁知道如何使用 WiX 创建 MSI,其唯一目的是卸载软件?或者我对这个问题的攻击完全错误吗?
I've delivered version 1.0 of my software with a WiX-generated installer, and now I want to deliver/disseminate version 1.1. If possible I would like to avoid the situation of telling people to remove 1.0 manually first before installing 1.1.
However, I've had to modify the InstallScope
, changing it from perUser
to perMachine
for various technical reasons. Not a big deal, except it makes upgrading a hassle.
What I'm seeing happen is the same thing that this post mentions, wherein even though you've done all the proper work to implement an upgrade, when it's done you see two different entries on the list of installed programs, one is 1.0 and the other is 1.1. And this is causing problems in the software.
So it would appear that the basic "remove the previous version" logic doesn't work here, so I need some other method of having the previous version uninstalled. I tried to go down the path of firing off the proper msiexec /x
command remove the previous version via a ShellExecute CustomAction
, but unless I'm missing something there's no place in the sequence where this would work because you're firing off one msiexec
command in the middle of another running.
Then I stumbled across this page which details a little-documented method of "chaining" MSI's together:
setupbld.exe -out $(TargetDir)setup.exe -msu FirstInstaller.msi -msu SecondInstaller.msi -setup $(ProjectDir)setup.exe
Sounds great - all I need now is some MSI whose sole function is to remove version 1.0 and then I can chain that together with the old one.
Except I'm not finding a lot of documentation on how you could do that. In fact, since this could in theory potentially be used to remove software you didn't originally install, I'm not sure this is even technically possible for security reasons.
Does anyone know how to create a MSI using WiX whose sole purpose is to uninstall the software? Or am I attacking this problem completely wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用此 Wix 卸载以前的版本作为 1.1 版本的一部分。我不确定为什么需要将 MSI 链接在一起。
如何实施 WiX 安装程序升级?
编辑:我错过了 InstallScope 要求的更改。所以真正需要的是一个引导程序。
我在这里发布了如何创建 BootStrapper:我需要一个安装我的软件和先决条件的 WIX Bootstrapper 项目
Use this Wix to uninstall the previous version as part of your 1.1 version. I'm not sure why you need to chain the MSIs together.
How to implement WiX installer upgrade?
EDIT: I missed the change in InstallScope requirement. So what is really needed is a bootstrapper.
I posted how to create a BootStrapper here: I need a WIX Bootstrapper Project that installs MY software and prerequisites
解决方案是使用运行“msiexec.exe /x”命令的自定义操作。确保将其安排在 InstallExecuteSequence 中的 InstallFinalize 之后。另外,它的Return应该是asyncNoWait(异步执行,不等待返回)。
通过这些设置,卸载将使用不同的异步进程,从而避免冲突。
A solution is to use a custom action which runs the "msiexec.exe /x" command. Make sure it's scheduled after InstallFinalize in InstallExecuteSequence. Also, it's Return should be asyncNoWait (asynchronous execution, do not wait for return).
With these settings the uninstall uses a different asynchronous process, avoiding the conflict.