Skip to content

Commit

Permalink
[windows] use wmic qfe instead of powershell to check if hotfix is in…
Browse files Browse the repository at this point in the history
…stalled
  • Loading branch information
Rechi committed Mar 23, 2017
1 parent fc1619b commit 36abacf
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions project/Win32BuildSetup/genNsisInstaller.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -353,14 +353,9 @@ 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 "wmic 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."
Expand Down

0 comments on commit 36abacf

Please sign in to comment.