运行两次并卸载该应用程序时,Wix Installer 应用程序不会安装 [英] Wix Installer app won't install when run twice and uninstalls the app

查看:32
本文介绍了运行两次并卸载该应用程序时,Wix Installer 应用程序不会安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用gui编写了一个简单的wix安装程序,安装得很好.但是当我第二次运行同一个 .msi 文件时,它会引导我完成 gui 中的正常安装过程,但最后卸载了我的应用程序.然后,如果我第三次运行相同的 .msi 文件,安装程序仍然会通过安装 gui 正常运行,但最终会执行卸载".

我不明白为什么它不像其他所有安装程序那样运行并优雅地处理安装和卸载.

这是我的产品 xml 的一部分

 <Package InstallerVersion="300" Platform="x64" Compressed="yes" InstallScope="perMachine" Manufacturer="..."Comments="..." Description="..." Keywords="..."/><MajorUpgrade DowngradeErrorMessage="已经安装了更新版本的 [ProductName]."/>

解决方案

<块引用>

Auto-GUID:Id="*" 部分表示自动生成产品代码"(使用 * 表示自动生成).当你这样做时您的设置的每次构建或重建都会获得一个新的产品代码.这个如果您还更改了 MSI 术语,则相当于重大升级ProductVersion(在前 3 位数字之一中)并且您有一个 MajorUpgrade 元素,例如您所在的那个在源代码中使用(顺便说一句,这是标准的).

解决方案:如果您希望能够控制产品代码的更改时间,您可以对其进行硬编码.

<小时><块引用>

注意:您的系统可能处于脏状态,有许多重叠"安装.通过打开添加/删除程序小程序查找产品的重复安装:WinKey + 点击 R => appwiz.cpl => 输入.我会卸载所有实例,并且以后可能更喜欢在虚拟机上测试设置?(这也有助于发现隐藏的运行时依赖性 - 前提是在没有大多数运行时保存虚拟).

<小时>

链接:一些链接包含一些关于重大升级的背景信息.

MSI SDK:

Flexera/Installshield:

I wrote a simple wix installer with gui, which installs well. But when I run the same .msi file a second time, it takes me through the normal installation process in the gui, but uninstalls my app at the end. Then if I run this same .msi file a third time, the installer still does through the installation gui normally, but ends up doing "uninstallation".

I don't understand why it doesn't behave like every other installer and handle installation and uninstallation gracefully.

here is part of my product xml

 <Product Id="*" Language="1033" Codepage="1252" Name="..." 
       Version="$(var.ProductVersion)" Manufacturer="..." UpgradeCode="BDF9E310-5897-48D4-AB08-889D405F9X56">

<Package InstallerVersion="300" Platform="x64" Compressed="yes" InstallScope="perMachine" Manufacturer="..." 
         Comments="..." Description="..." Keywords="..."/>

<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />

解决方案

<Product Id="*" Name="..."  Version="" Manufacturer="..." UpgradeCode="...">

Auto-GUID: The Id="*" section means "auto generate product code" (the use of the * means auto-generate). When you do that every build or rebuild of your setup gets a new product code. This amounts to a major upgrade in MSI-terms if you also change the ProductVersion (in one of the first 3 digits) AND you have a MajorUpgrade element such as the one you are using in the source (which is standard by the way).

Solution: You can hard code a product code if you like to be able to control when it changes.


Note: You might be in a dirty state on the system with many "overlapping" installations. Look for duplicate installations of your product by opening the Add / Remove Programs applet: WinKey + Tap R => appwiz.cpl => Enter. I would uninstall all instances, and maybe prefer to test setups on virtuals henceforth? (this also helps to discover hidden runtime depenencies - provided the virtual is saved without most runtimes).


Links: Some links with some background information on major upgrades.

MSI SDK:

Flexera / Installshield:

这篇关于运行两次并卸载该应用程序时,Wix Installer 应用程序不会安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆