Program.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Windows.Forms;
  6. namespace VirgoRT_Setup
  7. {
  8. static class Program
  9. {
  10. /// <summary>
  11. /// The main entry point for the application.
  12. /// </summary>
  13. [STAThread]
  14. static void Main()
  15. {
  16. Application.EnableVisualStyles();
  17. Application.SetCompatibleTextRenderingDefault(false);
  18. Application.Run(new VirgoRTSetup());
  19. }
  20. }
  21. public partial class VirgoRTSetup : ApplicationContext
  22. {
  23. public VirgoRTSetup()
  24. {
  25. var exeFilePath = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;
  26. exeFilePath = exeFilePath.Substring(0, exeFilePath.LastIndexOf("\\")) + "\\" + "VirgoRT.exe";
  27. System.IO.FileInfo fi = new System.IO.FileInfo(exeFilePath);
  28. if (fi.Exists)
  29. {
  30. //if (MessageBox.Show(string.Format("即将运行VirgoRT安装程序,请确认以下信息是否正确:\n\n程序变更号:{0}\n\n请确认是否继续完成安装?", tmVariation), "VirgoRT安装", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
  31. System.Diagnostics.Process.Start(exeFilePath);
  32. }
  33. else
  34. {
  35. MessageBox.Show(string.Format("当前安装包不包含VirgoRT配置的安装信息,安装失败!"), "VirgoRT安装", MessageBoxButtons.OK, MessageBoxIcon.Error);
  36. }
  37. Environment.Exit(0);
  38. }
  39. }
  40. }