[wix-users] BINGO!

Phill Hogland phill.hogland at rimage.com
Mon Apr 25 12:15:29 PDT 2016


I really appreciate how WiX simplifies creating installers in general (and MSI authoring in particular).  Generally (based on a blog I read somewhere, probably on Joy of Setup) I minimize the authoring of element attributes and let the WiX tools make the wisest choice for defaults.  But in some situations it is important to manually (or with transforms) author unique IDs.

It is also wise to not use heat.exe until you understand the core concepts and then only use it in well defined scenarios.  When I do use it, I prefer to use the HarvestDirectory target defined by WiX rather than calling heat.exe directly as the integration is much better.

________________________________________
From: wix-users <wix-users-bounces at lists.wixtoolset.org> on behalf of Ian Bell <ib at ianbellsoftware.com>
Sent: Monday, April 25, 2016 1:13:33 PM
To: 'WiX Toolset Users Mailing List'
Subject: [wix-users] BINGO!

Hello Phill,

Very helpful suggestions and they provided the clue to resolve the problem.

For learning purposes, I have intentionally avoided using Heat and have been
manually coding all the WIX markup.   As per your suggestion, I used HEAT to
generate the WIX markup and then  copy/pasted the HEAT generated markup into
my WIX installer code - this resolved the problem.   A quick inspection
showed that HEAT added an ID attribute for each FILE element whereas  the
WIX markup I hand coded did not include the ID attribute.  I was able to
successfully build the WIX installer after updating my hand coded WIX
project to include the ID attribute for each FILE element then.

If I understand correctly, the file ID attribute serves as the primary key
in the Windows installer data base and I am guessing that if it is omitted
then the file name itself is used as the primary key.   But my manually
coded markup contained duplicate file names, hence duplicate primary keys
and this caused the error.  Moving forward, I'll make a point of always
including the file ID attribute.

Many thanks for your very helpful suggestion.

Ian


-----Original Message-----
From: Phill Hogland [mailto:phill.hogland at rimage.com]
Sent: April 25, 2016 13:14
To: 'WiX Toolset Users Mailing List'; ib at ianbellsoftware.com
Subject: Re: [wix-users] error LGHT0091: Duplicate symbol

>>So my question is has anyone encountered the problem before and found
>>a
 solution?

I had a similar problem where I was creating a msi to install our product's
sdk which had a number of VS samples etc, each containing similar filenames
such as readme.txt

The solution that I settled on (after trying a different approach which
worked but were less desirable) is:
1) A build script, external to the wix build process in my case, is used to
copy the files to a source tree which mimics how I want the files to layout
on the target system.  (And I generally use 'named bindpaths' and avoid
using VS Properties because I prefer to build with MSBuild directly without
having the VS Solution loaded.)
2) I use HarvestDirectory to harvest a parent of the folder tree that
contains the duplicate file names.  Heat manages the duplicates assigning
different IDs.

An earlier approach when I was harvesting/authoring the subfolder trees
which might have a duplicate file name as another harvest/authoring section
was to make sure that the File/@Id (and related Ids) were each authored
differently using transforms, but that was impractical to maintain over
time.


________________________________________
From: wix-users <wix-users-bounces at lists.wixtoolset.org> on behalf of Ian
Bell <ib at ianbellsoftware.com>
Sent: Monday, April 25, 2016 11:48:56 AM
To: 'WiX Toolset Users Mailing List'
Subject: Re: [wix-users] error LGHT0091: Duplicate symbol

Hello Farrukh,



Thanks for letting me know the attached was not included.    The WIX markup
is included below.   The error is generated for duplicate source code
filenames, even though the directory paths are different.





<?xml version="1.0" encoding="UTF-8"?>

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">

                <Product Id="*"


Version="1.0.0.0"


Name="WixInstaller"


Language="1033"


Manufacturer="My Company Name"


UpgradeCode="{288B0815-CABF-40E4-9DBB-08DEAFB2D36D}">



                                <Package InstallerVersion="301"


Compressed="yes"


InstallScope="perMachine"


InstallPrivileges="elevated"


Description="Installs the [ProductName] program"


Manufacturer="My Company Name"


Comments="My comment"/>





                                <Condition Message="This application is only
supported on Windows Vista or higher.">

                                                <![CDATA[Installed OR
(VersionNT >= 601)]]>

                                </Condition>



                                <MediaTemplate EmbedCab="yes" />

                                <MajorUpgrade DowngradeErrorMessage="A newer
version of [ProductName] is already installed." />



                                <Directory Id="TARGETDIR" Name="SourceDir">

                                                <Directory
Id="ProgramFilesFolder">

                                                                <Directory
Id="MyCompanyNameDirectoryId" Name="MyCompanyName" >


<Directory Id="MyProjADirectoryId"  Name="ProjA"/>


<Directory Id="MyProjBDirectoryId"  Name="ProjB"/>

                                                                </Directory>

                                                </Directory>

                                </Directory>



                                <!--

                                                Project A files

                                -->

                                <ComponentGroup Id="ProjAComponentGroupId"
Directory="MyProjADirectoryId">



                                                <Component
Id="ProjAComponentId_File01" Guid="{BAB628EF-196D-4944-9140-4C4EE206C139}">

                                                                <File
Source="$(var.ProjA.ProjectDir)main.cpp" Name="main.cpp" />

                                                </Component>



                                                <Component
Id="ProjAComponentId_File02" Guid="{AB59F389-1177-43AE-955F-C5DF538AD3AC}">

                                                                <File
Source="$(var.ProjA.ProjectDir)main.h" Name="main.h" />

                                                </Component>



                                                <Component
Id="ProjAComponentId_File03" Guid="{3CB35750-A5DD-4373-9656-37A7651B962E}">

                                                                <File
Source="$(var.ProjA.ProjectDir)Resource.h" />

                                                </Component>



                                                <Component
Id="ProjAComponentId_File04" Guid="{D3A11428-2B04-4F0C-B68D-B4E8E086A930}">

                                                                <File
Source="$(var.ProjA.ProjectDir)stdafx.cpp" />

                                                </Component>



                                                <Component
Id="ProjAComponentId_File05" Guid="{DDB7DE16-70BA-4FE0-8F5A-9071291917E3}">

                                                                <File
Source="$(var.ProjA.ProjectDir)stdafx.h" />

                                                </Component>

                                </ComponentGroup>



                                <!--

                                                Project B files

                                -->

                                <ComponentGroup Id="ProjBComponentGroupId"
Directory="MyProjBDirectoryId">



                                                <Component
Id="ProjBComponentId_File01" Guid="{293D2C62-4A6A-496C-9C82-63BBE934343F}">

                                                                <File
Source="$(var.ProjB.ProjectDir)main.cpp" Name="main.cpp"/>

                                                </Component>



                                                <Component
Id="ProjBComponentId_File02" Guid="{ED878B60-EB95-4D62-AAB2-3BDDC641D43B}">

                                                                <File
Source="$(var.ProjB.ProjectDir)main.h" Name="main.h"/>

                                                </Component>



                                                <Component
Id="ProjBComponentId_File03" Guid="{015D7916-53C3-4BE9-86F6-6617F77E1E49}">

                                                                <File
Source="$(var.ProjB.ProjectDir)Resource.h" />

                                                </Component>



                                                <Component
Id="ProjBComponentId_File04" Guid="{3526D1CC-FDF2-46A7-9F67-EE12BAA2657A}">

                                                                <File
Source="$(var.ProjB.ProjectDir)stdafx.cpp" />

                                                </Component>



                                                <Component
Id="ProjBComponentId_File05" Guid="{44BFC964-9806-450B-83DB-C2153C3E69B6}">

                                                                <File
Source="$(var.ProjB.ProjectDir)stdafx.h" />

                                                </Component>

                                </ComponentGroup>



                                <Feature Id="ProductFeatureId" Title="My
Feature Title">

                                                <ComponentGroupRef
Id="ProjAComponentGroupId"/>

                                                <ComponentGroupRef
Id="ProjBComponentGroupId"/>

                                </Feature>

                </Product>

</Wix>



From: Farrukh Waheed [mailto:farrukh1 at gmail.com]
Sent: April 25, 2016 01:33
To: ib at ianbellsoftware.com; WiX Toolset Users Mailing List
Subject: Re: [wix-users] error LGHT0091: Duplicate symbol



I didn't find the zip file. However from log, it seems that you have added
some files more than one times using same Component IDs (or may be File
Ids). For example, main.cpp's Component at line 41 is also present at line
61. Please check Component definition where it says "Location of symbol
related to previous error.".

Can you please share only Product.wxs?



On 25 April 2016 at 09:50, Ian Bell <ib at ianbellsoftware.com> wrote:

I have not been able to resolve a "error LGHT0091: Duplicate symbol" error
message that has been plaguing me for 2 days and I am hoping to find some
help here.



The attached ZIP file contains a small Visual Studio 2010 solution which can
be used to replicate the problem.   The sample VS2010 solution includes two
C++ projects and a WIX installer.    The two C++ projects contain
identically named source files (e.g. main.cpp, main.h, stdafx.cpp,
stdafx.h).   Attempting to build a WIX project with non-unique source code
filenames (i.e. their filepaths differ but the filenames are the same)
generates error messages similar to 'error LGHT0091: Duplicate symbol
found'.   The complete error message generated for the sample solution is
included at the end of this email message.   Google lists only handful of
posts which cite the LGHT0091 and LGHT0092 error numbers and these refer to
GUI related problems - something my WIX installer avoids.



One solution is to provide unique source code filenames between projects -
but this is a very impractical, particularly for files with common Visual
Studio generated filenames names such as 'stdafx.cpp', 'stdafx.h',
'resource.h', etc.



So my question is has anyone encountered the problem before and found a
solution?   I would appreciate any suggestions you might have.



ThanX



Ian



















1>------ Build started: Project: WixInstaller, Configuration: Debug x86
------

1>            C:\Program Files (x86)\WiX Toolset v3.10\bin\candle.exe
-dDebug -d"DevEnvDir=C:\Program Files (x86)\Microsoft Visual Studio
10.0\Common7\IDE\\" -d"SolutionDir=e:\Users\admin\Documents\Visual Studio
2010\Projects\testWixError\\" -dSolutionExt=.sln
-dSolutionFileName=testWixError.sln -dSolutionName=testWixError
-d"SolutionPath=e:\Users\admin\Documents\Visual Studio
2010\Projects\testWixError\testWixError.sln" -dConfiguration=Debug
-dOutDir=bin\Debug\ -dPlatform=x86
-d"ProjectDir=e:\Users\admin\Documents\Visual Studio
2010\Projects\testWixError\WixInstaller\\" -dProjectExt=.wixproj
-dProjectFileName=WixInstaller.wixproj -dProjectName=WixInstaller
-d"ProjectPath=e:\Users\admin\Documents\Visual Studio
2010\Projects\testWixError\WixInstaller\WixInstaller.wixproj"
-d"TargetDir=e:\Users\admin\Documents\Visual Studio
2010\Projects\testWixError\WixInstaller\bin\Debug\\" -dTargetExt=.msi
-dTargetFileName=WixInstaller.msi -dTargetName=WixInstaller
-d"TargetPath=e:\Users\admin\Documents\Visual Studio
2010\Projects\testWixError\WixInstaller\bin\Debug\WixInstaller.msi"
-dProjA.Configuration=Debug -d"ProjA.FullConfiguration=Debug|Win32"
-dProjA.Platform=Win32 -d"ProjA.ProjectDir=e:\Users\admin\Documents\Visual
Studio 2010\Projects\testWixError\ProjA\\" -dProjA.ProjectExt=.vcxproj
-dProjA.ProjectFileName=ProjA.vcxproj -dProjA.ProjectName=ProjA
-d"ProjA.ProjectPath=e:\Users\admin\Documents\Visual Studio
2010\Projects\testWixError\ProjA\ProjA.vcxproj"
-d"ProjA.TargetDir=e:\Users\admin\Documents\Visual Studio
2010\Projects\testWixError\Debug\\" -dProjA.TargetExt=.exe
-dProjA.TargetFileName=ProjA.exe -dProjA.TargetName=ProjA
-d"ProjA.TargetPath=e:\Users\admin\Documents\Visual Studio
2010\Projects\testWixError\Debug\ProjA.exe" -dProjB.Configuration=Debug
-d"ProjB.FullConfiguration=Debug|Win32" -dProjB.Platform=Win32
-d"ProjB.ProjectDir=e:\Users\admin\Documents\Visual Studio
2010\Projects\testWixError\ProjB\\" -dProjB.ProjectExt=.vcxproj
-dProjB.ProjectFileName=ProjB.vcxproj -dProjB.ProjectName=ProjB
-d"ProjB.ProjectPath=e:\Users\admin\Documents\Visual Studio
2010\Projects\testWixError\ProjB\ProjB.vcxproj"
-d"ProjB.TargetDir=e:\Users\admin\Documents\Visual Studio
2010\Projects\testWixError\Debug\\" -dProjB.TargetExt=.exe
-dProjB.TargetFileName=ProjB.exe -dProjB.TargetName=ProjB
-d"ProjB.TargetPath=e:\Users\admin\Documents\Visual Studio
2010\Projects\testWixError\Debug\ProjB.exe" -out obj\Debug\ -arch x86
Product.wxs

1>            C:\Program Files (x86)\WiX Toolset v3.10\bin\Light.exe
1> -out
"e:\Users\admin\Documents\Visual Studio
2010\Projects\testWixError\WixInstaller\bin\Debug\WixInstaller.msi" -pdbout
"e:\Users\admin\Documents\Visual Studio
2010\Projects\testWixError\WixInstaller\bin\Debug\WixInstaller.wixpdb"
-cultures:null -contentsfile
obj\Debug\WixInstaller.wixproj.BindContentsFileListnull.txt -outputsfile
obj\Debug\WixInstaller.wixproj.BindOutputsFileListnull.txt -builtoutputsfile
obj\Debug\WixInstaller.wixproj.BindBuiltOutputsFileListnull.txt
-wixprojectfile "e:\Users\admin\Documents\Visual Studio
2010\Projects\testWixError\WixInstaller\WixInstaller.wixproj"
obj\Debug\Product.wixobj

1>e:\Users\admin\Documents\Visual Studio
2010\Projects\testWixError\WixInstaller\Product.wxs(41,0): error LGHT0091:
Duplicate symbol 'File:main.cpp' 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.

1>e:\Users\admin\Documents\Visual Studio
2010\Projects\testWixError\WixInstaller\Product.wxs(67,0): error LGHT0092:
Location of symbol related to previous error.

1>e:\Users\admin\Documents\Visual Studio
2010\Projects\testWixError\WixInstaller\Product.wxs(45,0): error LGHT0091:
Duplicate symbol 'File:main.h' 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.

1>e:\Users\admin\Documents\Visual Studio
2010\Projects\testWixError\WixInstaller\Product.wxs(71,0): error LGHT0092:
Location of symbol related to previous error.

1>e:\Users\admin\Documents\Visual Studio
2010\Projects\testWixError\WixInstaller\Product.wxs(49,0): error LGHT0091:
Duplicate symbol 'File:Resource.h' 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.

1>e:\Users\admin\Documents\Visual Studio
2010\Projects\testWixError\WixInstaller\Product.wxs(75,0): error LGHT0092:
Location of symbol related to previous error.

1>e:\Users\admin\Documents\Visual Studio
2010\Projects\testWixError\WixInstaller\Product.wxs(53,0): error LGHT0091:
Duplicate symbol 'File:stdafx.cpp' 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.

1>e:\Users\admin\Documents\Visual Studio
2010\Projects\testWixError\WixInstaller\Product.wxs(79,0): error LGHT0092:
Location of symbol related to previous error.

1>e:\Users\admin\Documents\Visual Studio
2010\Projects\testWixError\WixInstaller\Product.wxs(57,0): error LGHT0091:
Duplicate symbol 'File:stdafx.h' 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.

1>e:\Users\admin\Documents\Visual Studio
2010\Projects\testWixError\WixInstaller\Product.wxs(83,0): error LGHT0092:
Location of symbol related to previous error.

1>Done building project "WixInstaller.wixproj" -- FAILED.

1>

========== Build: 0 succeeded, 1 failed, 2 up-to-date, 0 skipped ==========






____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant
http://www.firegiant.com/




____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant
http://www.firegiant.com/


____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/



More information about the wix-users mailing list