Skip to content

Commit 2aa3fb3

Browse files
committed
Make sure InstallLocation path is formatted correctly
1 parent 86fd022 commit 2aa3fb3

File tree

13 files changed

+32
-41
lines changed

13 files changed

+32
-41
lines changed

Assets/Scripts/txintdelay.ps1

Lines changed: 0 additions & 12 deletions
This file was deleted.

Helpers/GPU/NvidiaHelper.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
using AutoOS.Views.Installer.Actions;
22
using System.Diagnostics;
3-
using System.Net;
43
using System.Net.Security;
54
using System.Text.Json;
65
using Windows.Win32.System.Power;
76
using Windows.Win32;
8-
7+
using System.Net.Http.Headers;
8+
using System.Security.Authentication;
99
namespace AutoOS.Helpers.GPU
1010
{
1111
public static class NvidiaHelper
@@ -14,17 +14,17 @@ public static class NvidiaHelper
1414
{
1515
SslOptions = new SslClientAuthenticationOptions
1616
{
17-
EnabledSslProtocols = System.Security.Authentication.SslProtocols.Tls12 | System.Security.Authentication.SslProtocols.Tls13
17+
EnabledSslProtocols = SslProtocols.Tls12 | SslProtocols.Tls13
1818
}
1919
})
2020
{
2121
DefaultRequestHeaders =
22-
{
23-
UserAgent =
2422
{
25-
new System.Net.Http.Headers.ProductInfoHeaderValue("AutoOS", ProcessInfoHelper.Version)
23+
UserAgent =
24+
{
25+
new ProductInfoHeaderValue("AutoOS", ProcessInfoHelper.Version)
26+
}
2627
}
27-
}
2828
};
2929

3030
public static async Task<(string newestVersion, string newestDownloadUrl)> CheckUpdate(GpuInfo gpu)

Helpers/Games/CitronHelper.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public static async Task LoadGames()
6767
string cleanName = CleanNameRegex().Replace(name.Replace('’', '\''), "");
6868

6969
// get install location
70-
string installLocation = CitronEntry.GetProperty("file_path").GetString();
70+
string installLocation = CitronEntry.GetProperty("file_path").GetString()?.Replace("/", "\\");
7171

7272
// get playtime
7373
string playTime = "0m";
@@ -99,8 +99,8 @@ public static async Task LoadGames()
9999
GamesPage.Instance.Games.Items.Add(new Views.Settings.Games.HeaderCarouselItem
100100
{
101101
Launcher = "Citron",
102-
LauncherLocation = localSettings.Values["CitronLocation"]?.ToString(),
103-
DataLocation = localSettings.Values["CitronDataLocation"]?.ToString(),
102+
LauncherLocation = localSettings.Values["CitronLocation"]?.ToString()?.Replace("/", "\\"),
103+
DataLocation = localSettings.Values["CitronDataLocation"]?.ToString()?.Replace("/", "\\"),
104104
GameLocation = installLocation,
105105
InstallLocation = Path.GetDirectoryName(installLocation),
106106
Title = name,

Helpers/Games/EdenHelper.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public static async Task LoadGames()
6868
string cleanName = CleanNameRegex().Replace(name.Replace('’', '\''), "");
6969

7070
// get install location
71-
string installLocation = edenEntry.GetProperty("file_path").GetString();
71+
string installLocation = edenEntry.GetProperty("file_path").GetString()?.Replace("/", "\\");
7272

7373
// get playtime
7474
string playTime = "0m";
@@ -100,8 +100,8 @@ public static async Task LoadGames()
100100
GamesPage.Instance.Games.Items.Add(new Views.Settings.Games.HeaderCarouselItem
101101
{
102102
Launcher = "Eden",
103-
LauncherLocation = localSettings.Values["EdenLocation"]?.ToString(),
104-
DataLocation = localSettings.Values["EdenDataLocation"]?.ToString(),
103+
LauncherLocation = localSettings.Values["EdenLocation"]?.ToString()?.Replace("/", "\\"),
104+
DataLocation = localSettings.Values["EdenDataLocation"]?.ToString()?.Replace("/", "\\"),
105105
GameLocation = installLocation,
106106
InstallLocation = Path.GetDirectoryName(installLocation),
107107
Title = name,

Helpers/Games/EpicGamesHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -640,9 +640,9 @@ public static async Task LoadGames()
640640
CatalogNamespace = catalogNamespace,
641641
CatalogItemId = catalogItemId,
642642
AppName = itemJson["MainGameAppName"]?.GetValue<string>(),
643-
InstallLocation = itemJson["InstallLocation"]?.GetValue<string>(),
643+
InstallLocation = itemJson["InstallLocation"]?.GetValue<string>()?.Replace("/", "\\"),
644644
LaunchCommand = itemJson["LaunchCommand"]?.GetValue<string>(),
645-
LaunchExecutable = itemJson["LaunchExecutable"]?.GetValue<string>(),
645+
LaunchExecutable = itemJson["LaunchExecutable"]?.GetValue<string>()?.Replace("/", "\\"),
646646
ProcessNames = itemJson["ProcessNames"]?.AsArray().Select(p => p.GetValue<string>()).ToList(),
647647
ArtifactId = artifactId,
648648
UpdateIsAvailable = latestVersion != null && latestVersion != currentVersion,

Helpers/Games/RyujinxHelper.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public static async Task LoadGames()
9898
{
9999
var simpleFileName = SimpleCleanNameRegex().Replace(Path.GetFileNameWithoutExtension(candidate).ToLowerInvariant(), "");
100100
return simpleFileName.StartsWith(simpleCleanName, StringComparison.Ordinal);
101-
}));
101+
}))?.Replace("/", "\\");
102102
if (bestInstallLocation != null)
103103
break;
104104
}
@@ -135,8 +135,8 @@ public static async Task LoadGames()
135135
GamesPage.Instance.Games.Items.Add(new Views.Settings.Games.HeaderCarouselItem
136136
{
137137
Launcher = "Ryujinx",
138-
LauncherLocation = localSettings.Values["RyujinxLocation"]?.ToString(),
139-
DataLocation = localSettings.Values["RyujinxDataLocation"]?.ToString(),
138+
LauncherLocation = localSettings.Values["RyujinxLocation"]?.ToString()?.Replace("/", "\\"),
139+
DataLocation = localSettings.Values["RyujinxDataLocation"]?.ToString()?.Replace("/", "\\"),
140140
GameLocation = bestInstallLocation,
141141
InstallLocation = Path.GetDirectoryName(bestInstallLocation),
142142
Title = name,

Helpers/Games/SteamHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ public static async Task LoadGames()
258258
.Select(s => s.GetProperty("path_thumbnail").GetString())
259259
.Where(s => !string.IsNullOrWhiteSpace(s))]
260260
: [],
261-
InstallLocation = Path.Combine(steamAppsDir, "common", appManifestData["installdir"]?.ToString()),
261+
InstallLocation = Path.Combine(steamAppsDir, "common", appManifestData["installdir"]?.ToString()).Replace("/", "\\"),
262262
ReleaseDate = releaseDate.ToString("d"),
263263
Size = sizeBytes >= 1024 * 1024 * 1024
264264
? $"{sizeBytes.Value / (1024d * 1024d * 1024d):F1} GB"

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ AutoOS is a WinUI 3 application that automates Windows setup and optimization wi
7979
- Toggle Windows Security Options
8080
- Toggle Windows Updates and set target version
8181
- Custom Game Launcher supporting Epic Games, Steam, Riot Games, Eden, Citron and Ryujinx
82+
- Check for Epic Games title updates
8283
- Launch Games, Stop Processes and Restart Processes when done
8384
- Switch between Epic Games and Steam Accounts
8485

@@ -256,7 +257,7 @@ Clone the repository and run this in the terminal inside of Visual Studio.
256257
dotnet nuget add source https://pkgs.dev.azure.com/dotnet/CommunityToolkit/_packaging/CommunityToolkit-Labs/nuget/v3/index.json -n CommunityToolkit-Labs
257258
```
258259

259-
If the debugger is not attaching to the process you are required to set EnableLua to 0. This has been a problem for 5 years and Microsoft hasn't provided a fix:
260+
If the debugger is not attaching to the process, you are required to set EnableLua to 0 and restart your PC. This has been a problem for 5 years and Microsoft hasn't provided a fix:
260261
```bat
261262
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v EnableLUA /t REG_DWORD /d 0 /f
262263
```

Views/Installer/GraphicsPage.xaml.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,10 @@ public void GetGpus()
8989
catch { }
9090
}
9191

92-
var detected = GpuHelper.GetGPUs();
92+
var detectedGpus = GpuHelper.GetGPUs();
93+
detectedGpus = detectedGpus.OrderBy(g => g.Location).ToList();
9394

94-
foreach (var gpu in detected)
95+
foreach (var gpu in detectedGpus)
9596
{
9697
var saved = savedGpus?.FirstOrDefault(x => x.PnPDeviceId == gpu.PnPDeviceId);
9798

Views/Installer/Stages/NetworkStage.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
using AutoOS.Views.Installer.Actions;
1+
using AutoOS.Helpers.Device;
2+
using AutoOS.Views.Installer.Actions;
23
using Microsoft.UI.Xaml.Media;
34
using WinRT.Interop;
5+
using Microsoft.Win32;
46

57
namespace AutoOS.Views.Installer.Stages;
68

@@ -44,8 +46,8 @@ public static async Task Run()
4446
// disable power management settings
4547
("Disabling power management settings", async () => await ProcessActions.RunPowerShellScript("networkpowermanagement.ps1", ""), null),
4648

47-
// set txintdelay to 0
48-
("Setting TxIntDelay to 0", async () => await ProcessActions.RunPowerShellScript("txintdelay.ps1", ""), () => TxIntDelay == true),
49+
// set txintdelay to 0
50+
("Setting TxIntDelay to 0", async () => DeviceHelper.GetDevices(DeviceType.NIC).Where(d => Registry.LocalMachine.OpenSubKey(d.RegistryPath).GetValue("TxIntDelay") != null).ToList().ForEach(d => Registry.LocalMachine.OpenSubKey(d.RegistryPath, true).SetValue("TxIntDelay", 0, RegistryValueKind.DWord)), () => TxIntDelay == true),
4951

5052
// set "congestion control provider" to "bbr2"
5153
(@"Setting ""Congestion Control Provider"" to ""BBR2""", async () => await ProcessActions.RunNsudo("TrustedInstaller", @"netsh int tcp set supplemental internet congestionprovider=bbr2"), null),

0 commit comments

Comments
 (0)