Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何确保Wix安装程序覆盖(升级)旧版本并赢得';我不允许降级_Wix_Installation_Upgrade_Versions_Downgrade - Fatal编程技术网

如何确保Wix安装程序覆盖(升级)旧版本并赢得';我不允许降级

如何确保Wix安装程序覆盖(升级)旧版本并赢得';我不允许降级,wix,installation,upgrade,versions,downgrade,Wix,Installation,Upgrade,Versions,Downgrade,我已经在这个论坛和其他论坛上尝试了关于这个话题的大部分答案,但我仍然有这个问题 我想更新捆绑包版本,当我构建和安装安装程序时,它应该升级以前的安装,而不是在“程序和文件”中创建两个记录 我在Product.wxs中使用以下代码 <Product Id="*" Name="SetupProject1" Language="1033" Version="1.0.0.0" Manufacturer="miro" UpgradeCode="5ba49b49-25c4-47c0-82da-12bf5

我已经在这个论坛和其他论坛上尝试了关于这个话题的大部分答案,但我仍然有这个问题

我想更新捆绑包版本,当我构建和安装安装程序时,它应该升级以前的安装,而不是在“程序和文件”中创建两个记录

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

我甚至在考虑基于安装程序及其产品版本属性编写我自己的更新逻辑,但是有太多的情况需要考虑。 你能告诉我这个Product.wxs有什么问题吗,这样我就可以修复它了

谢谢

致以最良好的祝愿,
Evgeni Dyulgerov

您必须在产品部分添加一个升级部分

<Upgrade Id='5ba49b49-25c4-47c0-82da-12bf5310af58'>
   <UpgradeVersion OnlyDetect='no' Property='ISUPGRADE'
                      Minimum='0.0' IncludeMinimum='yes'
                      Maximum='1.0.0.0' IncludeMaximum='no' />     
</Upgrade>

结帐


另外,WiX文档chm(在“开始”菜单中)也非常有用。

有几件事可能会阻止重大升级。您似乎具有正确的主升级逻辑,但:

如果在前三个字段中增加产品版本会更好,这对于大型升级来说更正常

您当前的升级代码是否与旧产品的升级代码相同并不明显,请检查是否相同

如果以前产品的安装范围为perUser,则主升级将不起作用,因为Windows Installer不允许跨上下文主升级

使用详细日志进行安装,并查看FindRelatedProducts的所有事件。将有多个,但请查看升级安装中的一个是否找到以前安装的产品