How to create a consistent GUID using the wix harvest utility

I'm new to using WiX, so this is my dumb question. I am trying to keep the GUID generated by the harvesting tool (heat.exe) consistent for the files I am packing. Everyone seems to say that as long as the path to the file and the additional path remain the same as the heat.exe file will generate the same GUID for the file. Unfortunately, I do not see such behavior. My workflow is as follows.

Copy all supplied files to the staging directory during my build process. Then run the heat.exe file in the intermediate directory to generate the component wxs fragment file. Before copying the file to the staging directory, I delete all the old files.

I want to add the generated wxs file to my original control in order to achieve minor updates. If my understanding is right for me to achieve this, I need to have a consistent GUID in my assemblies so that I can track them.

The command line that I use to create the wxs file is as follows: -

c:\foobar\build\>C:\win32\wix-3.7.1224.0\heat.exe dir . -cg MyCG -dr INSTALLDIR -g1 -gg -nologo -sreg -suid -t C:\foobar\src\support\packaging\wix\foo.xslt -var var.foobarSource -out c:\foobar\src\support\packaging\wix\foo.wxs 

What I see is that the generated GUID is different during each run. Was there a way to keep a constant GUID.

+7
guid wix
source share
1 answer

You must specify the -ag flag.

 -ag Auto generate component guids at compile time, eg set Guid="*". 

As long as your file paths are the same, the generated GUID will be the same for the files.

+8
source share

All Articles