Browse Source

Refine Windows registry again(#512)

Used a method added in .NET 4, user may not have
this version installed, reverting to an older
method seems to be a better solution.

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
tags/3.3
Syrone Wong 8 years ago
parent
commit
ddb7374432
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      shadowsocks-csharp/Util/Util.cs

+ 3
- 3
shadowsocks-csharp/Util/Util.cs View File

@@ -151,9 +151,9 @@ namespace Shadowsocks.Util
// we are building x86 binary for both x86 and x64, which will
// cause problem when opening registry key
// detect operating system instead of CPU
RegistryKey userKey = RegistryKey.OpenBaseKey( RegistryHive.CurrentUser,
Environment.Is64BitOperatingSystem ? RegistryView.Registry64 : RegistryView.Registry32 );
userKey = userKey.OpenSubKey( name, writable );
RegistryKey userKey = RegistryKey.OpenRemoteBaseKey( RegistryHive.CurrentUser, "",
Environment.Is64BitOperatingSystem ? RegistryView.Registry64 : RegistryView.Registry32 )
.OpenSubKey( name, writable );
return userKey;
}


Loading…
Cancel
Save