diff options
author | Rechi <Rechi@users.noreply.github.com> | 2017-04-02 22:32:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-02 22:32:09 +0200 |
commit | 4ae41449773441226c4d70b041f6ec9dff86700f (patch) | |
tree | 545af449f9ed7b786a012facedce9ccb2469e542 | |
parent | f8d6cd1f3cf8b32e628062c1f8ecaec8f3ec9b42 (diff) | |
parent | 48aa3ecb2ae674af2b7b5feb346b4e16827450a5 (diff) |
Merge pull request #11897 from Rechi/fixWinSetupKBKrypton
[windows] use wmic qfe instead of powershell to check if hotfix is installed
-rw-r--r-- | project/Win32BuildSetup/genNsisInstaller.nsi | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/project/Win32BuildSetup/genNsisInstaller.nsi b/project/Win32BuildSetup/genNsisInstaller.nsi index 924edbdd92..a52408bff7 100644 --- a/project/Win32BuildSetup/genNsisInstaller.nsi +++ b/project/Win32BuildSetup/genNsisInstaller.nsi @@ -353,14 +353,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." |