From a158ecb76433146a09b244ebbb98bbae2d7a3507 Mon Sep 17 00:00:00 2001 From: dmex04 Date: Wed, 7 Oct 2009 02:39:26 +0000 Subject: [PATCH] fixed main entry point not exiting when .NET 2.0 isn't installed, also returns PH execution status git-svn-id: svn://svn.code.sf.net/p/processhacker/code@2086 21ef857c-d57f-4fe0-8362-d861dc6d29cd --- trunk/ProcessHacker/Program/Program.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/trunk/ProcessHacker/Program/Program.cs b/trunk/ProcessHacker/Program/Program.cs index 8e40b0e30..6b70d2549 100644 --- a/trunk/ProcessHacker/Program/Program.cs +++ b/trunk/ProcessHacker/Program/Program.cs @@ -112,7 +112,7 @@ namespace ProcessHacker /// The main entry point for the application. /// [STAThread] - public static void Main(string[] args) + public static int Main(string[] args) { Dictionary pArgs = null; @@ -137,7 +137,7 @@ namespace ProcessHacker if (pArgs.ContainsKey("-h") || pArgs.ContainsKey("-help") || pArgs.ContainsKey("-?")) { ShowCommandLineUsage(); - return; + return 0; } // In case the settings file is corrupt PH won't crash here - it will be dealt with later. @@ -181,7 +181,7 @@ namespace ProcessHacker { PhUtils.ShowError("You must have .NET Framework 2.0 or higher to use Process Hacker."); - Application.Exit(); + Environment.Exit(1); } ThreadPool.SetMinThreads(1, 1); @@ -278,7 +278,7 @@ namespace ProcessHacker } if (ProcessCommandLine(pArgs)) - return; + return 0; Win32.FileIconInit(true); LoadProviders(); @@ -292,6 +292,8 @@ namespace ProcessHacker new HackerWindow(); Application.Run(); + + return 0; } private static void ShowCommandLineUsage()