Skip to content

Commit

Permalink
Exe in game path are bad
Browse files Browse the repository at this point in the history
  • Loading branch information
Sora-yx committed Feb 4, 2025
1 parent 2aab58c commit bb81944
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
11 changes: 11 additions & 0 deletions SA-Mod-Manager/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,17 @@ protected override async void OnStartup(StartupEventArgs e)

}

//todo delete on next update
public static void RemoveExeFromPath()
{
if (Util.IsStringValid(App.CurrentGame?.gameDirectory))
{
if (App.CurrentGame.gameDirectory.Contains(".exe"))
{
App.CurrentGame.gameDirectory = Path.GetDirectoryName(App.CurrentGame.gameDirectory);
}
}
}
public static void UpdateDependenciesLocation()
{
if (Directory.Exists(App.extLibPath) == false && Directory.Exists(App.oldExtLibPath))
Expand Down
2 changes: 1 addition & 1 deletion SA-Mod-Manager/GamesInstall.cs
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ public static void AddGamesInstall()
if (File.Exists(path) && !App.GamesList.Contains(game))
{
Logger.Log("Found Game locally!");
game.gameDirectory = path;
game.gameDirectory = App.StartDirectory;
App.GamesList.Add(game);
AddMissingGamesList(game);
}
Expand Down
8 changes: 6 additions & 2 deletions SA-Mod-Manager/Management/ProfileManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ private static bool CheckProfileDirectory()
if (GamesInstall.IsGameListEmpty())
return false;

if (!Directory.Exists(ProfilesDirectory))
App.RemoveExeFromPath();

if (!Directory.Exists(ProfilesDirectory))
{
try
{
Expand Down Expand Up @@ -391,7 +393,9 @@ public static void ValidateProfileFolder()
return;
}

Logger.Log($"Is Portable Mode: {SettingsManager.IsPortableMode()}");
App.RemoveExeFromPath();

Logger.Log($"Is Portable Mode: {SettingsManager.IsPortableMode()}");
Logger.Log($"Old Profile Directory: {App.CurrentGame.ProfilesDirectory}");
Logger.Log($"New Profile Directory: {ProfilesDirectory}");

Expand Down

0 comments on commit bb81944

Please sign in to comment.