Skip to content

Commit

Permalink
Improve: Also default to drive root if desktop path contains non-ASCI…
Browse files Browse the repository at this point in the history
…I characters
  • Loading branch information
Sewer56 committed Nov 30, 2024
1 parent cca4ea2 commit caeb468
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions source/Reloaded.Mod.Installer.Lib/Settings.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
namespace Reloaded.Mod.Installer.Lib;
using System.Linq;
namespace Reloaded.Mod.Installer.Lib;

/// <summary>
/// Settings for the installer.
Expand Down Expand Up @@ -34,7 +35,8 @@ public static Settings GetSettings(string[] args)
private static string GetSafeInstallPath()
{
var installPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
if (installPath.Contains("OneDrive"))
bool hasNonAsciiChars = installPath.Any(c => c > 127);
if (installPath.Contains("OneDrive") || hasNonAsciiChars)
{
var driveRoot = Path.GetPathRoot(Environment.SystemDirectory);
if (driveRoot == null)
Expand Down

0 comments on commit caeb468

Please sign in to comment.