从WIX3升级到WIX4:构建时出现重复ID错误

问题描述 投票:0回答:1

我对 wix 不太熟悉,但我尝试将 msi 软件包的引导程序从 wix3 升级到 wix4。我使用 Visual Studio 2019 的 HeatWave 插件进行升级。当我现在尝试构建时,我遇到了重复 id 的错误。

在我们的引导程序中有一个

bundle.xxs

<Chain>
        <PackageGroupRef Id="NetFx48Redist"/>
        [...]
</Chain>

和一个

NetFx48.wxs(链接

<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->

<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util">

  <!--
      .NET Framework installation state properties
      Official documentation can be found at the following location:
      .NET Framework 4.5/4.5.1/4.5.2/4.6/4.6.1/4.6.2/4.7/4.7.1/4.7.2/4.8 - https://msdn.microsoft.com/en-us/library/w0x726c2(v=vs.110).aspx
   -->

    <?define NetFx48MinRelease = 528040 ?>
    <?define NetFx48WebLink = https://go.microsoft.com/fwlink/?LinkId=2085155 ?>
    <?define NetFx48RedistLink = https://go.microsoft.com/fwlink/?linkid=2088631 ?>
    <?define NetFx48EulaLink = https://referencesource.microsoft.com/license.html ?>
    <?define NetFx48WebId = NetFx48Web ?>
    <?define NetFx48RedistId = NetFx48Redist ?>

    <Fragment>
        <PropertyRef Id="WIXNETFX4RELEASEINSTALLED" />
        <Property Id="WIX_IS_NETFRAMEWORK_48_OR_LATER_INSTALLED" Secure="yes" />
        <SetProperty Id="WIX_IS_NETFRAMEWORK_48_OR_LATER_INSTALLED" Value="1" After="AppSearch" Condition="WIXNETFX4RELEASEINSTALLED &gt;= &quot;#$(var.NetFx48MinRelease)&quot;" />
    </Fragment>

    <Fragment>
        <util:RegistrySearchRef Id="NETFRAMEWORK45" />

        <WixVariable Id="NetFx48RedistDetectCondition" Value="NETFRAMEWORK45 &gt;= $(var.NetFx48MinRelease)" Overridable="yes" />
        <WixVariable Id="NetFx48RedistInstallCondition" Value="" Overridable="yes" />
        <WixVariable Id="NetFx48RedistPackageDirectory" Value="redist\" Overridable="yes" />

        <PackageGroup Id="$(var.NetFx48RedistId)">
            <ExePackage CacheId="$(var.NetFx48RedistId)_ABDCA79AF9DD48A0EA702AD45260B3C03093FB4B" InstallArguments="/q /norestart /log &quot;[NetFx48RedistLog].html&quot;" PerMachine="yes" DetectCondition="!(wix.NetFx48RedistDetectCondition)" InstallCondition="!(wix.NetFx48RedistInstallCondition)" Id="$(var.NetFx48RedistId)" Vital="yes" Permanent="yes" Protocol="netfx4" LogPathVariable="NetFx48RedistLog" Cache="remove">
                <ExePackagePayload Name="!(wix.NetFx48RedistPackageDirectory)ndp48-x86-x64-allos-enu.exe" DownloadUrl="$(var.NetFx48RedistLink)" ProductName="Microsoft .NET Framework 4.8" Description="Microsoft .NET Framework 4.8 Setup" CertificatePublicKey="F49F9B33E25E33CCA0BFB15A62B7C29FFAB3880B" CertificateThumbprint="ABDCA79AF9DD48A0EA702AD45260B3C03093FB4B" Size="121307088" Version="4.8.4115.0" />
            </ExePackage>
        </PackageGroup>
    </Fragment>

    <Fragment>
        <PackageGroup Id="$(var.NetFx48RedistId)AsPrereq">
            <PackageGroupRef Id="$(var.NetFx48RedistId)" />
        </PackageGroup>

        <bal:ManagedBootstrapperApplicationPrereqInformation PackageId="$(var.NetFx48RedistId)" LicenseUrl="$(var.NetFx48EulaLink)" />
    </Fragment>

</Wix>

在这种情况下构建错误

WIX0091 Duplicate symbol 'WixBundlePackageGroup:NetFx48Redist' referenced by ...\Bundle.wxs(21). This typically means that an Id is duplicated. Ensure all your identifiers of a given type (File, Component, Feature) are unique or use an access modifier to scope the identfier.

显示。据我了解,使用片段并通过引用推送它的处理是正确的。所以问题是为什么我应该改变ide

致以诚挚的问候

丹尼尔

.net wix
1个回答
0
投票

您已从 WiX 工具集中复制了一个文件,并将其包含在您的构建中,并引用包含该文件的 WixToolset.NetFx.wixext。我建议不要在您的项目中复制 WiX 工具集代码。

© www.soinside.com 2019 - 2024. All rights reserved.