private static void RunUpateProc() { bool isUpdateSuccess = UpdateProcess.Update(); if (isUpdateSuccess) { Logger.Info("Update File success"); //更新替换文件成功 if (CheckServiceStart(config.Version)) { BarControl.IsEndSuccess = true; Logger.Info("Update success version:" + config.Version); ClearAllPackage(); } else { //执行检验失败,回滚操作 RunRollBack(); } } else { Logger.Info("Update File failed"); //执行更新失败,回滚操作 RunRollBack(); } }
private static void RunRollBack() { if (UpdateProcess.RollBack() & IsStartSuccess()) { Logger.Info("Roll back success version:" + curVersion); ClearAllPackage(); } else { BarControl.IsRollBackError = true; } BarControl.IsEndFail = true; }