Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion WDAC-Policy-Wizard/app/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
Expand Down
86 changes: 70 additions & 16 deletions WDAC-Policy-Wizard/app/WDAC Wizard.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,18 @@
<Description>WDAC Wizard</Description>
<PackageProjectUrl>aka.ms/wdacwizard</PackageProjectUrl>
<FileVersion>2.4.3.0</FileVersion>
<PackageOutputPath>$(OutputPath)</PackageOutputPath>
<SignAssembly>False</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Assets\**" />
<EmbeddedResource Remove="Assets\**" />
<None Remove="Assets\**" />
</ItemGroup>
<ItemGroup>
<Compile Update="Properties\Settings.Designer.cs">
<DesignTimeSharedInput>True</DesignTimeSharedInput>
Expand Down Expand Up @@ -109,22 +120,6 @@
<None Include="product.pbxproj" />
</ItemGroup>
<ItemGroup>
<Content Include="Assets\Square150x150Logo.scale-100.png" />
<Content Include="Assets\Square44x44Logo.altform-lightunplated_targetsize-24.png" />
<Content Include="Assets\Square44x44Logo.altform-lightunplated_targetsize-256.png" />
<Content Include="Assets\Square44x44Logo.altform-lightunplated_targetsize-32.png" />
<Content Include="Assets\Square44x44Logo.altform-lightunplated_targetsize-48.png" />
<Content Include="Assets\Square44x44Logo.altform-unplated_targetsize-256.png" />
<Content Include="Assets\Square44x44Logo.altform-unplated_targetsize-32.png" />
<Content Include="Assets\Square44x44Logo.altform-unplated_targetsize-48.png" />
<Content Include="Assets\Square44x44Logo.scale-100.png" />
<Content Include="Assets\Square44x44Logo.scale-125.png" />
<Content Include="Assets\Square44x44Logo.scale-150.png" />
<Content Include="Assets\Square44x44Logo.scale-400.png" />
<Content Include="Assets\Square44x44Logo.targetsize-24.png" />
<Content Include="Assets\Square44x44Logo.targetsize-256.png" />
<Content Include="Assets\Square44x44Logo.targetsize-32.png" />
<Content Include="Assets\Square44x44Logo.targetsize-48.png" />
<Content Include="bin\Debug\policies\DefaultWindows_Enforced.xml" />
<Content Include="bin\Debug\policies\WinSiPolicy.xml" />
<Content Include="bin\Debug\System.Security.Cryptography.Pkcs.dll" />
Expand Down Expand Up @@ -202,13 +197,72 @@
<Content Include="Resources\imgs\windows-logo.png" />
<Content Include="Resources\imgs\wizard-ico.ico" />
<Content Include="Resources\policyTemplates\AllowMicrosoft.xml" />
<None Update="priconfig.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<None Update="Resources\policyTemplates\cipolicy.xsd">
<SubType>Designer</SubType>
</None>
<None Update="Resources\RulesDict.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>RulesDict.xml</TargetPath>
</None>
<None Update="Resources\policyTemplates\AllowMicrosoft - SingleFormat.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>Templates\AllowMicrosoft - SingleFormat.xml</TargetPath>
</None>
<None Update="Resources\policyTemplates\AllowMicrosoft.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>Templates\AllowMicrosoft.xml</TargetPath>
</None>
<None Update="Resources\policyTemplates\AppIdTagging.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>Templates\AppIdTagging.xml</TargetPath>
</None>
<None Update="Resources\policyTemplates\DefaultWindows_Audit - SingleFormat.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>Templates\DefaultWindows_Audit - SingleFormat.xml</TargetPath>
</None>
<None Update="Resources\policyTemplates\DefaultWindows_Audit.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>Templates\DefaultWindows_Audit.xml</TargetPath>
</None>
<None Update="Resources\policyTemplates\EmptyWDAC.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>Templates\EmptyWDAC.xml</TargetPath>
</None>
<None Update="Resources\policyTemplates\Empty_Supplemental.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>Templates\Empty_Supplemental.xml</TargetPath>
</None>
<None Update="Resources\policyTemplates\Recommended_Driver_Blocklist.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>Templates\Recommended_Driver_Blocklist.xml</TargetPath>
</None>
<None Update="Resources\policyTemplates\Recommended_UserMode_Blocklist.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>Templates\Recommended_UserMode_Blocklist.xml</TargetPath>
</None>
<None Update="Resources\policyTemplates\SignedReputable - SingleFormat.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>Templates\SignedReputable - SingleFormat.xml</TargetPath>
</None>
<None Update="Resources\policyTemplates\SignedReputable.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>Templates\SignedReputable.xml</TargetPath>
</None>
<None Update="Resources\policyTemplates\WinSEPolicy.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>Templates\WinSEPolicy.xml</TargetPath>
</None>
<None Update="Resources\policyTemplates\WinSiPolicy.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>Templates\WinSiPolicy.xml</TargetPath>
</None>
<Content Include="obj\Debug\TempPE\Properties.Resources.Designer.cs.dll" />
<Content Include="obj\Debug\WDAC Wizard.csproj.FileListAbsolute.txt" />
<Content Include="obj\Debug\WDAC Wizard.exe" />
Expand Down
5 changes: 2 additions & 3 deletions WDAC-Policy-Wizard/app/WDAC Wizard.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29613.14
# Visual Studio Version 17
VisualStudioVersion = 17.13.35931.197 d17.13
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WDAC Wizard", "WDAC Wizard.csproj", "{0E7BFE11-6999-4855-B151-EAF52F571AAF}"
EndProject
Expand Down
54 changes: 27 additions & 27 deletions WDAC-Policy-Wizard/app/src/BuildPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public BuildPage(MainWindow pMainWindow)
progressBar.Maximum = 100;
progressBar.Step = 1;
progressBar.Value = 0;
this._MainWindow = pMainWindow;
_MainWindow = pMainWindow;
}

/// <summary>
Expand All @@ -48,38 +48,38 @@ public void UpdateProgressBar(int progress, string process)
/// <param name="policyFilePath">File location for the XML policy file</param>
public void ShowFinishMsg(string policyFilePath)
{
this.XmlFilePath = policyFilePath;
XmlFilePath = policyFilePath;

// Format the path in cases of long strings
this.xmlFilePathLabel.Text = FormatText(policyFilePath);
xmlFilePathLabel.Text = FormatText(policyFilePath);

// Update the UI
this.xmlFilePathLabel.Enabled = true;
this.finishPanel.Visible = true;
this.label_WaitMsg.Visible = false;
xmlFilePathLabel.Enabled = true;
finishPanel.Visible = true;
label_WaitMsg.Visible = false;

// Hide the binFilePathLabel - XML file output only
this.binFilePathLabel.Visible = false;
binFilePathLabel.Visible = false;
}

public void ShowFinishMsg(string policyFilePath, string binFilePath)
{
// Set the path objects to unformatted text
this.XmlFilePath = policyFilePath;
this.BinFilePath = binFilePath;
XmlFilePath = policyFilePath;
BinFilePath = binFilePath;

// Format the paths in cases of long strings
this.xmlFilePathLabel.Text = FormatText(policyFilePath);
this.binFilePathLabel.Text = FormatText(binFilePath);
xmlFilePathLabel.Text = FormatText(policyFilePath);
binFilePathLabel.Text = FormatText(binFilePath);

// Update the UI - show xmlFilePath label
this.xmlFilePathLabel.Enabled = true;
this.finishPanel.Visible = true;
this.label_WaitMsg.Visible = false;
xmlFilePathLabel.Enabled = true;
finishPanel.Visible = true;
label_WaitMsg.Visible = false;

// Update the UI - show binFilePath label
this.binFilePathLabel.Visible = true;
this.binFilePathLabel.Enabled = true;
binFilePathLabel.Visible = true;
binFilePathLabel.Enabled = true;
}

/// <summary>
Expand Down Expand Up @@ -119,12 +119,12 @@ public string FormatText(string longstring)
public void ShowError()
{
finishPanel.Visible = true;
this.finishLabel.Text = Properties.Resources.PolicyBuild_Error + this._MainWindow.TempFolderPath;
finishLabel.Text = Properties.Resources.PolicyBuild_Error + _MainWindow.TempFolderPath;
UpdateProgressBar(0, "Error");

this.xmlFilePathLabel.Enabled = false;
this.binFilePathLabel.Enabled = false;
this.label_WaitMsg.Visible = false;
xmlFilePathLabel.Enabled = false;
binFilePathLabel.Enabled = false;
label_WaitMsg.Visible = false;
}

/// <summary>
Expand All @@ -133,11 +133,11 @@ public void ShowError()
private void XmlFilePathLabel_Click(object sender, EventArgs e)
{
// Open XML file in the default application set for XML files
if (File.Exists(this.XmlFilePath))
if (File.Exists(XmlFilePath))
{
try
{
Process.Start(new ProcessStartInfo(this.XmlFilePath) { UseShellExecute = true });
Process.Start(new ProcessStartInfo(XmlFilePath) { UseShellExecute = true });
}
catch (Exception ex)
{
Expand All @@ -151,7 +151,7 @@ private void XmlFilePathLabel_Click(object sender, EventArgs e)
}
else
{
string displayMsg = Properties.Resources.XMLFileOpen_Error + this._MainWindow.TempFolderPath;
string displayMsg = Properties.Resources.XMLFileOpen_Error + _MainWindow.TempFolderPath;
DialogResult res = MessageBox.Show(displayMsg,
"Wizard Error",
MessageBoxButtons.OK,
Expand All @@ -167,7 +167,7 @@ private void XmlFilePathLabel_Click(object sender, EventArgs e)
private void BinFilePathLabel_Click(object sender, EventArgs e)
{
// Open Binary's directory to browse for file in Explorer
if (File.Exists(this.BinFilePath))
if (File.Exists(BinFilePath))
{
try
{
Expand All @@ -187,7 +187,7 @@ private void BinFilePathLabel_Click(object sender, EventArgs e)
}
else
{
string displayMsg = Properties.Resources.BINFileOpen_Error + this._MainWindow.TempFolderPath;
string displayMsg = Properties.Resources.BINFileOpen_Error + _MainWindow.TempFolderPath;
DialogResult res = MessageBox.Show(displayMsg,
"Wizard Error",
MessageBoxButtons.OK,
Expand Down Expand Up @@ -276,7 +276,7 @@ private void SetControlsColor()
// Dark Mode
if (Properties.Settings.Default.useDarkMode)
{
foreach (Control control in this.Controls)
foreach (Control control in Controls)
{
if (control is Panel panel
&& (panel.Tag == null || panel.Tag.ToString() != Properties.Resources.IgnoreDarkModeTag))
Expand All @@ -290,7 +290,7 @@ private void SetControlsColor()
// Light Mode
else
{
foreach (Control control in this.Controls)
foreach (Control control in Controls)
{
if (control is Panel panel
&& (panel.Tag == null || panel.Tag.ToString() != Properties.Resources.IgnoreDarkModeTag))
Expand Down
Loading