2 using System.Collections.Generic;
\r
3 using System.Windows.Forms;
\r
6 namespace AppliStation
\r
12 PackageListViewForm form;
\r
15 ///
\83A
\83v
\83\8a\83P
\81[
\83V
\83\87\83\93\82Ì
\83I
\83v
\83V
\83\87\83\93\r
17 Dictionary<string, object> appArgs;
\r
19 string[] restAppArgs;
\r
23 appArgs = new Dictionary<string, object>();
\r
24 appArgs["noupdate"] = false;
\r
25 appArgs["cmd"] = string.Empty;
\r
26 appArgs["pkgsref"] = string.Empty;
\r
27 appArgs["instsref"] = string.Empty;
\r
29 form = new PackageListViewForm();
\r
34 form.Load += delegate(object sender, EventArgs e) {
\r
36 form.updateActionInvoke(((bool)appArgs["noupdate"]) != true);
\r
38 form.UpdatePackageList();
\r
40 Application.Run(form);
\r
46 NaGet.Packages.Install.Installation[] insts = NaGet.Utils.GetDeserializedObject<NaGet.Packages.Install.Installation[]>((string) appArgs["instsref"]);
\r
49 form.installActionInvoke(insts);
\r
50 } catch (UnauthorizedAccessException e) {
\r
51 MessageBox.Show(string.Format("
\8aÇ
\97\9d\8eÒ
\8c \8cÀ
\82É
\8f¸
\8ai
\82µ
\82Ä
\82¢
\82È
\82¢
\82©
\81A
\8eÀ
\8ds
\8c \8cÀ
\82É
\96â
\91è
\82ª
\82 \82è
\82Ü
\82·
\81B\n(
\8fÚ
\8d×:{0})", e.Message),
\r
52 Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
\r
53 } catch (FileNotFoundException e) {
\r
54 MessageBox.Show(string.Format("
\83\
\83t
\83g
\8ew
\92è
\83t
\83@
\83C
\83\8b{0}
\82ª
\8c©
\82Â
\82©
\82è
\82Ü
\82¹
\82ñ", e.FileName),
\r
55 Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
\r
62 NaGet.Packages.Install.InstalledPackage[] pkgs = NaGet.Utils.GetDeserializedObject<NaGet.Packages.Install.InstalledPackage[]>((string) appArgs["pkgsref"]);
\r
65 form.uninstallActionInvoke(pkgs);
\r
66 } catch (UnauthorizedAccessException e) {
\r
67 MessageBox.Show(string.Format("
\8aÇ
\97\9d\8eÒ
\8c \8cÀ
\82É
\8f¸
\8ai
\82µ
\82Ä
\82¢
\82È
\82¢
\82©
\81A
\8eÀ
\8ds
\8c \8cÀ
\82É
\96â
\91è
\82ª
\82 \82è
\82Ü
\82·
\81B\n(
\8fÚ
\8d×:{0})", e.Message),
\r
68 Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
\r
69 } catch (FileNotFoundException e) {
\r
70 MessageBox.Show(string.Format("
\83\
\83t
\83g
\8ew
\92è
\83t
\83@
\83C
\83\8b{0}
\82ª
\8c©
\82Â
\82©
\82è
\82Ü
\82¹
\82ñ", e.FileName),
\r
71 Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
\r
75 private void hideSplashScreen()
\r
77 if (splashScreen != null && splashScreen.Visible) {
\r
78 splashScreen.Hide();
\r
79 splashScreen.Dispose();
\r
83 public void Run(string[] args)
\r
87 switch ((string) appArgs["cmd"]) {
\r
100 private void parseArgs(string[] args)
\r
102 NaGet.ArgParser parser = new NaGet.ArgParser(appArgs);
\r
103 restAppArgs = parser.Parse(args);
\r
107 public static void Main(string[] args)
\r
109 Form splashScreen = null;
\r
112 if (args.Length <= 0) { // HACK
\88ø
\90\94\83p
\81[
\83X
\82Ì
\8e\9e\8aÔ
\82³
\82¦
\91Ò
\82Ä
\82È
\82¢
\82Ì
\82Å
\88ø
\90\94\82Ì
\97L
\96³
\82Å
\95\
\8e¦
\82ð
\94»
\92f
\r
113 splashScreen = new Form();
\r
114 splashScreen.FormBorderStyle = FormBorderStyle.None;
\r
115 splashScreen.BackgroundImage = System.Drawing.Bitmap.FromFile(Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "SplashScreen.png"));
\r
116 splashScreen.Size = splashScreen.BackgroundImage.Size;
\r
117 splashScreen.ShowIcon = false;
\r
118 splashScreen.ShowInTaskbar = false;
\r
119 splashScreen.StartPosition = FormStartPosition.CenterScreen;
\r
120 splashScreen.Show();
\r
123 ToolStripManager.VisualStylesEnabled = false; // ToolStrip
\82ªLuna
\82Å
\90Â
\82
\82È
\82ç
\82È
\82¢
\82æ
\82¤
\82É
\r
124 Application.EnableVisualStyles(); // Luna
\82âVista
\82Ì
\83f
\83U
\83C
\83\93\82ð
\97L
\8cø
\82É
\r
126 Application.ThreadException += AppliStation.Util.ExceptionDialogForm.Application_ThrowException;
\r
127 System.Threading.Thread.GetDomain().UnhandledException += AppliStation.Util.ExceptionDialogForm.Application_ThrowException;
\r
129 Program prog = new Program();
\r
130 prog.splashScreen = splashScreen;
\r
132 } catch (Exception e) {
\r
133 AppliStation.Util.ExceptionDialogForm.Application_ThrowException(null, new System.Threading.ThreadExceptionEventArgs(e));
\r
135 if (splashScreen != null) {
\r
136 splashScreen.Dispose();
\r