使用wix复制目录结构
所以我有一个巨大的文件结构,我想要使用 wix 构建的安装程序将其复制到客户端位置。目前我正在输入这样的内容:
<Directory Id="xyz" Name = "abc FileSource = "sdfsdf">
<Component Id="asdas" Guid="asdasd">
<File Id = "asdfgrs" Name="name" />
</Component>
</Directory>
随着文件数量的增加,我希望以自动方式完成此操作。使用热量我能够生成:
<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>
我担心的是,由于热量生成的组件的目录字段中存在一些随机字符串,我不会复制目录结构。这是真的吗?有办法解决这个问题吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从
heat /?
输出中:如果您使用 heat 递归地获取目录结构,则
-dr
开关将设置根目标文件夹的 ID。此 ID 应与您在 wxs 文件中其他位置指定的Directory
元素的 ID 匹配。对于收获的子文件夹,热仍然会生成一个随机ID。给定 ID 将在生成的 XML 文件中多次出现:
在 heat 为该子文件夹生成的
Directory
元素中,作为Id
属性。在与该文件夹关联的
Component
元素中,作为Directory
属性。ID 仅用于将
Component
元素链接到Directory
元素。 它不是安装后显示的文件夹名称。它仅用作 Windows Installer 数据库中的密钥。From the
heat /?
output: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 aDirectory
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:
In the
Directory
element generated by heat for that subfolder, as theId
attribute.In the
Component
elements associated with that folder, As theDirectory
attribute.The ID is only used to link
Component
elements toDirectory
elements. It is not the folder name as it appears after installation. It is only used as a key in the Windows Installer database.