开发者

How to reference GAC'd dll files in Wix setup project?

开发者 https://www.devze.com 2023-02-18 15:23 出处:网络
We have several 3rd party controls which are GAC\'d on the development machines.These are referenced in the Visual Studio projects.When we were using VS setup projects, it knew how to find the referen

We have several 3rd party controls which are GAC'd on the development machines. These are referenced in the Visual Studio projects. When we were using VS setup projects, it knew how to find the referenced files and include them in the MSI. However, I can't figure out how to include the referenced DLL files from the GAc in our new WIX setup. What do I put as the Source?

<File Id="MyFile" Name="MyFile" Source="WHAT TO PUT HERE?" DiskId="1" Vital="ye开发者_开发百科s" KeyPath="no"/>

Also a bonus question: how to harvest these automatically with heat or by other means?


Short answer to both: You can't and you shouldn't anyway. You should check your tools into your source-control system and load it into your installers from a checkout. That way you have control over the versions you're distributing instead of picking up arbitrary versions from the GAC.

Note: DiskId and Vital both default to the values you give, so you can save some typing by just omitting them.


Unfortunately, there is a known bug in Heat which prevents it from copying referenced assemblies when harvesting a project.

That issue aside, and taking into account @Bob Arnson's answer on this question, you could set the CopyLocal attribute on the referenced assemblies so that they are copied from the GAC into the project output directory at build time. Then you can use Heat's directory harvesting (as opposed to the buggy project harvesting) to include them in the build.

0

精彩评论

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