I try to run several applications for the current user only when Windows starts.
I can accomplish this with the following:
RegistryKey oKey = Registry.CurrentUser.OpenSubKey("Software", true); oKey = oKey.OpenSubKey("Microsoft", true); oKey = oKey.OpenSubKey("Windows", true); oKey = oKey.OpenSubKey("CurrentVersion", true); oKey = oKey.OpenSubKey("Run", true); oKey.SetValue("Application 1", "C:\\path\\to\\ap1.exe"); oKey.SetValue("Application 2", "C:\\path\\to\\ap2.exe");
But I'm trying to run this as part of a Visual Studio installer project. I added my own action, the program starts as it should, and the installer works fine in XP.
On Windows 7, the installer receives elevated privileges and does everything except insert registry entries for the current user. Be that as it may, it inserts registry entries at startup as a stand-alone application (outside the installer project) and does not receive elevated privileges.
The only thing I can understand is that with elevated privileges, is he trying to insert entries into the Administrators account instead of the current user? or is there something else that i'm missing? and is there any other way that I can achieve my goal here?
C0NFUS3D
source share