I am curious to know how WiX keeps track of GUIDSs automatically generated
for files when we use HeatDirectory.

For example, I have a project with the following in my .wixproj file...

<Target Name="BeforeBuild">
    <PropertyGroup>
      <WixToolPath>C:\SourceControl\WiX39\</WixToolPath>
    </PropertyGroup>
    <HeatDirectory ToolPath="$(WixToolPath)"
                           Directory="C:\users\me\Desktop\SourceFiles

                           ComponentGroupName="MyComponentGroup"
                           DirectoryRefId="INSTALLFOLDER"
                           AutogenerateGuids="true"
                           GenerateGuidsNow="false"
                           SuppressFragments="true"
                           SuppressRootDirectory="true"
                           PreprocessorVariable="var.SourceFilesDir"
                           OutputFile="Components.wxs" />
  </Target>

If I set AutogenerateGuids="true", my output file contains components like
this:

<Component Id="cmpA609F30B9E3AECCDEE4D779C8B7308ED" Guid="*">
                <File Id="fil314398091041DF4762128892E7C98AA7"
KeyPath="yes" Source="$(var.SourceFilesDir)\Sample1.txt" />
            </Component>

I note that Component/@Guid="*".

After generating the .MSI, I open it with Orca and see that the ComponentId
for each Component (for each file) is the same.

If I change my HeatDirectory element so that AutogenerateGuids="false" and
GenerateGuidsNow="true", the ComponentIds seem to change.

If I understand correctly, this is how it should work and by using
AutogenerateGuids, my installers can track a given file from install to
install.  I also think I understand that the GUIDs will remain the same so
long as the file names and paths to which they are installed doesn't
change, so this approach will let me do minor upgrades because the
installers can tell that two versions of a file from two different
installers are the same component because the ComponentIDs match.

But what I'm wondering is:  How are these consistent GUIDs that I get when
I use AutogenerateGuids="true" remembered from build to build?  Are they
generated by some algorithm that will always produce the same GUID for a
file with a given name installed to a given directory, or are they stored
somewhere.  And if they are stored somewhere, where are they stored?

I'm hoping this isn't a dumb question, but I feel like I need to understand
this before using the feature so I don't make mistakes based on an
incomplete comprehension of what's happening behind-the-scenes.

Many thanks.
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to