使用MSBuild从命令行生成ClickOnce部署的setup.exe [英] Generate setup.exe for ClickOnce deployment from command line using MSBuild

查看:237
本文介绍了使用MSBuild从命令行生成ClickOnce部署的setup.exe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个MSBuild脚本,该脚本生成Windows窗体应用程序,生成应用程序清单并对其进行签名,然后生成部署清单.该脚本还会为我生成publish.htm文件.

I have a MSBuild script that builds my windows forms application, generates the application manifest and signs it, then generates the deployment manifest. The script also generates the publish.htm file for me.

现在,我需要生成setup.exe文件,到目前为止,我还无法弄清VS是如何生成它的.如何使用MSBuild脚本生成setup.exe文件?

Now I need to generate the setup.exe file and so far I have not been able to figure out how VS generates it. How can I generate the setup.exe file using a MSBuild script?

预先感谢您的帮助!

推荐答案

您可以使用内置的生成Bootstrapper MSBuild任务

You can use the built-in GenerateBootstrapper MSBuild task

当您从Visual Studio中进行发布时,这也是ClickOnce所使用的.

When you do a Publish from Visual Studio, this is also what ClickOnce uses.

查看C:\ Windows \ Microsoft.NET \ Framework \\ Microsoft.Common.Targets,以了解发生了什么.

Check out C:\Windows\Microsoft.NET\Framework\\Microsoft.Common.Targets to see exactly what happens.

查看_DeploymentGenerateBootstrapper目标.

Look at the _DeploymentGenerateBootstrapper target.

您的CSharp项目文件包含此目标用来确定的一些项目和属性:

Your CSharp project file contains some items and properties that this target uses to figure out:

  1. 如果要生成引导程序(BootstrapperEnabled属性)
  2. 为(BootstrapperPackage项目组)生成引导程序的软件包
  3. 将从(BootstrapperComponentsLocation属性)安装软件包的位置

希望这是有道理的.通过一些工作,您可以使用MSBuild文件来实现从Visual Studio发布时的确切操作.

Hopefully this makes sense. With a bit of work you can implement with your MSBuild file exactly what happens when you Publish from Visual Studio.

这篇关于使用MSBuild从命令行生成ClickOnce部署的setup.exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆