Skip to content

Commit bb9cf71

Browse files
committed
set binary type for active modification based on environment
1 parent 643d740 commit bb9cf71

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

FlashpointSecurePlayer/RegistryStates.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -943,6 +943,7 @@ public async Task StopImportAsync() {
943943
*/
944944

945945
// to prevent issues with HKEY_LOCAL_MACHINE and crash recovery
946+
activeModificationsElement.RegistryStates.BinaryType = Environment.Is64BitOperatingSystem ? BINARY_TYPE.SCS_64BIT_BINARY : BINARY_TYPE.SCS_32BIT_BINARY;
946947
activeModificationsElement.RegistryStates._CurrentUser = WindowsIdentity.GetCurrent().User.Value;
947948
activeModificationsElement.RegistryStates._Administrator = TestLaunchedAsAdministratorUser();
948949
RegistryView registryView = (modificationsElement.RegistryStates.BinaryType == BINARY_TYPE.SCS_64BIT_BINARY) ? RegistryView.Registry64 : RegistryView.Registry32;
@@ -1119,6 +1120,7 @@ public void Deactivate(MODIFICATIONS_REVERT_METHOD modificationsRevertMethod = M
11191120
// don't allow infinite recursion!
11201121
if (String.IsNullOrEmpty(templateElementName)) {
11211122
activeModificationsElement.RegistryStates.Clear();
1123+
activeModificationsElement.RegistryStates.BinaryType = BINARY_TYPE.SCS_64BIT_BINARY;
11221124
activeModificationsElement.RegistryStates._Administrator = false;
11231125
activeModificationsElement.RegistryStates._CurrentUser = String.Empty;
11241126
SetFlashpointSecurePlayerSection(TemplateName);
@@ -1138,6 +1140,7 @@ public void Deactivate(MODIFICATIONS_REVERT_METHOD modificationsRevertMethod = M
11381140

11391141
if (modificationsElement == null) {
11401142
activeModificationsElement.RegistryStates.Clear();
1143+
activeModificationsElement.RegistryStates.BinaryType = BINARY_TYPE.SCS_64BIT_BINARY;
11411144
activeModificationsElement.RegistryStates._Administrator = false;
11421145
activeModificationsElement.RegistryStates._CurrentUser = String.Empty;
11431146
SetFlashpointSecurePlayerSection(TemplateName);
@@ -1221,6 +1224,7 @@ public void Deactivate(MODIFICATIONS_REVERT_METHOD modificationsRevertMethod = M
12211224

12221225
if (clear) {
12231226
activeModificationsElement.RegistryStates.Clear();
1227+
activeModificationsElement.RegistryStates.BinaryType = BINARY_TYPE.SCS_64BIT_BINARY;
12241228
activeModificationsElement.RegistryStates._Administrator = false;
12251229
activeModificationsElement.RegistryStates._CurrentUser = String.Empty;
12261230
SetFlashpointSecurePlayerSection(TemplateName);
@@ -1295,7 +1299,8 @@ public void Deactivate(MODIFICATIONS_REVERT_METHOD modificationsRevertMethod = M
12951299

12961300
ProgressManager.CurrentGoal.Steps++;
12971301
}
1298-
1302+
1303+
activeModificationsElement.RegistryStates.BinaryType = BINARY_TYPE.SCS_64BIT_BINARY;
12991304
activeModificationsElement.RegistryStates._Administrator = false;
13001305
activeModificationsElement.RegistryStates._CurrentUser = String.Empty;
13011306
SetFlashpointSecurePlayerSection(TemplateName);

0 commit comments

Comments
 (0)