WiX“重大升级”降级时未完全安装应用程序

发布于 2024-08-07 04:16:18 字数 871 浏览 3 评论 0原文

目前,每当更新到较新的版本号时,所有升级都可以正常工作,但是在降级时我会遇到奇怪的行为。似乎它会卸载现有版本,然后部分安装我尝试安装的版本,目标位置中尚不存在主 exe,但会创建广告快捷方式。当广告中的快捷方式打开时,它将完成安装(可能会进行修复),然后它将正常运行。

有谁知道为什么会发生这种情况?

我的升级块如下所示:

(IgnoreRemoveFailure 试图解决此问题,但它似乎没有执行任何操作)

在我的 InstallExecuteSequence 中,我还有

另外我有 Product Id="*"Package Id="*"

需要降级的原因是客户端应用程序需要运行与服务器相同的版本为了确保兼容性,整个过程需要自动化,因此如果客户端/服务器版本在登录时不匹配,用户只需单击“是”即可下载、安装并启动正确的版本。到目前为止,这对于升级来说是有效的,但是对于降级,需要一个额外的不直观的步骤,即手动重新启动应用程序,然后在启动之前看到弹出的 Windows 安装程序对话框。

最终的结果是,无论升级还是降级,都需要完全卸载当前版本并完全安装下载的版本,因此如果有其他方法可以实现这一点,那也是一个很好的答案。

Currently all upgrades work fine whenever updating to a newer version number, however I'm getting an odd behavior when downgrading. It seems that it'll uninstall the existing version and then partially install the version that I'm trying to install, the main exe doesn't exist in the target location yet, but advertised shortcuts are created. When the advertised shortcut is opened, it'll finish the installation (presumably do a repair) and then it'll run fine.

Does anyone have any ideas why this is happening?

My upgrade block looks like this:

<UpgradeVersion Minimum="0.0.0.0" Maximum="99.0.0.0" Property="PREVIOUSVERSIONSINSTALLED" IncludeMinimum="yes" IncludeMaximum="no" IgnoreRemoveFailure="yes" />

(The IgnoreRemoveFailure was an attempt to fix this issue, but it doesn't appear to have done anything)

In my InstallExecuteSequence I have <RemoveExistingProducts After="InstallValidate" />

Also I have Product Id="*" and Package Id="*"

The reason the downgrade is needed is because the client application needs to be running the same version as the server to ensure compatibility, and the entire process needs to be automated so if the client/server versions don't match on signin the user can just click "yes" and the proper version is downloaded, installed and started. This is working so far for upgrades, but for downgrades an extra unintuitive step is needed which is to relaunch the app manually and then see a windows installer dialog pop up before it launches.

The end result is that regardless of upgrade or downgrade, the current version needs to be fully uninstalled and the downloaded version fully installed, so if there's another way to accomplish that, that'll also be a good answer.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

感情旳空白 2024-08-14 04:16:18

这对我有用:

<Wix ...>
  <Product ...>
    <Property Id="REINSTALLMODE" Value="amus" />
    <MajorUpgrade AllowDowngrades="yes" />

This is what worked for me:

<Wix ...>
  <Product ...>
    <Property Id="REINSTALLMODE" Value="amus" />
    <MajorUpgrade AllowDowngrades="yes" />
撞了怀 2024-08-14 04:16:18

允许降级并不被认为是最佳实践,至少部分是因为在仍然可以修复它们的同时测试您将支持的每个组合非常困难。是不是无法检测并阻止这种情况(建议先删除较新的版本),并且仅自动支持前进?

如果您必须让这个工作正常,那么详细日志中是否有用于降级安装(或用于修复 - 您需要设置计算机的日志记录策略来创建这个)的任何内容,以确认主要升级(我会查看 FindRelatedProducts 附近)或讨论为什么您的 exe 组件未安装?务必使用 SELMGR 检查任何日志行,因为它们可能会在次要升级场景中对此进行解释。

由于已发布了广告快捷方式,因此听起来该组件已被广告了。这可能表明在次要升级中违反了组件规则(特别是在较新版本中添加了一个组件,看起来就像在旧版本中删除了组件 - 请参阅 HeathS 的 注释),尽管看起来 Product/@Id='*' 应该强制进行重大升级。

您还可以尝试使用示例项目,从具有单个功能、单个组件和带有快捷方式的单个文件的基本版本开始。如果相关,将另一个组件和文件添加到升级版本中;否则只需增加文件版本。然后尝试相反的场景。慢慢添加一些东西,直到找到罪魁祸首。然后希望它是您可以从实际产品中删除的东西,或者可以通过其他方式解决。

Allowing downgrades isn't considered best practice, at least in part because it's so hard to test every combination you'll support while it's still possible to fix them. Is it not feasible to detect and block this case instead (suggest the remove the newer version first), and only automatically support moving forward?

If you must get this one working, is there anything in a verbose log for the downgrading install (or for the repair - you'll need to set the machine's logging policy to get this one created) which confirms the major upgrade (I'd look near FindRelatedProducts) or discusses why the component for your exe isn't installed? Definitely check for any log lines with SELMGR as they might explain this in a minor upgrade scenario.

Since an advertised shortcut is in place, it sounds like the component was advertised instead. This could indicate component rules violations in a minor upgrade (specifically the addition of a component in a newer version looking like the removal in your older version - see HeathS's commentary) though it appears the Product/@Id='*' should force a major upgrade.

You might also try working in a sample project, starting from a base version that has a single feature, single component, and single file with shortcut. If relevant, add another component and file to the upgraded version; otherwise just increment the file versions. Then try your reverse scenario. Slowly add things in until you find your culprit. Then hope it's something you can remove from your real product, or can otherwise be worked around.

江城子 2024-08-14 04:16:18

我的建议有点偏向于“让它发挥作用”——您可以在降级的情况下尝试静默修复自定义操作。

My suggestion is a little on the "make it work" side - you could try a silent repair custom action in case of downgrade.

秋意浓 2024-08-14 04:16:18

您如何对 InstallExecuteSequence 中的操作进行排序?

如果您在安装后执行卸载(这将为您提供最佳升级性能),如果文件版本更改为较低版本,您可能会遇到问题;您的降级可能就是这种情况。

除非明确要求,否则 Windows 安装程序不会用新版本覆盖旧版本。

如果是这种情况,在安装之前重新排序卸载应该会有所帮助。

How did you order the operations in your InstallExecuteSequence?

If you perform the uninstall after the install (which gives you the best upgrade performance) you might see issues if file versions change to lower versions; which could be the case on your downgrades.

Windows installer will not overwrite older versions with newer versions unless explicitly asked.

Reordering to uninstall before installing should help if this is the case.

夜深人未静 2024-08-14 04:16:18

如果使用两个“UpgradeVersion”元素会发生什么?

<UpgradeVersion Maximum="CurrentVersion" Property="PREVIOUSVERSIONSINSTALLED" IncludeMaximum="no" />
<UpgradeVersion Minimum="CurrentVersion" Property="PREVIOUSVERSIONSINSTALLED" IncludeMinimum="no" />

What happens if you use two "UpgradeVersion" elements?

<UpgradeVersion Maximum="CurrentVersion" Property="PREVIOUSVERSIONSINSTALLED" IncludeMaximum="no" />
<UpgradeVersion Minimum="CurrentVersion" Property="PREVIOUSVERSIONSINSTALLED" IncludeMinimum="no" />
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文