Skip to content

Commit

Permalink
Added upgrade removal of manifest.xml/bundled. Removed need for me2/m…
Browse files Browse the repository at this point in the history
…e3 to be run for config file.
  • Loading branch information
Mgamerz committed Jan 23, 2018
1 parent 7f4193c commit 8e3c070
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
26 changes: 20 additions & 6 deletions AlotAddOnGUI/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,9 @@ public App() : base()
Log.Information("In update mode. Update destination: " + updateDestinationPath);
Log.Information("Applying update");
CopyDir.CopyAll(new DirectoryInfo(System.AppDomain.CurrentDomain.BaseDirectory), new DirectoryInfo(updateDestinationPath));
Log.Information("Update files have been applied");
Log.Information("Update files have been applied.");
updateDestinationPath += "\\"; //add slash
Log.Information("Performing update migrations...");
if (Directory.Exists(updateDestinationPath + "MEM_Packages") && !Directory.Exists(updateDestinationPath + @"Data\MEM_Packages"))
{
Log.Information("Migrating MEM_Packages folder into subfolder");
Expand All @@ -112,22 +113,35 @@ public App() : base()

if (Directory.Exists(updateDestinationPath + "bin"))
{
Log.Information("Deleting old top level bin folder");
Directory.Delete(updateDestinationPath + "bin");
Log.Information("Deleting old top level bin folder: "+(updateDestinationPath + "bin"));
Utilities.DeleteFilesAndFoldersRecursively(updateDestinationPath + "bin");
}

if (Directory.Exists(updateDestinationPath + "lib"))
{
Log.Information("Deleting old top level lib folder");
Directory.Delete(updateDestinationPath + "lib");
Utilities.DeleteFilesAndFoldersRecursively(updateDestinationPath + "lib");
}

if (Directory.Exists(updateDestinationPath + "Extracted_Mods"))
{
Log.Information("Deleting leftover Extracted_Mods folder");
Directory.Delete(updateDestinationPath + "Extracted_Mods");
Utilities.DeleteFilesAndFoldersRecursively(updateDestinationPath + "Extracted_Mods");
}


if (File.Exists(updateDestinationPath + "manifest.xml"))
{
Log.Information("Deleting leftover manifest.xml file");
File.Delete(updateDestinationPath + "manifest.xml");
}

if (File.Exists(updateDestinationPath + "manifest-bundled.xml"))
{
Log.Information("Deleting leftover manifest-bundled.xml file");
File.Delete(updateDestinationPath + "manifest-bundled.xml");
}

Log.Information("Rebooting into normal mode to complete update: " + updateDestinationPath + System.AppDomain.CurrentDomain.FriendlyName);
ProcessStartInfo psi = new ProcessStartInfo(updateDestinationPath + System.AppDomain.CurrentDomain.FriendlyName);
psi.WorkingDirectory = updateDestinationPath;
psi.Arguments = "--completing-update";
Expand Down
2 changes: 1 addition & 1 deletion AlotAddOnGUI/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1908,7 +1908,7 @@ private async Task<bool> InstallPrecheck(int game)

//Check game has been run at least once
string configFile = IniSettingsHandler.GetConfigIniPath(game);
if (!File.Exists(configFile))
if (game == 1 && !File.Exists(configFile))
{
//game has not been run yet.
Log.Error("Config file missing for Mass Effect " + game + ". Blocking install");
Expand Down

0 comments on commit 8e3c070

Please sign in to comment.