3

我正在使用 Wix/Votive 为我的 .NET 解决方案构建安装程序。我使用项目引用(heat.exe我认为在内部使用)包含来自其他项目(EXE 和 DLL)的二进制文件。

我现在要做的是,ngen.exe在安装过程中预jit所有程序集。根据 Wix 帮助,这可以通过WiX .NET 扩展库来完成:

<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>

现在的问题是,<File />标签是由创建的heat.exe,我不知道如何建议在内部heat.exe生成<NativeImage />标签或如何引用生成的标签并在外部<File />附加标签。<NativeImage />

现在,我看到的唯一方法是不使用项目引用,但显然我想保留它们。

有什么建议么?谢谢!

4

1 回答 1

3

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.

于 2011-01-13T13:55:54.977 回答