From 262d18520325264f34ecea1f56437c76715e9a5d Mon Sep 17 00:00:00 2001 From: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com> Date: Thu, 4 Apr 2024 19:45:53 -0700 Subject: [PATCH] Fix a very rare edge case of someone running Windows on a non-C: drive letter --- SPTInstaller/Installer Tasks/PreChecks/Net8PreCheck.cs | 3 ++- SPTInstaller/Installer Tasks/PreChecks/NetCore6PreCheck.cs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/SPTInstaller/Installer Tasks/PreChecks/Net8PreCheck.cs b/SPTInstaller/Installer Tasks/PreChecks/Net8PreCheck.cs index 74ff95c..ac0b590 100644 --- a/SPTInstaller/Installer Tasks/PreChecks/Net8PreCheck.cs +++ b/SPTInstaller/Installer Tasks/PreChecks/Net8PreCheck.cs @@ -33,7 +33,8 @@ public class Net8PreCheck : PreCheckBase try { - var result = ProcessHelper.RunAndReadProcessOutputs(@"C:\Program Files\dotnet\dotnet.exe", "--list-runtimes"); + var programFiles = Environment.ExpandEnvironmentVariables("%ProgramW6432%"); + var result = ProcessHelper.RunAndReadProcessOutputs($@"{programFiles}\dotnet\dotnet.exe", "--list-runtimes"); if (!result.Succeeded) { diff --git a/SPTInstaller/Installer Tasks/PreChecks/NetCore6PreCheck.cs b/SPTInstaller/Installer Tasks/PreChecks/NetCore6PreCheck.cs index bb2e996..83fad6d 100644 --- a/SPTInstaller/Installer Tasks/PreChecks/NetCore6PreCheck.cs +++ b/SPTInstaller/Installer Tasks/PreChecks/NetCore6PreCheck.cs @@ -33,7 +33,8 @@ public class NetCore6PreCheck : PreCheckBase try { - var result = ProcessHelper.RunAndReadProcessOutputs(@"C:\Program Files\dotnet\dotnet.exe", "--list-runtimes"); + var programFiles = Environment.ExpandEnvironmentVariables("%ProgramW6432%"); + var result = ProcessHelper.RunAndReadProcessOutputs($@"{programFiles}\dotnet\dotnet.exe", "--list-runtimes"); if (!result.Succeeded) {