From 9b7051eb27ad88efd1ade2505eb6f9533b86043b Mon Sep 17 00:00:00 2001 From: guimafelipe Date: Tue, 25 Nov 2025 13:20:32 -0800 Subject: [PATCH 1/3] Creating nuget directory if it does not exist --- tools/DevCheck/DevCheck.ps1 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/DevCheck/DevCheck.ps1 b/tools/DevCheck/DevCheck.ps1 index fc810f8e7f..d4fc6affc3 100644 --- a/tools/DevCheck/DevCheck.ps1 +++ b/tools/DevCheck/DevCheck.ps1 @@ -1964,6 +1964,13 @@ function Install-NugetExe $url = 'https://dist.nuget.org/win-x86-commandline/latest/nuget.exe' $file = [IO.Path]::GetFullPath($NugetExe) + + # Create directory if it doesn't exist + if (-not(Test-Path -Path ([IO.Path]::GetDirectoryName($file)) -PathType Container)) + { + $null = New-Item -ItemType Directory -Path ([IO.Path]::GetDirectoryName($file)) + } + Write-Host "Downloading nuget.exe from $url..." Write-Verbose "Executing: curl.exe --output $file -L -# $url" $null = Start-Process curl.exe -ArgumentList "--output $file -L -# $url" -Wait -NoNewWindow -PassThru From 50f432124a3c6ae46584c976990deec47780bf6e Mon Sep 17 00:00:00 2001 From: guimafelipe Date: Tue, 25 Nov 2025 13:27:21 -0800 Subject: [PATCH 2/3] Using variable to reduce computations --- tools/DevCheck/DevCheck.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/DevCheck/DevCheck.ps1 b/tools/DevCheck/DevCheck.ps1 index d4fc6affc3..1838632038 100644 --- a/tools/DevCheck/DevCheck.ps1 +++ b/tools/DevCheck/DevCheck.ps1 @@ -1966,9 +1966,10 @@ function Install-NugetExe $file = [IO.Path]::GetFullPath($NugetExe) # Create directory if it doesn't exist - if (-not(Test-Path -Path ([IO.Path]::GetDirectoryName($file)) -PathType Container)) + $fileDir = [IO.Path]::GetDirectoryName($file) + if (-not(Test-Path -Path $fileDir -PathType Container)) { - $null = New-Item -ItemType Directory -Path ([IO.Path]::GetDirectoryName($file)) + $null = New-Item -ItemType Directory -Path $fileDir } Write-Host "Downloading nuget.exe from $url..." From f5a9c8cc3ffd00f88e3ebf6a30bc38ac693ff1ec Mon Sep 17 00:00:00 2001 From: guimafelipe Date: Mon, 8 Dec 2025 09:47:51 -0800 Subject: [PATCH 3/3] Fixing original nuget.exe path and implementing recommended changes --- tools/DevCheck/DevCheck.ps1 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tools/DevCheck/DevCheck.ps1 b/tools/DevCheck/DevCheck.ps1 index 1838632038..7e4028d3d2 100644 --- a/tools/DevCheck/DevCheck.ps1 +++ b/tools/DevCheck/DevCheck.ps1 @@ -166,7 +166,7 @@ Param( [Switch]$NoInteractive=$false, - [String]$NugetExe='.user\nuget.exe', + [String]$NugetExe="$PSScriptRoot\..\..\.user\nuget.exe", [String]$NugetMinVersion="6.14.0.116", @@ -1965,11 +1965,13 @@ function Install-NugetExe $url = 'https://dist.nuget.org/win-x86-commandline/latest/nuget.exe' $file = [IO.Path]::GetFullPath($NugetExe) - # Create directory if it doesn't exist + # Check if the directory exists $fileDir = [IO.Path]::GetDirectoryName($file) if (-not(Test-Path -Path $fileDir -PathType Container)) { - $null = New-Item -ItemType Directory -Path $fileDir + Write-Host "...ERROR: $fileDir doesn't exist" -ForegroundColor Red -BackgroundColor Black + $global:issues++ + return $false } Write-Host "Downloading nuget.exe from $url..." @@ -2051,6 +2053,10 @@ Write-Verbose "Processor...$cpu" $project_root = Get-ProjectRoot Write-Output "Windows App SDK location...$project_root" +# Ensure .temp and .user exist +$null = Get-TempPath +$null = Get-UserPath + if (($CheckAll -ne $false) -Or ($ShowSystemInfo -ne $false)) { Get-SystemInfo