Ala*_*ark 3 components wix path heat
我已经使用Heat工具根据我想要安装其内容的文件夹生成wxs文件.这给了我一个像这样的大文件:
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="TARGETDIR">
<Directory Id="dir1FC8A0605F7DF8B33E3EECB0A1270FA2" Name="DirectoryName" />
</DirectoryRef>
</Fragment>
<Fragment>
<ComponentGroup Id="ComponentGroupId">
<Component Id="cmp1FB67A60B41F3170889B7E5739A23560" Directory="dir1FC8A0605F7DF8B33E3EECB0A1270FA2" Guid="{2DC3B790-D29C-4090-B4CF-5C27687C6ABE}">
<File Id="filF1E1262E52254B1846C7CB2393126A6F" KeyPath="yes" Source="PathToFile" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
Run Code Online (Sandbox Code Playgroud)
在我的主要Wix文件Product.wxs中,我有一个引用Heat创建的上述ComponentGroup的功能.该功能看起来像这样:
<Feature Id="FeatureId" Title="FeatureTitle" Level="1" AllowAdvertise="no" Absent="disallow" Description="Feature description.">
<ComponentGroupRef Id="ComponentGroupId" />
</Feature>
Run Code Online (Sandbox Code Playgroud)
这是工作,但是当我运行安装程序,组件组内的文件放在C盘的根目录(即C:\目录名),但我想他们进入程序文件(如C:\ Program Files文件\目录名).
有任何想法吗?
谢谢,艾伦
你可以通过-dr像这样的参数传递你想要引用的目录的Id
heat -dr AutogeneratedComponentsDir
Run Code Online (Sandbox Code Playgroud)
如果您在msbuild中使用HeatDirectory任务,请使用DirectoryRefId属性.
然后,只需在主Product.wxs中定义该目录的位置即可.
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLDIR" Name="YourProduct">
<Directory Id="AutogeneratedComponentsDir"/>
</Directory>
</Directory>
</Directory>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3892 次 |
| 最近记录: |