How to include the output of heat in a wix file? (No Visual Studio project)

陌路散爱 提交于 2019-12-12 18:05:44

问题


I need to build an installer and, for a variety of reasons, I would like to avoid using the WiX project template. I'm perfectly happy to script this stuff myself and already have a custom build process for this to fit into.

I believe I understand the role of WiX candle, heat, and light tools fine, I'm getting familiar with the wxs file format, and I can run heat to produce the file fragment outputs that I want. I have no idea however how to incorporate that into my wxs file. Presumably at some point I would have a reference in the wxs to the file fragment file...but I can't quite figure out what the right syntax is here.


回答1:


In your wxs file where you describe the target directory structure, add a directory node under TARGETDIR, like this:

<Directory Id="TARGETDIR" Name="SourceDir">
    <Directory Id="DYNAMIC" Name="Dynamic">

In your wxs file where you list referenced components for your features, add a component group reference:

<Feature Id="MyFeature">
    <ComponentGroupRef Id="MyComponentGroup"/>

Call heat like this (add more parameters to your fancy):

"C:\WIX\bin\heat.exe" dir "C:\SourceDir" -cg MyComponentGroup -ke -srd -dr DYNAMIC -sfrag -o "C:\MyProject\Dynamic.wxs"

Add this Dynamic.wxs to your Candle call. Add its result (wixobj) to your Light call.



来源:https://stackoverflow.com/questions/38795093/how-to-include-the-output-of-heat-in-a-wix-file-no-visual-studio-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!