如何让 WiX 主要升级正常工作?
我正在努力启用 WiX 中的主要升级功能。
我希望安装程序的每个新版本都是重大升级(完全卸载,然后重新安装),因为我们不希望有不同的升级和全新安装版本。
我开始尝试使用标签内容来完成此操作,但我不断收到“已安装另一个版本”的信息。当我运行安装程序时出现错误消息。
所以我实现了V3.5中添加的新标签以使升级更容易。我仍然收到错误消息。
然后我在某处读到您需要更改每个新版本的 ID GUID。所以我设置 Id="*" 让 WiX 生成它们。
现在,当我安装较新版本时,它不会卸载旧版本,并且最终会在同一文件夹中进行两次安装。我解决了这个问题,因为运行 MSI(新的或旧的)都会显示修复/删除屏幕。
该程序也没有被新版本覆盖。
这是我的 WiX 脚本的开头:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*"
Name="Foo"
Language="1033"
Codepage="1252"
Version="!(bind.FileVersion.Foo.exe)"
Manufacturer="Foo Bar Ltd."
UpgradeCode="dac2fab2-7d76-4e47-b25f-0748380dab81">
<Package
Description="Foo"
Comments="This installer database contains the logic and data required to install Foo."
InstallerVersion="300"
Languages="1033"
SummaryCodepage="1252"
Platform="x86"
Compressed="yes" />
<!-- Remove older versions -->
<!-- Important note: MSI ignores the last version digit 1.0.0.? when comparing versions, so always change at least the 3rd digit for new external releases-->
<MajorUpgrade DowngradeErrorMessage="The version currently installed is newer than the version you are attempting to install."/>
I am struggling to enable the major upgrade functionality in WiX.
I want every new version of the installer to be a major upgrade (full uninstall, then new install) as we don't want different upgrade and clean install versions.
I started off trying to do it using the tag stuff, but I kept getting "Another version is installed." error message when I run the installer.
So I implemented the new tag that was added in V3.5 to make upgrades easier. I was still getting the error message.
I then read somewhere that you need to change the Id GUID for each new version. So I set Id="*" to get WiX to generate them.
Now when I install the newer version it doesn't uninstall the older version, and you end up with two installations to the same folder. I worked this out because running either MSI (new or old) would bring up the repair/remove screen.
Also the program was not overwritten with the new version.
Here is the start of my WiX script:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*"
Name="Foo"
Language="1033"
Codepage="1252"
Version="!(bind.FileVersion.Foo.exe)"
Manufacturer="Foo Bar Ltd."
UpgradeCode="dac2fab2-7d76-4e47-b25f-0748380dab81">
<Package
Description="Foo"
Comments="This installer database contains the logic and data required to install Foo."
InstallerVersion="300"
Languages="1033"
SummaryCodepage="1252"
Platform="x86"
Compressed="yes" />
<!-- Remove older versions -->
<!-- Important note: MSI ignores the last version digit 1.0.0.? when comparing versions, so always change at least the 3rd digit for new external releases-->
<MajorUpgrade DowngradeErrorMessage="The version currently installed is newer than the version you are attempting to install."/>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这是我在所有包中使用的片段,经过许多内部和公共版本的改进
Here's a snippet of what I use for all my packages, refined over many internal and public releases
如果它对发现这个线程的人有任何用处,我也遇到了我刚刚发现的类似问题。
就我而言(仍处于开发安装程序的早期阶段),关键的区别在于,在版本之间,我已从按用户安装切换到按计算机安装。更具体地说,我将以下行添加到我的 Product.wxs 中:
我仍在了解 Windows 安装程序的许多特性,但我认为通过以这种方式切换安装类型将具有可比性以多种方式转向互斥的版本控制流(甚至允许并行安装两个相同的版本!)。
遗憾的是 Windows 控制面板没有明确区分每用户安装和所有用户安装。
If it's of any use to those who discover this thread, I've also encountered a similar problem which I've just figured out.
In my case (and still having been in early stages of developing my installer), the critical difference was that, between versions, I had switched from a per-user install to a per-machine install. More specifically, I'd added the following line to my Product.wxs:
I'm still getting my head around many of the idiosyncrasies of Windows Installers, but I'd assume that by switching the type of installation in this way would be comparable with shifting to a mutually exclusive stream of versioning in many ways (even enabling two identical versions to be installed in parallel!).
It's a shame that the Windows Control Panel doesn't clearly distinguish between installations which are per-user and all-users.
我知道这篇文章很旧并且已得到解答,但是,如果有人遇到此问题,我的升级安装程序会出现问题。升级部分都很好。安装程序将运行,但是以前的版本从未被删除,因此未安装新版本。问题是
上面的 Level="0",应该是 Level="1",如下所示:
Scott
I know this post is old and answered, but, in case anyone runs across this, I had issues with my upgrade installer. The upgrade sections were all fine. The installer would run, but, the previous version was never removed, therefore, the new version was not installed. The issue was this
The Level="0" above, should have been Level="1" as it is below:
Scott