aboutsummaryrefslogtreecommitdiff
path: root/project
diff options
context:
space:
mode:
authorRechi <Rechi@users.noreply.github.com>2017-03-25 10:22:48 +0100
committerRechi <Rechi@users.noreply.github.com>2017-03-25 10:23:37 +0100
commitd4ed61d13d25b46fb9f5be5e893a59adac9aa85b (patch)
treeec41314aefca24865166051fce7c3add1932d08c /project
parent78cce5735bc5a67e7a448bf18c5ac6b1d0ca2326 (diff)
[windows] use wmic qfe instead of powershell to check if hotfix is installed
Diffstat (limited to 'project')
-rw-r--r--project/Win32BuildSetup/genNsisInstaller.nsi15
1 files changed, 9 insertions, 6 deletions
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."