WIX 安装程序无法从以前安装的 Windows 安装程序软件升级 [英] WIX installer Can't upgrade from previously installed Windows installer SW

查看:42
本文介绍了WIX 安装程序无法从以前安装的 Windows 安装程序软件升级的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为我们的软件创建 WIX 安装程序,现在我在从以前的 Windows Installer 打包软件升级时遇到了一些问题.

I am creating a WIX installer for our software and now I have some issue when upgrading from previous Windows Installer packaged SW.

出现问题之前的一件事,从一个 WIX 打包软件升级到另一个 WIX 打包软件实际上工作正常,我可以卸载旧版本并安装新版本.当旧版本是 Windows Installer 打包(这是我们当前的解决方案)而新版本是 WIX 打包时,就会出现真正的问题.基本上我的 WIX 安装程序无法发现已经安装了旧版本,因此将安装新版本而不卸载旧版本.

One thing before the problem, the upgrade from one WIX packaged SW to another WIX packaged SW is actually working fine, I am able to uninstall the older version and install the newer version. The real problem happens when the older version is Windows Installer packaged (which is our current solution) and the newer version is WIX packaged. Basically my WIX installer is unable to find out that a older version is already installed, so the newer version will be installed without uninstalling the old version.

我如何在 WIX 安装程序和 Windows 安装程序之间建立连接:我将 WIX 的 UpgradeCode 设置为与 Windows 安装程序之一相同.我还在线查看了一些示例,他们建议我当前的解决方案应该可行.这是我升级部分的 .wxs 文件的一部分:

How I make the connection between WIX installer and Windows installer: I set the UpgradeCode of WIX as the same as Windows installer one. I also check some examples online, and they suggest my current solution should work. Here is part of my .wxs file of the upgrade part:

<Upgrade Id="$(var.UpgradeCode)">

  <UpgradeVersion OnlyDetect="yes" Minimum="$(var.VersionNumber)" Property="NEWPRODUCTFOUND" IncludeMinimum="no" />
  <UpgradeVersion OnlyDetect="no" Maximum="$(var.VersionNumber)" Property="UPGRADEFOUND" IncludeMaximum="no" />           
</Upgrade>

<CustomAction Id="PreventDowngrading" Error="A software with newer version number is found on this machine" />        

<InstallUISequence>
  <Custom Action="PreventDowngrading"
          After="FindRelatedProducts">NEWPRODUCTFOUND</Custom>
</InstallUISequence>    

<InstallExecuteSequence>
  <Custom Action="PreventDowngrading"
      After="FindRelatedProducts">NEWPRODUCTFOUND</Custom>
  <RemoveExistingProducts After="InstallFinalize" />   
</InstallExecuteSequence>

值得一提的是我们的软件实际上是一个 Windows 服务,我不确定这是否重要.感谢您的帮助!

One thing might be worth mentioning is our SW is actually a Windows Service, I am not sure whether that matters. Thanks for any help!

推荐答案

只有相同的升级代码是不够的.您还必须检查这两个软件包是否具有相同的安装类型,即它们都是按用户或按机器安装的.如果安装类型不同,Windows Installer 将跳过旧版本的删除.

Having the same upgradecode is not enough. You must also check that the two packages have the same install type, i.e. they both get installed per-user or per-machine. If the install type is different Windows Installer will skip the removal of the old version.

这篇关于WIX 安装程序无法从以前安装的 Windows 安装程序软件升级的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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