Ejemplo n.º 1
0
 protected override void OnStartup(StartupEventArgs e)
 {
     //后台提示更新
     if (e.Args != null && e.Args.Length != 0 && e.Args[0] == "backPrompt")
     {
         BackPromptWindow promptWindow = new BackPromptWindow();
         promptWindow.ShowDialog();
     }
     else
     {
         bool isDowanloaded = CheckUpdateHelper.IsDownloaded();
         bool isMustUpdate  = CheckUpdateHelper.IsMustUpdate();
         //如果下载完成
         if (isDowanloaded)
         {
             //如果是强制更新
             if (isMustUpdate)
             {
                 MainWindow mw = new MainWindow();
                 mw.ShowDialog();
             }
             //如果不是强制更新
             else
             {
                 UpdatePromptWindow upw = new UpdatePromptWindow();
                 upw.ShowDialog();
             }
         }
         //如果未下载完成
         else
         {
             //如果是强制更新
             if (isMustUpdate)
             {
                 WaitDownloadWindow wdw = new WaitDownloadWindow();
                 wdw.ShowDialog();
             }
             //如果不是强制更新
             else
             {
                 //启动MVP客户端
                 string clientPath = AppDomain.CurrentDomain.BaseDirectory + ConfigurationManager.AppSettings["ClientApp"];
                 System.Diagnostics.Process clientApp = new System.Diagnostics.Process {
                     StartInfo = { FileName = clientPath }
                 };
                 clientApp.Start();
             }
         }
     }
 }
Ejemplo n.º 2
0
 protected override void OnStartup(StartupEventArgs e)
 {
     //后台提示更新
     if (e.Args != null && e.Args.Length != 0 && e.Args[0] == "backPrompt")
     {
         BackPromptWindow promptWindow = new BackPromptWindow();
         promptWindow.ShowDialog();
     }
     else
     {
         bool isDowanloaded = CheckUpdateHelper.IsDownloaded();
         bool isMustUpdate = CheckUpdateHelper.IsMustUpdate();
         //如果下载完成
         if (isDowanloaded)
         {
             //如果是强制更新
             if (isMustUpdate)
             {
                 MainWindow mw = new MainWindow();
                 mw.ShowDialog();
             }
             //如果不是强制更新
             else
             {
                 UpdatePromptWindow upw = new UpdatePromptWindow();
                 upw.ShowDialog();
             }
         }
         //如果未下载完成
         else
         {
             //如果是强制更新
             if (isMustUpdate)
             {
                 WaitDownloadWindow wdw = new WaitDownloadWindow();
                 wdw.ShowDialog();
             }
             //如果不是强制更新
             else
             {
                 //启动MVP客户端
                 string clientPath = AppDomain.CurrentDomain.BaseDirectory + ConfigurationManager.AppSettings["ClientApp"];
                 System.Diagnostics.Process clientApp = new System.Diagnostics.Process { StartInfo = { FileName = clientPath } };
                 clientApp.Start();
             }
         }
     }
 }