Add registry key to HKCU RunOnce for every user from Visual Studio setup project

不问归期 提交于 2021-01-28 03:09:56

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!