0

I'm new to WiX and am currently learning. It has quite the learning curve. I'm currently getting the error below:

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  

I don't quite understand why I'm getting this error. If i change the Media Id="1" in the line <Media Id="1" Cabinet="simple.cab" EmbedCab="yes"/> to Media Id="2", the code seems to work. I don't understand because none of my other Id's have a 1 in them and yet I am still getting this error.

Also, if anyone happens to know what this line does: <Property Id="ADDINFOLDERFOUND" Value="NO" /> feel free to enlighten me, I didn't find anything in the docs about it.

Here is my code:

<?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>

Any help/direction is appreciated.

Cflux
  • 1,423
  • 3
  • 19
  • 39
  • In WiX 3.6+, a single MediaTemplate element handles all the details, smartly splitting files to prescribed number of CAB files. If the installation will be separated into several physical media (Two CD’s for example), then a Media element should be used. Media element is older version of MediaTemplate, and used only when installer will be splitted into multiple physical media. – mcy Apr 13 '22 at 08:12
  • TBH `` looks like a custom user property. – mcy Apr 13 '22 at 08:14

1 Answers1

1

The MediaTemplate tag is redundant, remove it or comment it out and you should be good to go.

Property Id="ADDINFOLDERFOUND" Value="NO" is a custom property and from the code you posted, I don't see it being used.

See also: What is the difference between Media and MediaTemplate in WIX?

Hope this helps!

Sharpenologist
  • 189
  • 1
  • 5