Skip to content

Commit 70e30ea

Browse files
add alternate check for older java versions
1 parent ed331ea commit 70e30ea

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

softwareupdaterXL.bat

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ TITLE SW-Updater-Script
66

77

88
:install-java-8
9-
(for %%a IN (jre-8u*-windows-i586.exe) DO echo %%a && wmic product where "name like 'Java 8%%'" call uninstall && %%a /s && del %%a )
9+
if exist "%SYSTEMROOT%\System32\wbem\WMIC.exe" (
10+
set JAVA_UNINSTALL_COMMAND=wmic product where "name like 'Java 8%%'" call uninstall
11+
) else (
12+
set JAVA_UNINSTALL_COMMAND=powershell -Command "Get-CimInstance -ClassName Win32_Product -Filter \"Name LIKE 'Java 8%'\" | ForEach-Object { $_.Uninstall() }"
13+
)
14+
(for %%a IN (jre-8u*-windows-i586.exe) DO echo %%a && %JAVA_UNINSTALL_COMMAND% && %%a /s && del %%a )
1015
(for %%a IN (jre-8u*-windows-x64.exe) DO echo %%a && %%a /s && del %%a )
1116

1217
:install-7zip

0 commit comments

Comments
 (0)