OUT-369: Added creation of FEATURE_LOCALMACHINE_LOCKDOWN key if it does not exists OUT-369
authornikolaj
Mon, 19 Mar 2018 15:02:28 +0100
branchOUT-369
changeset 2067caa4d95aa5d7
parent 2066 e7d76f8725b5
child 2073 7580679c7322
OUT-369: Added creation of FEATURE_LOCALMACHINE_LOCKDOWN key if it does not exists
OutlookOptions.cs
     1.1 --- a/OutlookOptions.cs	Fri Mar 16 18:52:13 2018 +0100
     1.2 +++ b/OutlookOptions.cs	Mon Mar 19 15:02:28 2018 +0100
     1.3 @@ -81,8 +81,9 @@
     1.4  
     1.5              try
     1.6              {
     1.7 -                using (RegistryKey localMachineLockdownKey = Registry.CurrentUser.OpenSubKey(localMachineLockdownPath, true))
     1.8 -                {                  
     1.9 +                using (RegistryKey localMachineLockdownKey = Registry.CurrentUser.OpenSubKey(localMachineLockdownPath, true) ??
    1.10 +                    Registry.CurrentUser.CreateSubKey(localMachineLockdownPath))
    1.11 +                {                                      
    1.12                      var value = localMachineLockdownKey?.GetValue(outlookValue);
    1.13                      if (value == null || (value as int?) !=1)
    1.14                      {