WiX:如何允许自动生成的ComponentGroup自动生成Guid [英] WiX: How to allow autogenerated ComponentGroup to autogenerate Guids

查看:116
本文介绍了WiX:如何允许自动生成的ComponentGroup自动生成Guid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用heat.exe生成了一个.wxs文件,该文件列出了我要安装的所有文件.我告诉Heat将它们放在ComponentGroup中,以便可以从另一个(手工生成的).wxs文件中引用它们.

I used heat.exe to generate a .wxs file that lists all the files that I want to install. I told heat to put them in a ComponentGroup so I could reference them from another (hand-generated) .wxs file.

但是,自动生成的文件规范如下:

However, the autogenerated file specifications look like this:

<Component Id="cmp10D34854E51FC71E0A65900015642460" Directory="dir82EF0D8D89A5B984406E0CCDF2A5E5BC" Guid="*">
    <File Id="fil65369E1F7C8702A7B78CF393C06A9C7B" KeyPath="yes" Source="SourceDir\CHANGELOG.md" />
</Component>

由于源代码以"SourceDir"开头,因此在light.exe中出现以下错误:

Since the source starts with "SourceDir", I get the following errors in light.exe:

: error LGHT0231 : The component 'cmp10D34854E51FC71E0A65900015642460' has a key file with path 'TARGETDIR\vwf-windows-build\CHANGELOG.md'.  Since this path is not rooted in one of the standard directories (like ProgramFilesFolder), this component does not fit the criteria for having an automatically generated guid.  (This error may also occur if a path contains a likely standard directory such as nesting a directory with name "Common Files" under ProgramFilesFolder.)

您知道我需要做什么才能使它正常工作吗?

Any idea what I need to do to get this working?

推荐答案

很有趣,今天我问类似的问题时,我没有找到您的问题(

Funny, that I didn't find your question when I asked a similar one today (Using heat.exe for files placed in WindowsVolume - GUID Issues).

您在组件的目录"属性中指定的文件夹在哪里?自动生成的GUID(加热的-ag开关)并非针对组件是随机的,而是取决于目标文件夹.该错误消息基本上告诉您将组件放入以标准目录为根的目录(例如[ProgramFilesFolder])或提供静态GUID.您可以通过在收获期间将开关-gg而不是-ag设置为后者:

Where's the folder located you specified in the Component's Directory attribute? Automatically generated GUIDs (heat's -ag switch) aren't random for a Component but depend on the target folder. The error message basically tells you to either put the Component into a directory that's rooted in a standard directory (such as [ProgramFilesFolder]) or provide a static GUID. You can achieve the latter one by setting the switch -gg instead of -ag during harvesting:

heat dir HeatDir -out harvested.wxs -var var.SourceDir -cg MyComponentGroup -dr MyInstallDir -g1 -ag -ke -srd -scom -sreg

但是请注意,现在生成的GUID是随机的.如果您使用热力以自动方式更新安装程序项目,则可能会导致升级安装过程中出现问题.

But be aware that the generated GUIDs are now random. If you use heat for updating the installer project in an automated fashion this may result in problems during upgrade installations.

希望有帮助.

这篇关于WiX:如何允许自动生成的ComponentGroup自动生成Guid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆