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

北城以北 提交于 2019-12-29 08:02:14

问题


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="yes" KeyPath="no"/>

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


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/5343908/how-to-reference-gacd-dll-files-in-wix-setup-project

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