2
votes

I need to install an application that will run once for any user that logs in who has a profile on a Windows installation. I don't need it to run for new users. I am using a Visual Studio 2010 Setup Project to create an MSI, and I am happy to make Custom Actions in C# to fiddle with the registry if the MSI registry stuff isn't flexible enough.

I know how to add a registry value to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce with the MSI, but that will only start the app for the user that ran the installer. I can add the value to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce but it'll only run the next time a user logs in, not for every user.

So, firstly is it at all possible (with VS Setup Project or C#), and if so, how?

Thanks.

1
That's going to be hard to achieve. Why don't you let your app run this task when it detects that the logged in user has never run your software before.David Heffernan
Yeah that is my backup plan, but it still requires the app to load and run to check whether or not it needs to do anything every time someone logs in. I just thought I'd check if that's absolutely necessary first.AndrewS
I've removed my answer, you're right, HKEY_USERS only shows the currently logged in users.user247702
Why don't you just use HKLM instead and keep track of what users you've already seen?Hans Passant
@Hans Passant - see my comment above.AndrewS

1 Answers

2
votes

I think Active Setup is what you need: http://www.sepago.de/helge/2010/04/22/active-setup-explained/

Normally advertised shortcuts are used to trigger per-user actions after a package is installed, but this does not fit with your scenario.