如何修复在相同产品版本的每个MSI构建上创建多个实例的问题



请帮助我如何修复在同一产品版本的每个MSI构建上创建多个实例的wix ?在每次使用Wix构建MSI时,都会在控制面板中创建一个新条目。我不会推出任何新版本。

请帮助。这就是我的wxs文件的样子

<Product Id="*" Name="*************" Language="1033" Version="2.0.0.0" Manufacturer="********" UpgradeCode="31C4854C-14E4-4851-901A-921E0B1A54C1">
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
    <MediaTemplate />
    <Feature Id="ProductFeature" Title="*********" Level="1">
      <ComponentGroupRef Id="ProductComponents" />
    </Feature>
    <Feature Id="F_FullApplication" Title="Full Application" Level="1" Description="All Services" ConfigurableDirectory="INSTALLFOLDER">
      <ComponentGroupRef Id="C_CommonAssemblies" />
    </Feature>
    <Binary Id="************"
            src="..*********bin$(var.Configuration)*********.dll" />
  </Product>

首先,有3种类型的升级:大升级、小升级和小升级。既然您定义了元素"MajorUpgrade",那么您将在每个新版本中进行一次主要升级。在这种情况下,还必须删除

<Upgrade Id="31C4854C-14E4-4851-901A-921E0B1A54C1">
<UpgradeVersion Minimum="2.0.0.0" OnlyDetect="yes"      Property="NEWERVERSIONDETECTED" /> 
<UpgradeVersion Minimum="1.8.0.1" IncludeMinimum="yes" Maximum="2.0.0.0" IncludeMaximum="no" Property="OLDERVERSIONBEINGUPGRADED" />

并在每次构建时生成一个新的产品指南(例如,通过将"product"元素的"Id"属性设置为"*")。请仔细阅读https://msdn.microsoft.com/en-us/library/windows/desktop/bb204770(v=vs.85).aspx。我建议您为适合您需要的升级类型编写文档。

第二,如果你想让同一个版本自己升级,你的MajorUpgrade元素必须将属性" allowsameversionupdates "定义为"yes"。Cf http://wixtoolset.org/documentation/manual/v3/xsd/wix/majorupgrade.html请注意,只有第四个版本号不同的两个安装程序实例被认为具有相同的版本(例如:2.3.21.111与2.3.21.423是相同的版本,但不是2.3.22.231)

Edit: This works for me

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="vinod" Language="1033" Version="1.0.0.0" Manufacturer="brainless" UpgradeCode="cfd6535c-0037-4463-a71a-f206448638ce">
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." AllowSameVersionUpgrades="yes" />
    <MediaTemplate />
    <Feature Id="ProductFeature" Title="vinod" Level="1">
        <ComponentRef Id="MyComp" />
    </Feature>
    <Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="ProgramFilesFolder">
            <Directory Id="INSTALLFOLDER" Name="vinod">
                <Component Guid="82fb8081-05d4-4b71-8f74-97983797741d" Id="MyComp">
                    <File Id="MyFile" Name="myfile.dll" Source="$(env.DllDir)myfile.dll" KeyPath="yes" />
                </Component>
            </Directory>
        </Directory>
    </Directory>
</Product>

最新更新