WiXToolSet - 找到重复符号“Media:1”

WiXToolSet - Duplicate Symbol `Media:1` found

我是 WiX 的新手,目前正在学习。它有相当大的学习曲线。我目前收到以下错误:

Severity    Code    Description Project File    Line    Suppression State
Error       Duplicate symbol 'Media:1' found. This typically means that an Id is duplicated. Check to make sure all your identifiers of a given type (File, Component, Feature) are unique. SetupProject1   \Mac\Home\Desktop\myFolder\HelloWorld\SetupProject1\Product.wxs    12  

我不太明白为什么会出现此错误。如果我将 <Media Id="1" Cabinet="simple.cab" EmbedCab="yes"/> 行中的 Media Id="1" 更改为 Media Id="2",代码似乎可以工作。我不明白,因为我的其他 Id 中的 none 中有一个 1,但我仍然收到此错误。

此外,如果有人碰巧知道这一行的作用:<Property Id="ADDINFOLDERFOUND" Value="NO" />请随意启发我,我在文档中没有找到任何关于它的内容。

这是我的代码:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <?define HelloWorld_TargetDir=$(var.HelloWorld.TargetDir)?>
    <Product Id="xxxxxxx-xxxx-xxxxx-xxxx-xxxxxxxxx"
             Name="HelloWorldTestProject"
             Language="1033" Version="1.0.0.0"
             Manufacturer="testManufacturer"
             UpgradeCode="xxxxxxx-xxxx-xxxxx-xxxx-xxxxxxxxx">

        <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" Comments="This is the commemnts section" />

        <Media Id="1" Cabinet="simple.cab" EmbedCab="yes"/>
        <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." Schedule="afterInstallInitialize" AllowSameVersionUpgrades="yes" />
        <MediaTemplate />

        <Property Id="ADDINFOLDERFOUND" Value="NO" />
        <!--not sure what this line does-->

        <Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER"/>
        <UIRef Id="MyWixUI_InstallDir" />

        <!--Add or remove programs properties-->
        <!--Application Icon-->
        <Icon Id="icon.ico" SourceFile="resources\SetupIcon.ico"/>
        <Property Id="ARPPRODUCTICON" Value="icon.ico" />
        <Directory Id="TARGETDIR" Name="SourceDir">

            <!-- </Component> -->
            <Component Id="HelloWorld.addin" Guid="xxxxxxx-xxxx-xxxxx-xxxx-xxxxxxxxx">
                <File Id="HelloWorld.addin" Name="HelloWorld.addin" Source="$(var.HelloWorld_TargetDir)HelloWorld.addin" />
            </Component>
            <Component Id="HelloWorld.dll" Guid="xxxxxxx-xxxx-xxxxx-xxxx-xxxxxxxxx">
                <File Id="HelloWorld.dll" Name="HelloWorld.dll" Source="$(var.HelloWorld_TargetDir)HelloWorld.dll" />
            </Component>
        </Directory>

        <InstallExecuteSequence> <!-- Still working on figuring this out  -->
        </InstallExecuteSequence><!-- Still working on figuring this out  -->

        <InstallUISequence> <!-- Still working on figuring this out  -->
       </InstallUISequence> <!-- Still working on figuring this out  -->

</Product>
</Wix>

任何 help/direction 不胜感激。

MediaTemplate 标签是多余的,请将其删除或注释掉,这样就可以了。

属性 Id="ADDINFOLDERFOUND" Value="NO" 是一个自定义 属性 从您发布的代码来看,我没有看到它被使用。

另请参阅:What is the difference between Media and MediaTemplate in WIX?

希望对您有所帮助!