Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Harvesting files leads to LGHT0231 error

Tags:

wix

wix3.5

votive

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.

like image 324
Mrchief Avatar asked Sep 07 '11 04:09

Mrchief


1 Answers

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.

like image 62
Stephen Jennings Avatar answered Sep 23 '22 01:09

Stephen Jennings