开发者

WIN7 & Inno-Setup: How to make a program "auto-launch for all users" run under each user's name

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

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 i开发者_StackOverflownstall 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.

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.

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

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


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";


Inno doesn't have an "autolaunch" feature, and you neglected to show us the lines that actually create the Run values. Having said that, just adding to the HKLM explorer run key will cause it to run for each user on login.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜