WiX 安装程序 - 更新场景自定义 UI
对于我的应用程序,我有一个使用 WiX 开发的 .msi。对于更新场景,我想要执行以下操作:
如果安装的版本永远不会比更新版本显示错误
如果安装版本早于更新版本 显示带有文本
的按钮Update
如果安装的版本与更新版本相同,则显示带有文本
的按钮Repair
我已经找到了如何定义自定义 UI 对话框,但是如果我创建一个包含所有这些控件(错误标签、更新/修复按钮)的对话框,我如何根据情况仅显示适当的控件。
For my application I have an .msi developed with WiX. For the update scenario I want to do the following:
if the installed version is never than the update version display an error
if the installed version is older than the update version show a button with text
Update
if the installed version is the same as the update version show a button with text
Repair
I have found how to define custom UI dialogs, but if I create a dialog with all these controls (Error label, Update/Repair buttons) how can I display just the appropriate one according to the situation.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用升级属性。
假设
第一个升级版本找到
当前版本之前的所有版本
第二行找到当前版本之上的所有版本
第三行找到与当前版本相同的已安装版本
然后使用像这样的自定义操作
等
显示的自定义操作要么删除旧版本自动更新版本,或者警告用户已安装更新版本,但如果您想提示用户,则可以显示自定义 UI 而不是运行 CA。
就我个人而言,我只使用前两条升级版本行。如果找到较旧的版本,则会自动升级;如果有较新的版本,则会向用户显示错误;如果安装了相同的版本,则会向用户显示错误(默认情况下,它不需要第三行) ,但是这并没有给你想要的 UI,所以正如我上面所说,尝试用你的 UI 替换这些 CA。
Use the Upgrade property.
Assuming
and
The first upgradeversion finds all versions upto the current one
the second line finds all versions above the current one
the third line finds installed versions the same as the current one
Then use a custom action like so
etc
The custom actions shown either removes the older version automatically or it warns the user that a newer version is already installed, but if you want to prompt the user then you can show your custom UI instead of running the CAs.
Personally I just use the first two upgradeversion lines. This does the automatic upgrade if an older one is found, shows the user an error if there is a newer one and, if the same one is installed it shows the user an error ( it does that by default it doesnt require the third line), however this doesnt give you the UI like you want, so as I said above try replacing these CAs with your UI.