Inno Setup-用户登录Windows时如何运行程序? [英] Inno Setup - how can I make my program run when a user logs in to Windows?

查看:137
本文介绍了Inno Setup-用户登录Windows时如何运行程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要使用Inno设置( http://www.jrsoftware.org/isfaq.php)为应用程序构建安装程序.

I want to use Inno Setup (http://www.jrsoftware.org/isfaq.php) to build an installer for an application.

我希望该应用程序在用户登录Windows计算机上的帐户时启动.

I want this application to start whenever a user logs in to their account on the Windows machine.

当用户登录时,如何告诉Inno Setup启动程序?

How can I tell Inno Setup to make the program start when a user logs in?

推荐答案

在所有用户"配置文件的启动文件夹中放置一个快捷方式.请参阅知识库文章"在启动(或自动启动)组中创建快捷方式",其中包括以下示例:

Put a shortcut in the startup folder of All Users profile. See the knowledge base article 'Create shortcuts in the Startup (or Autostart) group' which includes the below example:

[Setup]
PrivilegesRequired=admin

[Icons] 
Name: "{commonstartup}\My Program"; Filename: "{app}\MyProg.exe"

如果您希望仅在安装该程序的用户登录时才运行该程序,请使用 {userstartup} 代替 {commonstartup} .在这种情况下,不需要管理员权限.

If you want the program to run only when the user that installed the program logs in, then use {userstartup} instead of {commonstartup}. In that case admin privileges is not required.


或者如果您决定写入注册表的运行"键(知识库文章) :

[Registry]
Root: HKCU; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "MyProg"; ValueData: """{app}\MyProg.exe"""; Flags: uninsdeletevalue

如果您使用"HKLM",则再次需要管理员权限.

If you use 'HKLM', again admin privileges is required.

这篇关于Inno Setup-用户登录Windows时如何运行程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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