Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions Celeste_Launcher_Gui/Helpers/Steam.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,31 @@ public static class Steam
{
private const string AOEOnlineExecutableName = "AOEOnline.exe";
private const string CelesteLauncherExecutableName = "Celeste Launcher.exe";
private const string CelesteLauncherExecutableNameCopy = "Celeste Launcher.exe.copy";

public static void ConvertToSteam(string gameBasePath)
{
var celesteLauncherExePath = Path.Combine(gameBasePath, CelesteLauncherExecutableName);
var celesteLauncherExeCopy = Path.Combine(gameBasePath, CelesteLauncherExecutableNameCopy);
var aoeoOnlineExePath = Path.Combine(gameBasePath, AOEOnlineExecutableName);

Misc.MoveFile(celesteLauncherExePath, aoeoOnlineExePath);
OverwriteFile(celesteLauncherExePath, celesteLauncherExeCopy);
Misc.MoveFile(celesteLauncherExeCopy, aoeoOnlineExePath);

var celesteLauncherExeConfigPath = Path.Combine(gameBasePath, $"{CelesteLauncherExecutableName}.config");
var celesteLauncherExeConfigPathCopy = Path.Combine(gameBasePath, $"{CelesteLauncherExecutableNameCopy}.config");
var aoeoOnlineExeConfigPath = Path.Combine(gameBasePath, $"{AOEOnlineExecutableName}.config");
Misc.MoveFile(celesteLauncherExeConfigPath, aoeoOnlineExeConfigPath);

OverwriteFile(celesteLauncherExeConfigPath, celesteLauncherExeConfigPathCopy);
Misc.MoveFile(celesteLauncherExeConfigPathCopy, aoeoOnlineExeConfigPath);
}

private static void OverwriteFile(string source, string target)
{
if (File.Exists(target))
File.Delete(target);

File.Copy(source, target);
}
}
}