OSDN Git Service

WinGui:
[handbrake-jp/handbrake-jp-git.git] / win / C# / Program.cs
index 885a369..f2bae96 100644 (file)
@@ -6,6 +6,8 @@
 \r
 using System;\r
 using System.Windows.Forms;\r
+using System.IO;\r
+using Handbrake.Presets;\r
 \r
 namespace Handbrake\r
 {\r
@@ -37,6 +39,20 @@ namespace Handbrake
             // Either Launch or Close the Application\r
             if (launch)\r
             {\r
+                string appDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake";\r
+                if (!Directory.Exists(appDir))\r
+                    Directory.CreateDirectory(appDir);\r
+\r
+                string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs";\r
+                if (!Directory.Exists(logDir))\r
+                    Directory.CreateDirectory(logDir);\r
+\r
+                if (!File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\presets.xml"))\r
+                {\r
+                    PresetsHandler x = new PresetsHandler();\r
+                    x.updateBuiltInPresets();\r
+                }\r
+\r
                 Application.EnableVisualStyles();\r
                 Application.SetCompatibleTextRenderingDefault(false);\r
                 Application.Run(new frmMain());\r