From 54ee9c00423ea0aa33f044434d07704d299a6bfd Mon Sep 17 00:00:00 2001 From: Miepee <38186597+Miepee@users.noreply.github.com> Date: Tue, 17 Aug 2021 10:56:06 +0200 Subject: [PATCH] Fix lib folder issue with windows on auto-updating --- AM2RLauncher/AM2RLauncher/LauncherUpdater.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/AM2RLauncher/AM2RLauncher/LauncherUpdater.cs b/AM2RLauncher/AM2RLauncher/LauncherUpdater.cs index 0ec507c..164ea89 100644 --- a/AM2RLauncher/AM2RLauncher/LauncherUpdater.cs +++ b/AM2RLauncher/AM2RLauncher/LauncherUpdater.cs @@ -57,6 +57,11 @@ namespace AM2RLauncher log.Info(CrossPlatformOperations.LAUNCHERNAME + ".oldCfg detected. Removing file."); File.Delete(oldConfigPath); } + if (currentPlatform.IsWinForms && Directory.Exists(CrossPlatformOperations.CURRENTPATH + "/oldLib")) + { + log.Info("Old lib folder detected, removing folder."); + Directory.Delete(CrossPlatformOperations.CURRENTPATH + "/oldLib", true); + } //check settings if autoUpdate is set to true bool autoUpdate = bool.Parse(CrossPlatformOperations.ReadFromConfig("AutoUpdate")); @@ -148,7 +153,10 @@ namespace AM2RLauncher } // for windows, the actual application is in "AM2RLauncher.dll". Which means, we need to update the lib folder as well. if (currentPlatform.IsWinForms) + { + Directory.Move(CrossPlatformOperations.CURRENTPATH + "/lib", CrossPlatformOperations.CURRENTPATH + "/oldLib"); HelperMethods.DirectoryCopy(tmpUpdatePath + "lib", CrossPlatformOperations.CURRENTPATH + "/lib", true); + } Directory.Delete(tmpUpdatePath, true);