X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=win%2FC%23%2FProgram.cs;h=f2bae9661dca1ac741e93f3ec45d0d47cc749a02;hb=6aa1d8aec5bac19ce4430415ea2021c11fb4bf3d;hp=cee6dfa4d7fd097233e0112c295113cd6803aa9d;hpb=d33b92836f5cae69b45aa79d167992903ff4ad43;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/win/C#/Program.cs b/win/C#/Program.cs index cee6dfa4..f2bae966 100644 --- a/win/C#/Program.cs +++ b/win/C#/Program.cs @@ -6,6 +6,8 @@ using System; using System.Windows.Forms; +using System.IO; +using Handbrake.Presets; namespace Handbrake { @@ -22,10 +24,10 @@ namespace Handbrake try { // Make sure the screen resolution is not below 1024x768 - System.Windows.Forms.Screen scr = Screen.PrimaryScreen; + Screen scr = Screen.PrimaryScreen; if ((scr.Bounds.Width < 1024) || (scr.Bounds.Height < 720)) { - 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.ToString() + " \nScreen resolution is too Low. Must be 1024x720 or greater", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + 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 1024x720 or greater", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); launch = false; } } @@ -37,6 +39,20 @@ namespace Handbrake // Either Launch or Close the Application if (launch) { + string appDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake"; + if (!Directory.Exists(appDir)) + Directory.CreateDirectory(appDir); + + string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs"; + if (!Directory.Exists(logDir)) + Directory.CreateDirectory(logDir); + + if (!File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\presets.xml")) + { + PresetsHandler x = new PresetsHandler(); + x.updateBuiltInPresets(); + } + Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new frmMain());