如何在 Visual Studio 2010 Click Once 发布中添加 netsh advfirewall 上下文命令?
我有一个 .Net 4.0 Windows 应用程序,需要通过防火墙进行访问。我知道 netsh advfirewall 防火墙命令,但我非常希望在安装时允许该程序(单击一次部署)。
如何添加此命令作为安装后命令执行,以管理员身份执行 - 即执行安装的人不必单独执行 netsh advfirewall 命令,也不必转到防火墙并手动将程序添加到允许列表。
我在 Visual Studio 2010 的“发布”中找不到插入安装后命令行执行的区域。
I have a .Net 4.0 Windows application which requires access thru the firewall. I know about the netsh advfirewall firewall command, but I would like very much to have this program allowed at install time (the Click Once deployment).
How can I add this command to execute as a post install command, exectuing as Administrator - i.e. The person doing the install does not have to execute the netsh advfirewall command separately or does not have to go to the Firewall and manually add the program in the Allowed list.
I cannot find an area in Publish in Visual Studio 2010 to insert a post install command line execution.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您无法使用安装后命令。如果您想执行命令,则需要在应用程序启动后从应用程序执行该命令...
您无法强制它以管理员身份运行。它将以与用户拥有的相同权限运行。
You can't have a post-install command. If you want to execute a command you'll need to do it from your application after it starts...
There's no way you can force this to run as an Admin. It will run with the same privileges the user has.