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 Triton160RT_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 Triton160RTSetup());
  19. }
  20. }
  21. public partial class Triton160RTSetup : ApplicationContext
  22. {
  23. public Triton160RTSetup()
  24. {
  25. var exeFilePath = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;
  26. exeFilePath = exeFilePath.Substring(0, exeFilePath.LastIndexOf("\\")) + "\\" + "Triton160RT.exe";
  27. System.IO.FileInfo fi = new System.IO.FileInfo(exeFilePath);
  28. if (fi.Exists)
  29. {
  30. //if (MessageBox.Show(string.Format("即将运行Triton160RT安装程序,请确认以下信息是否正确:\n\n程序变更号:{0}\n\n请确认是否继续完成安装?", tmVariation), "Triton160RT安装", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
  31. System.Diagnostics.Process.Start(exeFilePath);
  32. }
  33. else
  34. {
  35. MessageBox.Show(string.Format("当前安装包不包含Triton160RT配置的安装信息,安装失败!"), "Triton160RT安装", MessageBoxButtons.OK, MessageBoxIcon.Error);
  36. }
  37. Environment.Exit(0);
  38. }
  39. }
  40. }