如何在安装项目结束时运行可执行文件? [英] How to run executable at end of Setup Project?

查看:77
本文介绍了如何在安装项目结束时运行可执行文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Visual Studio安装项目,可用来安装一个相当简单的WinForms应用程序.在安装结束时,我有一个自定义用户界面页面,其中显示一个复选框,询问用户是否要运行该应用程序.我已经看到其他安装程序经常这样做.但是我无法找到一种方法来使安装项目在安装完成后运行可执行文件.有想法吗?

注意:您不能使用自定义操作",因为它们被用作安装过程的一部分,一旦用户在安装结束时按下关闭"按钮,我想运行已安装的应用程序.

我相信这是Visual Studio安装项目的真正限制之一.您需要能够修改安装UI的最后一页,但是VS.NET却没有提供执行此操作的方法.您可以在.MSI构建完成后修改表,但VS.NET每次构建时都可能会覆盖这些更改.您可以使用安装项目中包含的合并模块覆盖最后一页.无论哪种方式,您都需要熟悉如何在.MSI中编写UI对话框,但这并不简单.

您可能要考虑切换到基于脚本的免费安装程序,或购买商业安装创作应用程序(只是不要为喜欢Pete而购买InstallShield).看一下InstallAware(尽管我没有使用过).

I have a Visual Studio Setup Project that I use to install a fairly simple WinForms application. At the end of the install I have a custom user interface page that shows a single check box which asks the user if they want to run the application. I've seen other installers do this quite often. But I cannot find a way to get the Setup Project to run an executable after the install finishes. An ideas?

NOTE: You cannot use Custom Actions because these are used as part of the install process, I want to run my installed application once the user presses the 'Close' button at the end of the install.

解决方案

I believe this is one of the real limitations of the Visual Studio installation project. You need to be able to modify the last page of the installation UI but VS.NET does not give you a way to do this. You could modify the tables in the .MSI after it has been built but VS.NET would probably overwrite these changes each time it is built. You may be able to override the last page using a merge module that you include in the installation project. Either way you will need to become familiar with how the UI dialogs are authored in an .MSI and this is not trivial.

You may want to consider switching to a free script based installer or buy a commercial setup authoring application (just don't buy InstallShield for the love of Pete). Take a look at InstallAware (although I have not used it).

这篇关于如何在安装项目结束时运行可执行文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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