OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Fri, 2 Apr 2010 19:43:46 +0000 (19:43 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Fri, 2 Apr 2010 19:43:46 +0000 (19:43 +0000)
- Put in some checks on ui launch to make sure the cli and it's dll are present.

git-svn-id: svn://localhost/HandBrake/trunk@3191 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/C#/Program.cs

index 805d339..9596676 100644 (file)
@@ -21,6 +21,31 @@ namespace Handbrake
         [STAThread]\r
         public static void Main()\r
         {\r
+            const string failedInstall = "HandBrake is not installed properly. Please reinstall HandBrake. \n\n";\r
+            const string nightlyCLIMissing =\r
+                "If you have downloaded the \"HandBrakeGUI\" nightly, " +\r
+                "please make sure you have also downloaded the \"HandBrakeCLI\" nightly and extracted it's contents to the same folder. ";\r
+            string missingFiles = string.Empty;\r
+\r
+            // Verify HandBrakeCLI.exe and ilibgcc_s_sjlj-1.dll exists\r
+            if (!File.Exists(Path.Combine(Application.StartupPath, "HandBrakeCLI.exe")))\r
+            {\r
+                missingFiles += "\"HandBrakeCLI.exe\" was not found.";\r
+            }\r
+\r
+            if (!File.Exists(Path.Combine(Application.StartupPath, "libgcc_s_sjlj-1.dll")))\r
+            {\r
+                missingFiles += "\n\"libgcc_s_sjlj-1.dll\" was not found.";\r
+            }\r
+\r
+            if (missingFiles != string.Empty)\r
+            {\r
+                MessageBox.Show(failedInstall + missingFiles + "\n\n"+ nightlyCLIMissing, "Error", MessageBoxButtons.OK,\r
+                                MessageBoxIcon.Error);\r
+                return;\r
+            }\r
+\r
+            // Check were not running on a screen that's going to cause some funnies to happen.\r
             Screen scr = Screen.PrimaryScreen;\r
             if ((scr.Bounds.Width < 1024) || (scr.Bounds.Height < 620))\r
                 MessageBox.Show("Your system does not meet the minimum requirements for HandBrake. \n" + "Your screen is running at: " + scr.Bounds.Width + "x" + scr.Bounds.Height + " \nScreen resolution is too Low. Must be 1024x620 or greater", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);\r