Question

We need to automatically fill up the files-section within a component. So we want to use a tool which generates a file section like this (here an include file)

<include>
<File id=1" src="whatever" />
<File id=2" src="whatever2" />
<File id=3" src="whatever3" />
</include>

In the wxs, we want to have something like

<component id="xxx" guid="myStaticGuid" permanent=yes">
<include file above>
</component>

In this scenario we would always have the same component with the same guid, but just some additional files which is valid following the rules defined by the windows installer.

In my tests, heat always generates a new component with a new guid and the flag permanent is always missing, so I created a powershell-script to generate the file-snippet. But this looks quite ugly to me.

Does heat provide the possibility to achive my goal or how to update just the files within an existing component?

Was it helpful?

Solution

You can use the auto-generate guids flag on heat (-ag), which essentially sets it to '*'. This is then expanded at compile time based on the keypath in the component (in your case, the file). If the file never changes, the compiler generates the exact same GUID every time.

I don't know a way of setting the permanent flag through heat off the top of my head, but you could certainly do it with an XSL transform which you could pass in to Heat.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top