WIN7&创新设置:如何使程序“为所有用户自动启动"?以每个用户的名字运行 [英] WIN7 & Inno-Setup: How to make a program "auto-launch for all users" run under each user's name

查看:92
本文介绍了WIN7&创新设置:如何使程序“为所有用户自动启动"?以每个用户的名字运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题是我另一个问题引起的.请在此处中查看更多背景.

This question resulted from my another question. Please see more background here.

从另一篇文章中可以看出,我的应用必须以当前帐户所有者的名字运行.我正在使用Inno-setup来安装此应用程序.有一个选项可以安装仅针对当前用户自动启动"或针对所有用户自动启动".但是,这两个选项似乎都不适合我,因为该程序始终以"admin"用户身份启动,这使我的应用无法运行.

From the other post, it turns out my app has to run under current account holder's name. I'm using Inno-setup for installing this app. There is a option to install "auto-launch for current user only" or "auto-launch for all users". However, both options don't seem to work for me, because the program always starts under "admin" user, which makes my app not run.

如果我通过标准用户帐户安装该应用程序,则必须以其他用户(管理员)身份运行安装.在这种情况下,我不能使用仅针对当前用户自动启动"选项,因为安装程序的当前用户"是管理员,而不是标准用户,正如我所发现的那样.

If I install the app from a standard user account, I had to run the install as a different user (admin). In this case, I can't use "auto-launch for current user only" option either because 'current user' to installer is admin, not standard user, as I found out.

经过一番挣扎,我发现,我不得不放弃了inno-setup的自动启动"功能.首先以其他用户(admin)身份从标准帐户安装它.然后,我必须手动将一个条目添加到HKCU \ Software \ Microsoft \ Windows \ CurrentVersion \ Run才能在Windows启动时自动启动.这行得通,但我不敢相信没有更好的方法可以做到这一点.

After much strugle, as I figured out, I had to abandon the inno-setup's "auto-launch" feature. Install it from standard account as a different user (admin) first. Then, I had to manually add an entry to HKCU\Software\Microsoft\Windows\CurrentVersion\Run to make auto-launch on windows startup. This works, but I can't believe there isn't a better way to do it.

以下是相关的inno-setup脚本:

Here is the related inno-setup script:

[Tasks]
Name: startup; Description: "Launch automatically when Windows starts up"; GroupDescription: "Additional icons:"
Name: startup\user; Description: "For the current user only"; GroupDescription: "Additional icons:"; Flags: exclusive unchecked
Name: startup\common; Description: "For all users"; GroupDescription: "Additional icons:"; Flags: exclusive

我正在使用最新的Inno-Setup(v5.4.2).我在这里想念任何东西吗?

I'm using the latest Inno-Setup (v5.4.2). Did I miss anything here?

推荐答案

我不小心将以下行添加到我的inno设置脚本中,结果是我的程序在每次启动时都会自动启动.

I accidently added the following line to my inno setup script with the result, that my program was started automatically on every startup.

[Icons]
Name: "{commonstartup}\LoopJam"; Filename: "{app}\resources\LoopJam.exe"; IconFilename: "{app}\LoopJam.ico";

这篇关于WIN7&创新设置:如何使程序“为所有用户自动启动"?以每个用户的名字运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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