(WiX) - 使用预构建事件自动生成GUID(heat.exe)

时间:2022-08-05 23:07:31

i've made a pre-build event for my directorys/files. now its creating the source.wxs fine, but there are only 'GUID="*"', so now i get compiler error because it is not mapped on ProgrammFilesFolder, but every component needs an unique GUID:

我为我的directorys /文件做了一个预构建活动。现在它创建source.wxs很好,但只有'GUID =“*”',所以现在我得到编译器错误,因为它没有映射到ProgrammFilesFolder,但每个组件都需要一个唯一的GUID:

Path" %SystemDrive%\st /MIR
"%WIX%\bin\heat.exe" dir %SystemDrive%\st -dr INSTALLDIRECTORYFOLDER -cg    SourceComponentGroup -var var.SourcePath -ag -out "$(SolutionDir).\Setup\source.wxs"

result:

<Component Id="cmp97CD2699CFD0E466AE00E9EE0BC75B3D" Directory="dirE9158D60656EC6CD461378A2C8EDC064" Guid="*">
     <File Id="filD6533D5A559BC86E4704F435FEEE2A5A" KeyPath="yes" Source="$(var.SourcePath)\test1.txt" />
</Component>

Are there any parameters i can change to get the desired effect? i couldnt find any documentation about the parameters.

是否有任何参数我可以改变以获得所需的效果?我找不到有关参数的任何文档。

1 个解决方案

#1


5  

Without knowing the exact compiler error I can't say whether this will fix it, but to get heat to generate the guids for you, you need is the -gg switch rather than -ag. FYI the commandline options can be found here.

在不知道确切的编译器错误的情况下,我不能说这是否会解决它,但是为了获得热量来为你生成guid,你需要的是-gg开关而不是-ag。仅供参考,可在此处找到命令行选项。

#1


5  

Without knowing the exact compiler error I can't say whether this will fix it, but to get heat to generate the guids for you, you need is the -gg switch rather than -ag. FYI the commandline options can be found here.

在不知道确切的编译器错误的情况下,我不能说这是否会解决它,但是为了获得热量来为你生成guid,你需要的是-gg开关而不是-ag。仅供参考,可在此处找到命令行选项。