华恒Mes鼎捷代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.8 KiB

5 months ago
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Windows.Forms;
  5. namespace ICSSoft.AutoUpdate.Edition.SetupPatch
  6. {
  7. static class Program
  8. {
  9. public static System.Threading.Mutex Run;
  10. /// <summary>
  11. /// 应用程序的主入口点。
  12. /// </summary>
  13. [STAThread]
  14. static void Main(string[] arg)
  15. {
  16. string EditionCode = "";
  17. string pathFolderName = "";
  18. string MainProgramName = "";
  19. if (arg.Count() == 3)
  20. {
  21. EditionCode = arg[0];
  22. pathFolderName = arg[1];
  23. MainProgramName = arg[2];
  24. }
  25. bool noRun = false;
  26. Run = new System.Threading.Mutex(true, Application.ProductName, out noRun);
  27. if (!noRun)
  28. {
  29. MessageBox.Show("本程序已经启动,无法再次启动");
  30. Application.Exit();
  31. return;
  32. }
  33. Run.ReleaseMutex();
  34. Run = new System.Threading.Mutex(true, MainProgramName, out noRun);
  35. if (!noRun)
  36. {
  37. MessageBox.Show("主程序已经启动,无法启动补丁安装工具");
  38. Application.Exit();
  39. return;
  40. }
  41. Run.ReleaseMutex();
  42. Application.EnableVisualStyles();
  43. Application.SetCompatibleTextRenderingDefault(false);
  44. try
  45. {
  46. patchSetUp Client = new patchSetUp(EditionCode, pathFolderName, MainProgramName);
  47. Client.Do();
  48. }
  49. catch (Exception ex)
  50. {
  51. MessageBox.Show("补丁安装失败!"+ex.Message);
  52. }
  53. }
  54. }
  55. }