OSDN Git Service

チケット #38687 tar.gz 形式が 7-ZIP32.DLL がインストールされている環境下で正しく展開されない
[applistation/AppliStation.git] / AppliStation / Program.cs
index b6acf53..466944d 100644 (file)
@@ -16,8 +16,6 @@ namespace AppliStation
                /// </summary>\r
                Dictionary<string, object> appArgs;\r
                \r
-               string[] restAppArgs;\r
-               \r
                public Program()\r
                {\r
                        appArgs = new Dictionary<string, object>();\r
@@ -45,6 +43,7 @@ namespace AppliStation
                                NaGet.Packages.Install.Installation[] insts = NaGet.Utils.GetDeserializedObject<NaGet.Packages.Install.Installation[]>((string) appArgs["instsref"]);\r
                                \r
                                form = new PackageListViewForm();\r
+                               form.UpdatePackageList();\r
                                hideSplashScreen();\r
                                form.installActionInvoke(insts);\r
                        } catch (UnauthorizedAccessException e) {\r
@@ -62,6 +61,7 @@ namespace AppliStation
                                NaGet.Packages.Install.InstalledPackage[] pkgs = NaGet.Utils.GetDeserializedObject<NaGet.Packages.Install.InstalledPackage[]>((string) appArgs["pkgsref"]);\r
                                \r
                                form = new PackageListViewForm();\r
+                               form.UpdatePackageList();\r
                                hideSplashScreen();\r
                                form.uninstallActionInvoke(pkgs);\r
                        } catch (UnauthorizedAccessException e) {\r
@@ -113,7 +113,7 @@ namespace AppliStation
                }\r
                \r
                /// <summary>\r
-               /// AppliStationの自己更新を行う。アーカイブインストーラによってあらかじめインストールされたファイルを、\r
+               /// AppliStationã\81®è\87ªå·±æ\9b´æ\96°ã\82\92è¡\8cã\81\86ã\80\82ã\82¢ã\83¼ã\82«ã\82¤ã\83\96ã\82¤ã\83³ã\82¹ã\83\88ã\83¼ã\83©ã\83¼ã\81«ã\82\88ã\81£ã\81¦ã\81\82ã\82\89ã\81\8bã\81\98ã\82\81ã\82¤ã\83³ã\82¹ã\83\88ã\83¼ã\83«ã\81\95ã\82\8cã\81\9fã\83\95ã\82¡ã\82¤ã\83«ã\82\92ã\80\81\r
                /// カレントディレクトリにコピーするよう新しいAppliStation.exeを呼ぶ。\r
                /// コピー元がないまたはそれが新しくないならば何もしない。\r
                /// </summary>\r
@@ -184,20 +184,20 @@ namespace AppliStation
                private void parseArgs(string[] args)\r
                {\r
                        NaGet.ArgParser parser = new NaGet.ArgParser(appArgs);\r
-                       restAppArgs = parser.Parse(args);\r
+                       string[] restAppArgs = parser.Parse(args);\r
                }\r
                \r
                private static Form createAndOpenSplashScreen()\r
                {\r
-                       Form splashScreen = new Form();\r
-                       splashScreen.FormBorderStyle = FormBorderStyle.None;\r
-                       splashScreen.BackgroundImage = System.Drawing.Bitmap.FromFile(Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "SplashScreen.png"));\r
-                       splashScreen.Size = splashScreen.BackgroundImage.Size;\r
-                       splashScreen.ShowIcon = false;\r
-                       splashScreen.ShowInTaskbar = false;\r
-                       splashScreen.StartPosition = FormStartPosition.CenterScreen;\r
+                       System.Drawing.Bitmap bitmap;\r
+                       \r
+                       bitmap = new System.Drawing.Bitmap(Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "SplashScreen.png"));\r
+                       Form splashScreen = AppliStation.Util.SprashScreenLayered.CreateSprashScreenLayered(bitmap, System.Drawing.Color.Black);\r
+                       \r
+                       splashScreen.Text = "AppliStation";\r
+                       splashScreen.Icon = System.Drawing.Icon.ExtractAssociatedIcon(Application.ExecutablePath);\r
                        splashScreen.Show();\r
-               \r
+                       \r
                        return splashScreen;\r
                }\r
                \r
@@ -217,8 +217,11 @@ namespace AppliStation
                                ToolStripManager.VisualStylesEnabled = false; // ToolStripがLunaで青くならないように\r
                                Application.EnableVisualStyles(); // LunaやVistaのデザインを有効に\r
                                \r
-                               Application.ThreadException += AppliStation.Util.ExceptionDialogForm.Application_ThrowException;\r
-                               System.Threading.Thread.GetDomain().UnhandledException += AppliStation.Util.ExceptionDialogForm.Application_ThrowException;\r
+                               // デバッガがアタッチしていないなら、Exceptionを自力でハンドルする\r
+                               if (! System.Diagnostics.Debugger.IsAttached) {\r
+                                       Application.ThreadException += AppliStation.Util.ExceptionDialogForm.Application_ThrowException;\r
+                                       System.Threading.Thread.GetDomain().UnhandledException += AppliStation.Util.ExceptionDialogForm.Application_ThrowException;\r
+                               }\r
                                \r
                                Program prog = new Program();\r
                                prog.splashScreen = splashScreen;\r