vs2008, c#: First time my winforms app runs it needs to create a setting in HKLM\Software. Obviously a permissions problem, but the requirement is that the user may not have admin rights, and setting permissions on the registry manually is not possible for the end user. I could create keys during install, but is there any way to do this from the program?
RegistryKey key = Registry.LocalMachine.CreateSubKey(@"Software\MyCompany\MyApp 1.0");
Just testing the app from vs2008 gives this error: Access to the registry key 'HKEY_LOCAL_MACHINE\Software\MyCompany\MyApp' is denied.
If I run it as administration no errors.