安装新版本后,Wix Burn升级将删除exepackages
在升级安装过程中,如何防止Wix燃烧删除exepackage
s?
背景:我正在使用Wix 3.11使用自定义Boottrapper应用程序创建一个安装程序,以及多个exepackage
s和msipackage
s。某些exepackages
安装依赖项不太可能在我们的产品版本之间更改。在发布第一个安装程序之前,我正在尝试测试升级方案。
这是我的exepackages之一
的一个示例:
<ExePackage
Id="InstallDependencyApp"
DisplayName ="DependencyApp"
SourceFile="$(var.InstallerApp.TargetPath)"
CacheId="E1FFF6FF-0B84-41B4-982E-B8920DBA6A73"
PerMachine="yes"
DetectCondition="DependencyApp_InstalledVersion >= DependencyApp_BundleVersion"
InstallCommand="install dependencyApp [INSTALLCONFIG] [WixBundleLog_InstallDependencyApp]"
UninstallCommand="uninstall dependencyApp [INSTALLCONFIG] [WixBundleLog_InstallDependencyApp]">
<PayloadGroupRef Id="ExeDeps"/>
<ExitCode Behavior="success" Value="0"/>
<ExitCode Behavior="error" Value="-1"/>
</ExePackage>
我知道,在升级期间,Wix Bootstrapper将安装所有软件包的新版本,然后触发对旧Boottrapper的无声安装。
在我的情况下,正在发生的事情是,升级安装程序(适当地)跳过了依赖性安装程序的exepackages
,因为detectCondition
表示它们已经安装了。然后,即使仍然需要将它们作为新版本的依赖关系,即使仍然需要exepackages
,也可以删除exepackages
。
如果卸载在升级安装之前发生,则可以,因为依赖项将被卸载然后重新安装。但是我认为当卸载发生在链条中时,我无法改变。
我认为我可以通过在planpackagebegin
侦听器中放入一些自定义逻辑来解决这个问题,在升级方案中,它将有条件地跳过具有某些ID的包装软件包。这似乎是一个混乱的修复。是否有更好的方法可以配置我的捆绑包来正确处理这些软件包?
How can I prevent Wix burn from removing ExePackage
s during an upgrade install?
Background: I'm creating an installer using Wix 3.11 with a custom bootstrapper application, and multiple ExePackage
s and MsiPackage
s. Some of the ExePackages
install dependencies that are unlikely to change between versions of our product. I'm trying to test an upgrade scenario before releasing the first version of the installer.
Here's an example of one of my ExePackages
:
<ExePackage
Id="InstallDependencyApp"
DisplayName ="DependencyApp"
SourceFile="$(var.InstallerApp.TargetPath)"
CacheId="E1FFF6FF-0B84-41B4-982E-B8920DBA6A73"
PerMachine="yes"
DetectCondition="DependencyApp_InstalledVersion >= DependencyApp_BundleVersion"
InstallCommand="install dependencyApp [INSTALLCONFIG] [WixBundleLog_InstallDependencyApp]"
UninstallCommand="uninstall dependencyApp [INSTALLCONFIG] [WixBundleLog_InstallDependencyApp]">
<PayloadGroupRef Id="ExeDeps"/>
<ExitCode Behavior="success" Value="0"/>
<ExitCode Behavior="error" Value="-1"/>
</ExePackage>
I understand that during an upgrade, the Wix bootstrapper will install the new versions of all of the packages, and then trigger the silent uninstallation of the old bootstrapper.
What is happening in my case, is that the upgrade installer (appropriately) skips the ExePackages
for the dependency installers, because the DetectCondition
indicates that they are already installed. Then the uninstaller for the previous version runs, and removes the ExePackages
, even though they are still needed as dependencies for the new version.
If the uninstall happened before the upgrade install, it would be okay, since the dependencies would be uninstalled and then reinstalled. But I don't think I can change when the uninstall happens in the chain.
I think I could work around this by putting some custom logic in the PlanPackageBegin
listener in my bootstrapper, which would conditionally skip uninstalling packages with certain IDs in upgrade scenarios. That seems like a messy fix though. Is there a better way to configure my bundle to correctly handle these packages?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要启用参考调查,请声明包装的依赖项提供商:
这意味着,安装软件包时,提供商的捆绑寄存器并将参考计数添加到提供商中。在升级期间,新捆绑包将向提供商添加自己的参考。卸载旧捆绑包时,它将看到仍然存在引用,并且只会删除其参考,而不是卸载包装。
To enable ref-counting, declare a dependency provider for the package:
This means that when the package is installed, the bundle registers that provider and adds a reference count to the provider for itself. During upgrade, the new bundle will add its own reference to the provider. When the old bundle is uninstalled, it will see that there are still references and will only remove its reference instead of uninstalling the package.