When trying to run the 7-Zip command line .exe from within a C# Windows service my application hangs without throwing an error. Setting breakpoints at the section below showed that the hang occurs once I hit Process.Start(p). I put the same code in a Windows forms app and got the "Open File - Security Warning" message box that states that the publisher could not be verified. Clicking "Run" on the warning caused it to proceed without any problems. Is there a way outside of unchecking the "Always ask before opening this file" box to suppress this warning?
My code is as follows:
ProcessStartInfo p = new ProcessStartInfo();
p.FileName = "7za.exe";
p.Arguments = "a -tzip \"" + targetName + "\" \"" + sourceName + "\" -mx=9";
p.WindowStyle = ProcessWindowStyle.Hidden;
Process x = new Process();
x = Process.Start(p);
x.WaitForExit();
Thanks in advance for your help.