From d3c4bfc8f59d6699d76c7ac163bffea6b560909c Mon Sep 17 00:00:00 2001 From: kuuuube Date: Tue, 3 Mar 2026 16:33:42 -0500 Subject: [PATCH 1/4] Add dist to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index cfcdc21..932fc70 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ build/ +dist/ # Generated by Cargo # will have compiled files and executables From e1f8de4fa6a0922a7f572200472246e3b8342231 Mon Sep 17 00:00:00 2001 From: kuuuube Date: Tue, 3 Mar 2026 16:34:21 -0500 Subject: [PATCH 2/4] Avoid build errors if build couldnt be deleted or dist already existed --- build.ps1 | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/build.ps1 b/build.ps1 index cae59da..d1232a9 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1,9 +1,14 @@ cargo build --release if (Test-Path ./build) { - Remove-Item -Path ./build -Recurse + Remove-Item -Path ./build/* -Recurse +} else { + New-Item -Path ./build -ItemType directory > $null +} +if (Test-Path ./dist) { + Remove-Item -Path ./dist/* -Recurse +} else { + New-Item -Path ./dist -ItemType directory > $null } -New-Item -Path ./build -ItemType directory > $null -New-Item -Path ./dist -ItemType directory > $null Copy-Item -Path ./target/release/tabletdrivercleanup.exe -Destination ./build Copy-Item -Path ./eng/dump.bat -Destination ./build Copy-Item -Path ./eng/dry_run.bat -Destination ./build From 2c9b0e270d7f17664e7d48adb74fed5f18f9bd86 Mon Sep 17 00:00:00 2001 From: kuuuube Date: Tue, 3 Mar 2026 16:34:58 -0500 Subject: [PATCH 3/4] Use mkdir instead of md in dump.bat, ignore errors (folder already exists) --- eng/dump.bat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/dump.bat b/eng/dump.bat index 7d0ab5c..0326541 100644 --- a/eng/dump.bat +++ b/eng/dump.bat @@ -11,10 +11,10 @@ tabletdrivercleanup.exe --dump pnputil /enum-drivers > .\dumps\pnputil_drivers.txt pnputil /enum-devices /connected /drivers > .\dumps\pnputil_devices.txt -md .\dumps\DriverStore +mkdir ".\dumps\DriverStore" 2>nul for /D %%G in ("C:\Windows\System32\DriverStore\FileRepository\*") DO ( - md .\dumps\DriverStore\%%~nxG + mkdir ".\dumps\DriverStore\%%~nxG" 2>nul for /F %%H in ("%%~G\*.inf") DO ( xcopy /Q /Y "%%H" .\dumps\DriverStore\%%~nxG > nul Date: Tue, 3 Mar 2026 16:35:09 -0500 Subject: [PATCH 4/4] Fix bad file copying --- eng/dump.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/dump.bat b/eng/dump.bat index 0326541..bbaf537 100644 --- a/eng/dump.bat +++ b/eng/dump.bat @@ -16,7 +16,7 @@ mkdir ".\dumps\DriverStore" 2>nul for /D %%G in ("C:\Windows\System32\DriverStore\FileRepository\*") DO ( mkdir ".\dumps\DriverStore\%%~nxG" 2>nul for /F %%H in ("%%~G\*.inf") DO ( - xcopy /Q /Y "%%H" .\dumps\DriverStore\%%~nxG > nul + xcopy /Q /Y "%%~H" ".\dumps\DriverStore\%%~nxG" >nul