Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copying directory structure using wix

So I have a huge file structure which I want the installer, I am building using wix, to copy on the client location. Currently I am typing it out like:

<Directory Id="xyz" Name = "abc FileSource = "sdfsdf">
    <Component Id="asdas" Guid="asdasd">
        <File Id = "asdfgrs" Name="name" />
    </Component>
</Directory>

As the number of files have increased I would like this to be done in an automated way. Using heat I am able to generate:

<ComponentGroup Id="weqw">
   <Component Id="2132312" Directory="Some random string (cause of concern>" Guid="asdasd">
        <File Id="sdqwdqwd> keyPath="yes" Source = "Correct source path" />
    </Component>
<ComponentGroup>

My concern is that due to the presence of some random string in Directory field of Component generated by heat, I wont get the directory structure replicated. Is this true? Is there a way around this?

like image 608
Kartik Rustagi Avatar asked Jan 26 '26 06:01

Kartik Rustagi


1 Answers

From the heat /? output:

-dr      directory reference to root directories (cannot contains spaces 
         e.g. -dr MyAppDirRef)

If you use heat to recursively harvest a directory structure, then the -dr switch will set the ID of the root target folder. This ID should match the ID of a Directory element you have specified elsewhere in your wxs files.

For the harvested subfolders, heat will still generate a random ID. A given ID will appear multiple times in the generated XML file:

  1. In the Directory element generated by heat for that subfolder, as the Id attribute.

  2. In the Component elements associated with that folder, As the Directory attribute.

The ID is only used to link Component elements to Directory elements. It is not the folder name as it appears after installation. It is only used as a key in the Windows Installer database.

like image 99
Wim Coenen Avatar answered Jan 28 '26 22:01

Wim Coenen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!