Updates to logging and v1.0.3 release.

This commit is contained in:
Patrick Fic
2020-12-03 10:41:57 -08:00
parent 12b095a406
commit 2acc8faa5b
9 changed files with 113 additions and 26 deletions

View File

@@ -10,6 +10,19 @@ namespace BodyshopPartner.Utils
{
private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
public static bool AddHttpExcetion()
{
logger.Debug("Attempting to add HTTP Exclusion for web-server");
System.Diagnostics.Process process = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
startInfo.FileName = "cmd.exe";
startInfo.Arguments = "netsh http add urlacl url=http://+:1337/ user=\"Everyone\"";
startInfo.Verb = "runas";
process.StartInfo = startInfo;
return process.Start();
}
public static void InitializeSquirrelAware()
{
using (var mgr = new UpdateManager(Utils.UpdateHandler.UpdatePath))
@@ -22,15 +35,8 @@ namespace BodyshopPartner.Utils
logger.Debug("Installing via Squirrel Aware Helper. ", v);
try
{
logger.Debug("Attempting to add HTTP Exclusion for web-server");
System.Diagnostics.Process process = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
startInfo.FileName = "cmd.exe";
startInfo.Arguments = "add netsh http add urlacl url=http://+:1337/ user=\"Everyone\"";
startInfo.Verb = "runas";
process.StartInfo = startInfo;
bool successful = process.Start();
bool successful = AddHttpExcetion();
if (successful)
{