Skip to content

Commit aa79333

Browse files
committed
Allow portable mode for settings if portable_mode.txt is found
1 parent 829eec7 commit aa79333

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

Desktop.Common/DesktopFileService.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,15 @@ public DesktopFileService()
2929
{
3030
throw new NotImplementedException();
3131
}
32-
SettingsBasePath = Path.Combine(OSBasePath, "Z2Randomizer");
32+
var portableFile = Path.Combine(AppContext.BaseDirectory, "portable_mode.txt");
33+
if (File.Exists(portableFile))
34+
{
35+
SettingsBasePath = Path.Combine(AppContext.BaseDirectory, "Settings");
36+
}
37+
else
38+
{
39+
SettingsBasePath = Path.Combine(OSBasePath, "Z2Randomizer");
40+
}
3341
SpriteBasePath = Path.Combine(AppContext.BaseDirectory, "Sprites");
3442
PalacesBasePath = Path.GetDirectoryName(AppContext.BaseDirectory)! + Path.DirectorySeparatorChar;
3543
Directory.CreateDirectory(SpriteBasePath);

0 commit comments

Comments
 (0)