Added http exception to test command for testing.

This commit is contained in:
Patrick Fic
2020-12-02 17:43:53 -08:00
parent 50636417f9
commit bbc59baecb
3 changed files with 51 additions and 52 deletions

View File

@@ -20,16 +20,32 @@ namespace BodyshopPartner.Utils
onInitialInstall: v =>
{
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();
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;
process.Start();
if (successful)
{
logger.Debug("Successfully added exception.");
}
else
{
logger.Fatal("Unable to set exception for http port");
}
}
catch (Exception Ex)
{
logger.Fatal("Unable to set exception for http port", Ex.ToString());
}
mgr.CreateShortcutForThisExe();
},