使用WiX进行安装升级-不使用WiX创建旧安装程序 [英] Getting an install to upgrade using WiX - old installer created not using WiX

查看:84
本文介绍了使用WiX进行安装升级-不使用WiX创建旧安装程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Wise For Windows Installer一无所知,正在构建我的第一个WiX安装程序!

I'm building my first WiX installer after becoming sick of the sight of Wise For Windows Installer!

我已经构建了安装程序,并且可以正常运行,但是现在我需要获取它以从我的应用程序的先前版本执行升级.虽然我可以找到很多有关设置WiX的文章,但它们确实可以执行升级,但是当您使用其他工具安装了先前的安装程序时,我什么也看不到如何做.

I've built the installer and that works fine, but now I need to get it to perform an upgrade from the previous version of my app. While I can find plenty of post about setting up WiX do perform upgrades, I can't find anything telling me how to do it when you have a previous installer made using another tool.

我也这样做吗?我是否需要从旧的安装程序中获取升级代码等?提前非常感谢!

Do I do it the same way? Do I need to get upgrade codes, etc, from the old installer? Many thanks in advance!

更新:

按照fletcher的说明,我使用dark.exe从旧的安装程序中获取了UpgradeCode,并将其添加到了产品标签的UpgradeCode中.现在,我的WiX文件的开始看起来...

Following fletcher's instructions I got the UpgradeCode from the old installer using dark.exe and added it to the Product tag's UpgradeCode. The start of my WiX file now looks thus...

<Product Id="fcdc6617-e960-46db-8faa-1dc627f250c8" Name="MyProduct"
       Language="1033" Version="1.2.0.5165" Manufacturer="MyCompany" 
       UpgradeCode="{E97A233B-AB49-4B66-B92A-68972F6D72B9}">

    <Package InstallerVersion="200" Compressed="yes" />

<!-- Upgrade from previous version(s) -->
<Property Id="PREVIOUSVERSIONINSTALLED" Secure="yes" />
<Upgrade Id="{E97A233B-AB49-4B66-B92A-68972F6D72B9}">
  <UpgradeVersion Minimum="1.1.0.4605" Maximum="1.2.0.5165"
                  Property="PREVIOUSVERSIONINSTALLED"
                  IncludeMinimum="yes" IncludeMaximum="no" />
</Upgrade>

...但是现在当我运行此安装程序时,最终在目标计算机上出现了MyProduct的两个实例.我要去哪里错了?

...but now when I run this installer I end up with two instances of MyProduct on the target machine. Where am I going wrong?

推荐答案

今天早上终于找到了解决方案,感谢所有指出正确方向的人(包括DAVID GARDINER的

Finally found a solution this morning, thanks everyone who pointed me in the right direction (including DAVID GARDINER's blog). Making sure the Upgrade code is the same as the previous installer, and that both the Product code has changed and the version number has been incremented, here is the full solution:

<Product Id="fcdc6617-e960-46db-8faa-1dc627f250c8" Name="$(var.ProductName)"
       Language="1033" Version="$(var.Version)" Manufacturer="$(var.Manufacturer)" 
       UpgradeCode="$(var.UpgradeCode)">

<Package InstallerVersion="200" Compressed="yes" />
<Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />

<Property Id="PREVIOUSVERSIONSINSTALLED" Secure="yes" />
<!-- without this next line the upgrade doesn't work! (not sure why?) -->
<Property Id="ALLUSERS" Value="1" /> 

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

  <UpgradeVersion Property='PREVIOUSVERSIONSINSTALLED' 
                  OnlyDetect="no" IncludeMinimum='yes' 
                  Minimum='1.1.0.4605' IncludeMaximum='no' 
                  Maximum='$(var.Version)' />

  <UpgradeVersion Minimum="$(var.Version)" 
                  IncludeMinimum="no" OnlyDetect="yes" 
                  Language="1033" 
                  Property="NEWERPRODUCTFOUND" />

</Upgrade>

...

<InstallUISequence>

  <Custom Action="UIandAdvertised" Sequence="3">
    ProductState=1
  </Custom>

  <LaunchConditions After="AppSearch" />
</InstallUISequence>

<CustomAction Id="PreventDowngrading" Error="Newer version of this product is already    installed." />
<CustomAction Id="UIandAdvertised" Error="Something about the UI."/>

<!-- Remove exist products before install -->
<InstallExecuteSequence>

  <Custom Action="PreventDowngrading" After="FindRelatedProducts">
    NEWERPRODUCTFOUND AND NOT Installed
  </Custom>

  <LaunchConditions After="AppSearch" />
  <RemoveExistingProducts Before="InstallInitialize" />
</InstallExecuteSequence>
</Product>

这篇关于使用WiX进行安装升级-不使用WiX创建旧安装程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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