using FisTools; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace fis.Loader.Handlers { internal class PartUpgradeHandler : BaseHandler { private string _fisFileDir = AppDomain.CurrentDomain.BaseDirectory; public PartUpgradeHandler() : base(LaunchMethodEnum.PartUpgrade) { } internal override void Execute() { if (IsCartSystemVersion) { KillDamon(); } ToolManager.Instance.UpgradeCenter.ExecutePartUpgrade(Logger.WriteLine); var fisFileDir = Directory.GetParent(AppDomain.CurrentDomain.BaseDirectory).Parent.FullName; var fileName = Path.Combine(fisFileDir, "fis.exe"); Logger.WriteLine($"IsCartSystemVersion:{IsCartSystemVersion}"); if (IsCartSystemVersion) { Logger.WriteLine("IsCartSystemVersion StartDamon"); StartDamon(fileName, fisFileDir); } else { Logger.WriteLine("Normal start fis.exe"); ToolManager.Instance.LoaderCenter.StartProcessWithWorkingDirectory(fileName, _fisFileDir); } } } }