简体   繁体   English

如何在Visual Studio安装程序项目中包括NuGet程序包

[英]How to include a NuGet package in Visual Studio Installer Project

I'm developing an Installer project that wraps third-party executable file to customise installation according to requirements. 我正在开发一个Installer项目,该项目包装了第三方可执行文件以根据要求自定义安装。

I want to include executable file in a civilised manner. 我想以文明的方式包括可执行文件。 We have a local NuGet repository, and using it as a source for executable file seemed like a good idea. 我们有一个本地的NuGet存储库,将其用作可执行文件的源似乎是个好主意。 But it turns out that Visual Studio Installer Setup Project does not support NuGet. 但是事实证明,Visual Studio安装程序安装项目不支持NuGet。

Adding the executable to our GIT repository is something I would like to avoid. 我想避免将可执行文件添加到我们的GIT存储库中。

I tried to install the NuGet package using commandline NuGet interface in a PreBuildEvent but pre-build validation failed due to missing files. 我尝试在PreBuildEvent中使用命令行NuGet界面安装NuGet软件包,但由于缺少文件,因此预生成验证失败。

Is there a straightforward way to include an executable file in Installer project? 有没有一种简单的方法可以在Installer项目中包含可执行文件?

You don't. 你不知道

Make a normal target that depends on the nuget package. 制定一个依赖于nuget包的普通目标。 This should cause the contents of the package to end up in the build output. 这应该导致包的内容最终出现在build输出中。

Target the build output of that project with the installer project. 使用安装程序项目来定位该项目的构建输出。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM