使用Installer Project安装后无法自动启动程序 [英] Cannot automatically start program after install with Installer Project

查看:130
本文介绍了使用Installer Project安装后无法自动启动程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要安装程序方面的帮助.我有我的安装程序项目(很明显)正在安装程序,我的老板希望我在安装完成后使其自动运行.我找不到任何方法可以做到这一点.有可能这样做吗?

I need help with an installer. I have my installer project installing my program (Obviously) and my boss wants me to make it auto run after the setup is finished. I cannot find any way to do this. Is it possible to do so?

推荐答案

是的,很容易自动启动安装程序并在安装结束时运行应用程序.

Yes, it's very easy to start your installer automatic and to run your app at the end of the instalation.

要开始设置,您需要在一张cd/dvd上设置自动运行.您只需要使用ini格式添加autorun.inf文本文件即可.下面是一个示例,假设您具有带有图标的setup.exe.

To start the setup you need to set an autorun on one cd/dvd. You only need to add an autorun.inf text file using the ini format. Below is an example assuming you have an setup.exe with your icon.

[autorun]
open=setup.exe 
icon=setup.exe,0
label=My install CD

您可以将图标部分更改为任何图标,例如"icon = my_cool_icon.ico".如果您的exe文件具有3个图标,则由于计数是从零开始的索引,因此可以使用"setup.exe,1"选择第二个,而使用"setup.exe,2"选择最后一个.

You can change the icon section to any icon, for example "icon=my_cool_icon.ico". If your exe file have 3 icons, you can pick the 2th with "setup.exe,1" and the last with "setup.exe,2" since the counting is zero based index.

有关维基百科

要在安装程序末尾启动该应用程序,

To start the app in the end of the installer you need to

  1. 右键单击安装项目,然后单击自定义操作".然后右键单击提交",添加自定义操作",然后选择要运行的文件.(请注意,它必须已经在您的应用程序文件夹中,这对您来说不是问题,因为无论如何您都在运行程序.只需选择项目的输出即可.
  2. 然后,单击添加的.exe,并将InstallerClass更改为false.这是至关重要的,因为否则它将寻找安装程序.您甚至可以将参数添加到Arguments属性中,从而将参数传递给您的.exe

您需要查看是否要以提升的或正常的用户权限运行您的应用.一篇好文章是 msdn以UAC用户身份启动

You need to see if you want your app to run with elevated or normal user permissions. One good article is msdn launch as user from UAC

请检查堆栈问题启动应用, 查看全文

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