Skip to content

Commit

Permalink
[ModSupport] Fixed launching issues on Steam
Browse files Browse the repository at this point in the history
  • Loading branch information
wannkunstbeikor committed Jul 26, 2023
1 parent 521cc32 commit 7f27afe
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion FrostyModSupport/FrostyModExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1787,7 +1787,21 @@ public int Run(FileSystem inFs, CancellationToken cancelToken, ILogger inLogger,

try
{
ExecuteProcess($"{fs.BasePath + ProfilesLibrary.ProfileName}.exe", $"-dataPath \"{modDataPath.Trim('\\')}\" {additionalArgs}");
string steamAppIdPath = $"{fs.BasePath}steam_appid.txt";
if (File.Exists(steamAppIdPath))
{
string steamAppId = File.ReadAllLines(steamAppIdPath).First();
string arguments = $"-dataPath \"{modDirName.Replace('\\', '/')}\" {additionalArgs}";
string url = Uri.EscapeDataString(arguments);
App.Logger.Log($"Launch: {arguments}");
App.Logger.Log($"Encoded: {url}");
Process.Start($"steam://run/{steamAppId}//{url}/");
}
else
{
ExecuteProcess($"{fs.BasePath + ProfilesLibrary.ProfileName}.exe", $"-dataPath \"{modDataPath.Trim('\\')}\" {additionalArgs}");
}

}
catch (Exception ex)
{
Expand Down

0 comments on commit 7f27afe

Please sign in to comment.