示例#1
0
 private static void Main(string[] args)
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Program.SetCulture();
     ThreadException.SettingUpForm();
     if (Program.CFG.GetConfig("FirstRun", true))
     {
         FunctionalForm.Infomation(SR.NotGreenWareWarning);
         Program.CFG.SetConfig("FirstRun", false);
     }
     if (args != null && args.Length == 3)
     {
         if (args[0] == "-replace")
         {
             RunReplaceTask mainForm = new RunReplaceTask
             {
                 ForceKillAllNonSysProcess = (args[1] == "1"),
                 ParentProcessID           = int.Parse(args[2])
             };
             Application.Run(mainForm);
             return;
         }
     }
     else
     {
         MainForm mainForm2 = new MainForm();
         string   text      = Application.StartupPath + "\\source";
         if (Directory.Exists(text))
         {
             mainForm2.SourceDic = text;
         }
         Application.Run(mainForm2);
     }
 }
示例#2
0
        private void bgw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            this.WriteLogFile();
            ProcessStartInfo startInfo = new ProcessStartInfo("explorer.exe");

            Process.Start(startInfo);
            if (e.Error != null)
            {
                FunctionalForm.Infomation(e.Error.ToString());
            }
            string text = string.Format(SR.Log_RunTaskFinished, this.succCount, this.failCount);

            if (this.failCount > 0)
            {
                text = text + Environment.NewLine + SR.Log_FailedNote;
            }
            if (this.succCount > 0)
            {
                text = text + Environment.NewLine + SR.AutoReboot;
                if (FunctionalForm.Question(text, true))
                {
                    RunReplaceTask.Reboot();
                }
            }
            else
            {
                FunctionalForm.Infomation(text);
            }
            Process.Start(this.logFile);
            base.Close();
        }