开发者

Copying directory structure using wix

开发者 https://www.devze.com 2023-03-07 19:14 出处:网络
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:

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 = "a开发者_运维知识库bc 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号