From d4ed61d13d25b46fb9f5be5e893a59adac9aa85b Mon Sep 17 00:00:00 2001 From: Rechi Date: Sat, 25 Mar 2017 10:22:48 +0100 Subject: [windows] use wmic qfe instead of powershell to check if hotfix is installed --- project/Win32BuildSetup/genNsisInstaller.nsi | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'project') diff --git a/project/Win32BuildSetup/genNsisInstaller.nsi b/project/Win32BuildSetup/genNsisInstaller.nsi index e94ec71bee..f7c0a3764c 100644 --- a/project/Win32BuildSetup/genNsisInstaller.nsi +++ b/project/Win32BuildSetup/genNsisInstaller.nsi @@ -354,14 +354,17 @@ Function .onInit StrCpy $HotFixID "" ${Endif} ${If} $HotFixID != "" - SetOutPath "$TEMP\PS" - FileOpen $0 ps.ps1 w - FileWrite $0 "Get-HotFix -Id KB$HotFixID -ea SilentlyContinue" - FileClose $0 - nsExec::ExecToStack 'powershell -noprofile -inputformat none -ExecutionPolicy RemoteSigned -File "$TEMP\PS\ps.ps1"' + nsExec::ExecToStack 'cmd /Q /C "%SYSTEMROOT%\System32\wbem\wmic.exe /?"' + Pop $0 ; return value (it always 0 even if an error occured) + Pop $1 ; command output + ${If} $0 != 0 + ${OrIf} $1 == "" + MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST|MB_SETFOREGROUND "Unable to run the Windows program wmic.exe to verify that Windows Update KB$HotFixID is installed.$\nWmic is not installed correctly.$\nPlease fix this issue and try again to install Kodi." + Quit + ${EndIf} + nsExec::ExecToStack 'cmd /Q /C "%SYSTEMROOT%\System32\wbem\wmic.exe qfe get hotfixid | findstr "^KB$HotFixID[^0-9]""' Pop $0 ; return value (it always 0 even if an error occured) Pop $1 ; command output - RMDir /r "$TEMP\PS" ${If} $0 != 0 ${OrIf} $1 == "" MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST|MB_SETFOREGROUND "Platform Update for Windows (KB$HotFixID) is required.$\nDownload and install Platform Update for Windows then run setup again." -- cgit v1.2.3