Trivial task. Add to branch
HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Run
key. How I do it:
static void SetRegistryValue(string path, string key, object value) { using (var currKey = Registry.CurrentUser.OpenSubKey(path, true)) { if (currKey != null) { currKey.SetValue(key, value, RegistryValueKind.ExpandString); currKey.Close(); } } } Then
SetRegistryValue(@"Software\Microsoft\Windows\CurrentVersion\Run", "key", "value"); As a result, falls into
System.UnauthorizedAccessException: An attempt to perform an unauthorized operation.
After that, I just did not try. Tested even with level = "highestAvailable" in the manifest - the same thing.
I'm on board Windows 10 Pro Insider Preview. I ran the test on a machine with Windows 7 - everything works fine. What is the problem?