Пример #1
0
		private void TestRegistryExport(string hive, string target)
		{
			string testOutput = Path.Combine(TestFilesPath, "TestRegistryExport", target);
			DeleteOutput(testOutput);
			try
			{
				ActionRegistryExport actionRegistryExport = GetActionRegistryExport(hive, target);
				RegistryExportAction registryExportAction = new RegistryExportAction(actionRegistryExport, GetExcludeList());
				registryExportAction.Execute();
				FileInfo file = new FileInfo(testOutput);
				Assert.IsTrue(file.Exists);

				Dictionary<string, Option> options = new Dictionary<string, Option>();
				RegistryExportTranslater.GetOptions(testOutput, ref options);
				Assert.IsTrue(options.Count > 0);
			}
			finally
			{
				DeleteOutput(testOutput);
			}
		}
Пример #2
0
		private void ExecuteRegistryExportAction(Action action)
		{
			try
			{
				if (action == null ||
					action.RegistryExport == null)
				{
					return;
				}

				foreach (ActionRegistryExport actionItem in action.RegistryExport)
				{
					if (actionItem == null)
					{
						return;
					}

					RegistryExportAction registryExport = new RegistryExportAction(actionItem, Configuration.RegistryKeyExclusions);
					registryExport.Execute();
				}
			}
			catch (Exception ex)
			{
				Logger.LogError(ex);
			}
		}