Skip to content

Commit

Permalink
FIX: prevents the use of third-party find
Browse files Browse the repository at this point in the history
  • Loading branch information
reksar committed Oct 26, 2023
1 parent 8bf2f8c commit cc6512c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
11 changes: 8 additions & 3 deletions sdk/check-installers.bat
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
@echo off

setlocal

set destination=%~1
if not exist "%destination%" exit /b 1

set count_files=dir /b "%destination%" ^^^| find /c /i
rem The %PATH% to system `find` may be overwritten by third-party utils.
set find=%SystemRoot%\System32\find.exe
if not exist "%find%" (
echo [ERR][%~n0] System `find` not found!
exit /b 2
)

set count_files=dir /b "%destination%" ^^^| "%find%" /c /i
for /f %%i in ('%count_files% ".msi"') do (
for /f %%j in ('%count_files% ".cab"') do (
if %%i GTR 0 (
Expand All @@ -16,6 +21,6 @@ for /f %%i in ('%count_files% ".msi"') do (
) else echo [WARN][%~n0] MSI installers not found.
)
)
exit /b 2
exit /b 3

endlocal
4 changes: 1 addition & 3 deletions sdk/extract-installers.bat
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
@echo off

rem --------------------------------------------------------------------------
rem Extracts the Windows SDK Installers from the [iso] to the [installers] dir.
rem
rem Using:
rem Extracts the Windows SDK Installers from the [iso] to the [installers] dir:
rem
rem extract-installers [iso] [installers]
rem --------------------------------------------------------------------------
Expand Down

0 comments on commit cc6512c

Please sign in to comment.