开发者

How to deploy native images (NGen) using Wix and project references

I'm using Wix/Votive to build an installer for my .NET Solution. I include the binaries from the other projects (EXE and DLLs) using project references (which internally uses heat.exe I think).

What I want to do now is, to pre-jit all assemblies with ngen.exe during installation. According to the Wix help, this can be done thru the WiX .NET extensions library:

<Component Id="App.exe" Guid="PUT-GUID-HERE">
   开发者_运维百科 <File Id="App.exe" Source="App.exe" KeyPath="yes">
        <netfx:NativeImage Id="ngen_App.exe" Platform="32bit" Priority="0" />
    </File>
</Component>

Now the problem is, that the <File /> tags are created by heat.exe and I can't figure out how to either advise heat.exe to generate the <NativeImage /> tag inside or how to reference the generated <File /> tag and attach the <NativeImage /> tag externally.

Right now, the only way I see is not to use project references, but obviously I would like to keep them.

Any suggestions? Thanks!


Heat isn't intended for and doesn't support this story. Most people use Heat one time to do most of the heavy lifting of creating the WXS and then maintain it as code from there. Some people like to put this into build processes to become dynamic but I'm really against that for reasons that can be found else where if you are interested.

So either do it like that or write some automation to run after heat that uses LINQ to XML ( or your favorite XML DOM ) to look for File elements that are .NET assemblies and then mark them up with child NativeImage elements. You'll also have to put the namespace declaration at the top of the document.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜