问题
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:
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.
来源:https://stackoverflow.com/questions/10497627/add-registry-key-to-hkcu-runonce-for-every-user-from-visual-studio-setup-project