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 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 diff --git a/eng/dump.bat b/eng/dump.bat index 7d0ab5c..bbaf537 100644 --- a/eng/dump.bat +++ b/eng/dump.bat @@ -11,12 +11,12 @@ 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 + xcopy /Q /Y "%%~H" ".\dumps\DriverStore\%%~nxG" >nul