gpt4 book ai didi

inno-setup - Inno Setup - 如何让我的程序在用户登录 Windows 时运行?

转载 作者:行者123 更新时间:2023-12-02 11:29:05 25 4
gpt4 key购买 nike

我想使用 Inno Setup ( http://www.jrsoftware.org/isfaq.php ) 为应用程序构建安装程序。

我希望每当用户在 Windows 计算机上登录其帐户时就启动此应用程序。

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

最佳答案

在所有用户配置文件的启动文件夹中放置一个快捷方式。请参阅知识库文章'Create shortcuts in the Startup (or Autostart) group ' 其中包括以下示例:

[Setup]
PrivilegesRequired=admin

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

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


或者,如果您决定写入注册表的“Run”键 ( kb article ):

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

如果您使用“HKLM”,则再次需要管理员权限。

关于inno-setup - Inno Setup - 如何让我的程序在用户登录 Windows 时运行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7490249/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com