【发布时间】:2016-09-21 10:39:40
【问题描述】:
我已经尝试了这个论坛和其他论坛中关于该主题的大部分答案,但我仍然有这个问题。
我想更新捆绑包版本,当我构建和安装安装程序时,它应该升级以前的安装,而不是在“程序和文件”中创建两条记录。
我在 Product.wxs 中使用以下代码。
<Product Id="*" Name="SetupProject1" Language="1033" Version="1.0.0.0" Manufacturer="miro" UpgradeCode="5ba49b49-25c4-47c0-82da-12bf5310af58">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade AllowDowngrades="no" AllowSameVersionUpgrades="yes" IgnoreRemoveFailure="no" DowngradeErrorMessage="loc.NewerVersionInstalled" Schedule="afterInstallInitialize"/>
<MediaTemplate />
<Feature Id="ProductFeature" Title="SetupProject1" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="SetupProject1" />
</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="file_Exefile" Source="..\ConsoleApplication1\bin\Debug\ConsoleApplication1.exe">
</File>
</Component>
</ComponentGroup>
</Fragment>
我什至正在考虑根据安装程序进程及其 ProductVersion 属性编写自己的更新逻辑,但需要考虑的情况太多。
你能告诉我这个 Product.wxs 有什么问题吗,以便我修复它。
谢谢。
最好的问候, 叶夫根尼·杜尔格罗夫
【问题讨论】:
标签: wix installation upgrade versions downgrade