PartUpgradeHandler.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using FisTools;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.IO;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace fis.Loader.Handlers
  9. {
  10. internal class PartUpgradeHandler : BaseHandler
  11. {
  12. private string _fisFileDir = AppDomain.CurrentDomain.BaseDirectory;
  13. public PartUpgradeHandler() : base(LaunchMethodEnum.PartUpgrade)
  14. {
  15. }
  16. internal override void Execute()
  17. {
  18. if (IsCartSystemVersion)
  19. {
  20. KillDamon();
  21. }
  22. ToolManager.Instance.UpgradeCenter.ExecutePartUpgrade(Logger.WriteLine);
  23. var fisFileDir = Directory.GetParent(AppDomain.CurrentDomain.BaseDirectory).Parent.FullName;
  24. var fileName = Path.Combine(fisFileDir, "fis.exe");
  25. Logger.WriteLine($"IsCartSystemVersion:{IsCartSystemVersion}");
  26. if (IsCartSystemVersion)
  27. {
  28. Logger.WriteLine("IsCartSystemVersion StartDamon");
  29. StartDamon(fileName, fisFileDir);
  30. }
  31. else
  32. {
  33. Logger.WriteLine("Normal start fis.exe");
  34. ToolManager.Instance.LoaderCenter.StartProcessWithWorkingDirectory(fileName, _fisFileDir);
  35. }
  36. }
  37. }
  38. }