Skip to content

Commit

Permalink
Updater crash fix
Browse files Browse the repository at this point in the history
- Hotfix for older updates to work with new updater.
  • Loading branch information
TCNOco committed Jun 28, 2021
1 parent b4146cc commit d088af6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion TcNo-Acc-Switcher-Globals/Globals.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class Globals
#pragma warning disable CA2211 // Non-constant fields should not be visible - This is necessary due to it being a launch parameter.
public static bool VerboseMode;
#pragma warning restore CA2211 // Non-constant fields should not be visible
public static readonly string Version = "2021-06-28_01";
public static readonly string Version = "2021-06-28_02";
public static readonly string[] PlatformList = {"Steam", "Origin", "Ubisoft", "BattleNet", "Epic", "Riot"};

#region LOGGER
Expand Down
6 changes: 4 additions & 2 deletions TcNo-Acc-Switcher-Updater/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -867,8 +867,10 @@ private static void ApplyPatches(string oldFolder, string outputFolder)
foreach (var p in _patchList)
{
var relativePath = p.Remove(0, p.Split("\\")[0].Length + 1);
var patchFile = Path.Join(outputFolder, "patches", relativePath);
var patchedFile = Path.Join(outputFolder, "patched", relativePath);
var patchFile = Path.Join(outputFolder, "patches", relativePath); // Necessary fix for pre 2021-06-28_01 versions to update using this new updater.
if (relativePath.StartsWith("wwwroot"))
relativePath = relativePath.Replace("wwwroot", "originalwwwroot");
var patchedFile = Path.Join(outputFolder, "patched", relativePath);
Directory.CreateDirectory(Path.GetDirectoryName(patchedFile)!);
DoDecode(Path.Join(oldFolder, relativePath), patchFile, patchedFile);
}
Expand Down

0 comments on commit d088af6

Please sign in to comment.