Skip to content

Commit 32028d8

Browse files
committed
Add Steam path fixup
Signed-off-by: Isaac Marovitz <[email protected]>
1 parent 1d52578 commit 32028d8

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
@@ -128,6 +128,22 @@ public List<SteamGame> Locate()
128128
continue;
129129
}
130130

131+
// Paths will be encoded by Windows steam and will need to be adapted for macOS Paths.
132+
// C:\ is equivalent to the Wine prefix.
133+
// Any other drive letter should be removed and treated as raw Unix path.
134+
if (OperatingSystem.IsMacOS())
135+
{
136+
if (path.StartsWith(@"C:\"))
137+
{
138+
path = SteamInstallPath;
139+
}
140+
else
141+
{
142+
// Remove drive letter and replace slashes
143+
path = path[2..].Replace(@"\", "/");
144+
}
145+
}
146+
131147
var libPath = Path.Combine(path, "steamapps");
132148
foreach (var app in apps)
133149
{

0 commit comments

Comments
 (0)