WiX:更新“添加/删除程序”中显示的版本号

发布于 2024-10-08 13:28:33 字数 255 浏览 5 评论 0原文

我使用 WyUpdate 自动提供程序更新,以便我的客户始终运行最新版本。然而,这种方法的一个问题是,更新期间不会调用 MSI 安装程序(使用 WiX 3.5 创建),因此添加/删除程序中的版本号不会增加。

我的问题是是否有某种安全的方法可以以编程方式更改显示的版本?(WyUpdate 能够在更新期间执行自定义代码并更改注册表值)。

I use WyUpdate to automatically deliver program updates so my customers are always running the latest version. However one problem with this approach is that the MSI installer (created with WiX 3.5) is not invoked during updates and thus the version numbers in Add/Remove Programs are not incremented.

My question is if there is some safe way to programmatically bump the displayed version ?(WyUpdate has the ability to execute custom code and change registry values during updates).

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

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

发布评论

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

评论(2

記憶穿過時間隧道 2024-10-15 13:28:33

从技术上讲,您可以在系统注册表中找到从中读取版本的密钥(通常在 SOFTWARE/Microsoft/Windows/CurrentVersion/Uninstall 下),并强制您的更新软件每次使用正确的版本修改该值。

但我认为这不是一个好主意。修改不属于您的注册表项以及将您自己的逻辑注入到 Windows Installer 中可能会导致意想不到的后果。我个人永远不会这样做。迟早,它会射击...

顺便说一句,如果您不依赖 Windows Installer 进行更新,为什么更新 ARP 中的版本那么重要?例如,在您的应用程序中有一个众所周知的位置,用户可以在其中查找当前版本。

Technically, you can find a key in the system registry where the version is read from (typically, under SOFTWARE/Microsoft/Windows/CurrentVersion/Uninstall) and force your update software to modify this value each time with the correct version.

BUT I don't think it is a good idea. Modifying the registry keys you don't owe, and injecting your own logic into the Windows Installer might lead to unexpected consequences. I would personally never do this. Sooner or later, it will shoot...

BTW, if you don't rely on Windows Installer with updates, why it is that important to update the version in ARP? Have a well-known place in your application where users can look for the current version, for instance.

伴梦长久 2024-10-15 13:28:33

只需将“DisplayVersion”值更改为最新版本即可。

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\YourAppName

另外,为了节省时间,在 wyBuild 中,您可以使用 %version% 变量,您创建的每个新版本都将使用正确的版本(而不是每次发布新版本时都必须键入它)。

至于严说的话……

但我认为这不是一个好主意。修改不属于您的注册表项以及将您自己的逻辑注入到 Windows Installer 中可能会导致意想不到的后果。我个人永远不会这样做。迟早会开枪的……

这完全是错误的。编辑注册表值不会更改安装程序逻辑。这一点也不危险。最终用户仍然可以修复原始安装(将注册表和所有文件恢复到原始版本),并且他们可以运行卸载程序,它将删除注册表和文件(尽管它们已被更改)。

如果不希望“msi 修复”恢复到原始安装(而不是应用程序的更新版本),那么您需要向用户提供 *.msp 或 *.msi,并且 将其作为更新的一部分执行

简短的回答:编辑注册表既不是邪恶的,也不是不安全的,只要您了解什么是什么。

Simply change the "DisplayVersion" value to the latest version.

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\YourAppName

Also, to save time, in wyBuild you can use the %version% variable and every new version you create will use correct version (instead of having to type it each time you release a new version).

Regarding what Yan said...

BUT I don't think it is a good idea. Modifying the registry keys you don't owe, and injecting your own logic into the Windows Installer might lead to unexpected consequences. I would personally never do this. Sooner or later, it will shoot...

This is plain wrong. Editing a registry value isn't changing the installer logic. It isn't dangerous at all. The end-user can still repair the original installation (reverting the registry and all the files back to the original version) and they can run the uninstaller and it will remove the registry and files (despite them being changed).

If don't want the "msi repair" to revert to the original installation (rather than to the updated version of your app) then you'll want to deliver an *.msp or *.msi to your users and execute it as part of your update.

Short answer: editing registry is neither evil nor unsafe, as long as you understand what's what.

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