-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Code refactor and improved resource file usage (#601)
Refactor lots of code due to the custom serialization/deserialization logic implemented in the version 1.9.0.0 of the AppControl Manager. The result is a cleaner and better interop between different components. Moved lots of strings to the resource file to improve the ability of the app to be translated into other languages. Improved the Configure Policy Rule Options page, it now shows details and description of each rule option, helping you to decide which one is suitable for your use case. Updated a NuGet dependency to the latest version.
- Loading branch information
Showing
57 changed files
with
1,493 additions
and
1,551 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,21 @@ | ||
using System.IO; | ||
using AppControlManager.Others; | ||
using AppControlManager.XMLOps; | ||
|
||
namespace AppControlManager.IntelGathering; | ||
|
||
public static class PrepareEmptyPolicy | ||
{ | ||
|
||
/// <summary> | ||
/// Copies one of the template Code Integrity policies to the directory it receives, empties it and returns its path | ||
/// Copies the empty policy in app resources to the defined directory and returns its new path | ||
/// </summary> | ||
/// <param name="directory"></param> | ||
/// <returns></returns> | ||
public static string Prepare(string directory) | ||
{ | ||
|
||
string pathToReturn = Path.Combine(directory, "EmptyPolicyFile.xml"); | ||
|
||
Logger.Write("Copying the template policy to the staging area"); | ||
|
||
File.Copy(@"C:\Windows\schemas\CodeIntegrity\ExamplePolicies\AllowAll.xml", pathToReturn, true); | ||
|
||
Logger.Write("Emptying the policy file in preparation for the new data insertion"); | ||
ClearCiPolicySemantic.Clear(pathToReturn); | ||
File.Copy(GlobalVars.EmptyPolicyPath, pathToReturn, true); | ||
|
||
return pathToReturn; | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.