Fix a very rare edge case of someone running Windows on a non-C: drive letter

This commit is contained in:
DrakiaXYZ 2024-04-04 19:45:53 -07:00
parent 973d8872b6
commit 262d185203
2 changed files with 4 additions and 2 deletions

View File

@ -33,7 +33,8 @@ public class Net8PreCheck : PreCheckBase
try 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) if (!result.Succeeded)
{ {

View File

@ -33,7 +33,8 @@ public class NetCore6PreCheck : PreCheckBase
try 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) if (!result.Succeeded)
{ {