12
votes

I'm using latest votive (Wix v3.5) and created a simple Wix VS 2010 setup project. I added my website reference and set the Harvest option as true.

Now since my INSTALLDIR points to a folder under IISROOT, I get this light.exe error:

[filepath]: error LGHT0231: The component 'cmp93982C4086FF8C75F07339DD7CEA8152' has a key file with path 'TARGETDIR\webdir...[filename].xml'. Since this path is not rooted in one of the standard directories (like ProgramFilesFolder), this component does not fit the criteria for having an automatically generated guid. (This error may also occur if a path contains a likely standard directory such as nesting a directory with name "Common Files" under ProgramFilesFolder.)

While I understand the reason behind this error, I don't necessarily agree to its rational (maybe I don't understand the innate workings of Wix MSI generation).

How can I resolve this error?


To provide some context:

I'm trying to set this up in conjunction with Team Build. I can use the legacy format and run Heat/Harvest task against a folder to bypass this issue but do not want to go the legacy route.

I have not played enough with the new workflow based build definition, so not sure how I can incorporate this custom task.

I need to run harvest every time the Setup project is built because I do not want to keep track of hundreds of files manually.

1
I have the same issue; I'm trying to set C:\Inetpub\wwwroot\MyProject\ as the default installation location, but WiX won't hear of it.David Keaveny
Have you found some workaround? ThanksSanja Melnichuk
@SanjaMelnichuk: Unfortunately not. I haven't invested more time there too as I moved to other projects but I guess what I'm trying to do there would require some XAML knowledge and familiarity with TFS workflows.Mrchief
@Mrchief Finally i found workaround solution. Thanks for responseSanja Melnichuk
In case any one met with the same problem, Directory/@ComponentGuidGenerationSeed property can be used to solve it. You could find its document here wix.sourceforge.net/manual-wix3/wix_xsd_directory.htm. BTW, I am using Wix v3.6, and I am not sure whether it works with older versions.wenqiang

1 Answers

11
votes

The problem is because the component is rooted in TARGETDIR, which WiX cannot use for automatically generating a guid. You can add Directory/@ComponentGuidGenerationSeed to a directory above this component to avoid the problem. By adding this attribute, you must now take responsibility for ensuring the component doesn't get installed to two different directories across upgrades.

In Windows Installer, components need to have a guid that doesn't change between patches, minor upgrades, and major upgrades. As a convenience, WiX can generate a version 5 UUID for you using the component's directory hierarchy as the seed. But, TARGETDIR is ineligible for this.

I believe the reason is that TARGETDIR changes across installations (it's set to the drive that has the most free space). One of the component rules is "each component must be stored in a single folder". If TARGETDIR changed between major upgrades, then you could end up trying to install the same component to a second folder.