Changing behavior - Now the installation will start the application automatically

This commit is contained in:
2026-03-18 18:28:52 +00:00
parent dc8d1c138c
commit 0f838c1558
6 changed files with 405 additions and 80 deletions
+24 -4
View File
@@ -6,11 +6,31 @@ namespace OutlookCaseHelper
internal static class Program
{
[STAThread]
static void Main()
static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
try
{
if (args.Length > 0 && args[0] == "/postinstall")
{
string exePath = System.Diagnostics.Process.GetCurrentProcess().MainModule!.FileName;
var psi = new System.Diagnostics.ProcessStartInfo
{
FileName = exePath,
UseShellExecute = true,
CreateNoWindow = false
};
System.Threading.Thread.Sleep(12000); // aguarda 12 segundos
System.Diagnostics.Process.Start(psi);
return;
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
catch { }
}
}
}