Пример #1
0
 static void Main(string[] args)
 {
     if (args.Length > 5 && args[0] == "--install")
     {
         Thread.Sleep(4000);
         File.Delete(args[1]);
         Thread.Sleep(2000);
         File.Move(args[2], args[3]);
         ProcessStartInfo info = new ProcessStartInfo();
         if (args.Length > 6)
         {
             info.Arguments = args[6];
         }
         info.WorkingDirectory = args[4];
         info.FileName         = args[5];
         Process.Start(info);
         Application.Exit();
     }
     else
     {
         Application.EnableVisualStyles();
         Application.SetCompatibleTextRenderingDefault(false);
         Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
         Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
         AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
         Persistence pers = Persistence.load();
         System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(pers.LCID);
         MDIMain main = null;
         if (args.Length > 0)
         {
             main = new MDIMain(args[0], pers);
         }
         else
         {
             main = new MDIMain(pers);
         }
         TimeSpan updateDiff = DateTime.Now - pers.LastUpdate;
         if (updateDiff.Days >= 7)
         {
             main.checkForUpdates();
         }
         Application.Run(main);
     }
 }
Пример #2
0
 static void Main(string[] args)
 {
     if (args.Length > 5 && args[0] == "--install")
     {
         Thread.Sleep(4000);
         File.Delete(args[1]);
         Thread.Sleep(2000);
         File.Move(args[2], args[3]);
         ProcessStartInfo info = new ProcessStartInfo();
         if (args.Length > 6)
             info.Arguments = args[6];
         info.WorkingDirectory = args[4];
         info.FileName = args[5];
         Process.Start(info);
         Application.Exit();
     }
     else
     {
         Application.EnableVisualStyles();
         Application.SetCompatibleTextRenderingDefault(false);
         Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
         Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
         AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
         Persistence pers = Persistence.load();
         System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(pers.LCID);
         MDIMain main = null;
         if (args.Length > 0)
             main = new MDIMain(args[0], pers);
         else
             main = new MDIMain(pers);
         TimeSpan updateDiff = DateTime.Now - pers.LastUpdate;
         if (updateDiff.Days >= 7)
             main.checkForUpdates();
         Application.Run(main);
     }
 }