Fix lib folder issue with windows on auto-updating

pull/21/head
Miepee 5 years ago
parent 11f496c04f
commit 54ee9c0042

@ -57,6 +57,11 @@ namespace AM2RLauncher
log.Info(CrossPlatformOperations.LAUNCHERNAME + ".oldCfg detected. Removing file."); log.Info(CrossPlatformOperations.LAUNCHERNAME + ".oldCfg detected. Removing file.");
File.Delete(oldConfigPath); 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 //check settings if autoUpdate is set to true
bool autoUpdate = bool.Parse(CrossPlatformOperations.ReadFromConfig("AutoUpdate")); 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. // for windows, the actual application is in "AM2RLauncher.dll". Which means, we need to update the lib folder as well.
if (currentPlatform.IsWinForms) if (currentPlatform.IsWinForms)
{
Directory.Move(CrossPlatformOperations.CURRENTPATH + "/lib", CrossPlatformOperations.CURRENTPATH + "/oldLib");
HelperMethods.DirectoryCopy(tmpUpdatePath + "lib", CrossPlatformOperations.CURRENTPATH + "/lib", true); HelperMethods.DirectoryCopy(tmpUpdatePath + "lib", CrossPlatformOperations.CURRENTPATH + "/lib", true);
}
Directory.Delete(tmpUpdatePath, true); Directory.Delete(tmpUpdatePath, true);

Loading…
Cancel
Save