简体   繁体   English

WIX安装程序无法从以前安装的Windows安装程序SW升级

[英]WIX installer Can't upgrade from previously installed Windows installer SW

I am creating a WIX installer for our software and now I have some issue when upgrading from previous Windows Installer packaged SW. 我正在为我们的软件创建一个WIX安装程序,现在从以前的Windows Installer打包软件升级时遇到了一些问题。

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. 在问题出现之前,从一个WIX打包的SW升级到另一个WIX打包的SW实际上工作正常,我可以卸载旧版本并安装新版本。 The real problem happens when the older version is Windows Installer packaged (which is our current solution) and the newer version is WIX packaged. 当旧版本打包Windows Installer(这是我们当前的解决方案)并且较新版本是WIX打包时,会出现真正的问题。 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安装程序无法找到已安装旧版本的版本,因此将安装较新版本而不卸载旧版本。

How I make the connection between WIX installer and Windows installer: I set the UpgradeCode of WIX as the same as Windows installer one. 如何在WIX安装程序和Windows安装程序之间建立连接:我将WIX的UpgradeCode设置为与Windows安装程序相同。 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: 以下是升级部分的.wxs文件的一部分:

<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>

One thing might be worth mentioning is our SW is actually a Windows Service, I am not sure whether that matters. 有一点可能值得一提的是我们的SW实际上是Windows服务,我不确定这是否重要。 Thanks for any help! 谢谢你的帮助!

Having the same upgradecode is not enough. 拥有相同的升级代码是不够的。 You must also check that the two packages have the same install type, ie 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. 如果安装类型不同,Windows Installer将跳过删除旧版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM