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
This commit is contained in:
dmex04
2009-10-07 02:39:26 +00:00
parent 1e6f5f499a
commit a158ecb764
+6 -4
View File
@@ -112,7 +112,7 @@ namespace ProcessHacker
/// The main entry point for the application.
/// </summary>
[STAThread]
public static void Main(string[] args)
public static int Main(string[] args)
{
Dictionary<string, string> 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()