Skip to content

Commit 9eade76

Browse files
committed
Add Steam path fixup
Signed-off-by: Isaac Marovitz <[email protected]>
1 parent ec5a388 commit 9eade76

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Source/Libraries/HedgeModManager.Steam/SteamLocator.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,22 @@ public List<SteamGame> Locate()
8686
continue;
8787
}
8888

89+
// Paths will be encoded by Windows steam and will need to be adapted for macOS Paths.
90+
// C:\ is equivalent to the Wine prefix.
91+
// Any other drive letter should be removed and treated as raw Unix path.
92+
if (OperatingSystem.IsMacOS())
93+
{
94+
if (path.StartsWith(@"C:\"))
95+
{
96+
path = SteamInstallPath;
97+
}
98+
else
99+
{
100+
// Remove drive letter and replace slashes
101+
path = path[2..].Replace(@"\", "/");
102+
}
103+
}
104+
89105
var libPath = Path.Combine(path, "steamapps");
90106
foreach (var app in apps)
91107
{

0 commit comments

Comments
 (0)