Skip to content

Commit 311bc6d

Browse files
authored
Replace WMIC with PowerShell for CPU architecture detection (#40)
- Replace deprecated WMIC command with modern PowerShell - Use Get-CimInstance instead of WMIC to access Win32_Processor - Maintain compatibility with existing code by keeping same output format - Improve compatibility with newer Windows versions - No changes to core program logic We also update to 2.4.0-dev. Closes #41.
1 parent 69e50fe commit 311bc6d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.3.1-dev
1+
2.4.0-dev

bin/phpsdk_setshell.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ if NOT "%3"=="" SET TOOLSET=%3
6060

6161
rem check OS arch
6262
rem todo: allow user choose host sdk arch (i.e. x64 target can be compiled at x64(native) or x86(cross))
63-
for /f "usebackq tokens=1*" %%i in (`wmic cpu get Architecture /value /format:table ^| findstr /r "[1234567890][1234567890]*"`) do (
63+
for /f "usebackq tokens=*" %%i in (`powershell -NoProfile -Command "Get-CimInstance -ClassName Win32_Processor | Select-Object -ExpandProperty Architecture"`) do (
6464
set PHP_SDK_OS_ARCH_NUM=%%i
6565
)
6666

0 commit comments

Comments
 (0)