我正在尝试升级我的应用程序。如果用户安装1.0.0,那么下次我发布一个版本时,我可以给他们1.1.0,他们可以安装它。 Overwriting | removing | replacing the first version
只能在控制面板中安装一个版本 - >卸载或更改程序。允许升级应用程序
我的问题是:
如果我不设定产品ID等于*(使用$(var.ProductId)”代替),我得到
此产品的另一个版本已安装。的 安装这个版本不能继续...
如果我将其设置为*然后安装新版本,我安装了两个版本。
我已经创建了一个简单的wix应用程序来测试它。
<?xml version="1.0" encoding="UTF-8"?>
<?define ProductVersion="!(bind.FileVersion.MyAssemblyDll)"?>
<?define UpgradeCode="f4d7f199-28f6-45d5-ad99-7c62938274be"?>
<?define ProductId="{6408D956-40DA-4AEE-883E-5425F1562004}"?>
<?define Version="1.2.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="$(var.ProductId)" Name="UpgradeTest" Language="1033" Version="$(var.Version)" Manufacturer="xxx" UpgradeCode="$(var.UpgradeCode)">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<!-- prevents down gradeing -->
<!-- one upgrade installes new version first then removes the old one. -->
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." Schedule="afterInstallExecute"/>
<MediaTemplate EmbedCab="yes"/>
<Feature Id="ProductFeature" Title="UpgradeTest" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="UpgradeTest" />
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
<Component Id="ProductComponent">
<File Id="Product.wxs" Source="Product.wxs" KeyPath="yes" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
我一直试图让这几天的工作,现在我已经用尽了所有的教程,早至2008年。任何帮助将不胜感激。
更新:
<MajorUpgrade AllowDowngrades="no" DowngradeErrorMessage="A newer version of [ProductName] is already installed." AllowSameVersionUpgrades="no" />
坏:结果在控制面板的两个版本。
更新二:
<Upgrade Id ="$(var.ProductUpgradeCode)">
<UpgradeVersion Minimum="$(var.ProductFullVersion)" OnlyDetect="yes" Property="NEWERVERSIONDETECTED"/>
<UpgradeVersion Maximum="$(var.ProductFullVersion)" IncludeMaximum="no" Property="OLDERVERSIONBEINGUPGRADED"/>
</Upgrade>
<InstallExecuteSequence>
<RemoveExistingProducts After="InstallValidate"/>
</InstallExecuteSequence>
<Condition Message="A newer version of [ProductName] is already installed. If you are sure you want to downgrade, remove the existing installation via Programs and Features.">Not NEWERVERSIONDETECTED</Condition>
坏:结果在控制面板的两个版本。
没有工作。它确实要求我重新启动电脑来完成我以前从未见过的安装。但我仍然在机器上安装了两个版本,而不是最新版本。 – DaImTo