1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

Windows: Warn user about needed hotfix

BUG: 394905
FIXED-IN: 3.0.2
This commit is contained in:
Razi Alavizadeh 2018-06-06 23:42:08 +04:30
parent cd15b7008c
commit 29fbbf5dc4
2 changed files with 20 additions and 0 deletions

View File

@ -402,6 +402,7 @@ Function .onInit
doAbort: doAbort:
Abort Abort
skip: skip:
call notifyUserIfHotfixNeeded
FunctionEnd FunctionEnd
Function RegisterCapabilities Function RegisterCapabilities
@ -491,3 +492,20 @@ Function SkipComponentsIfPortableInstalltion
StrCmp $installAsPortable "YES" 0 +2 StrCmp $installAsPortable "YES" 0 +2
Abort Abort
FunctionEnd FunctionEnd
Function notifyUserIfHotfixNeeded
; check if Windows 10 family. Taken from: http://nsis.sourceforge.net/Get_Windows_version
ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentMajorVersionNumber
StrCmp $R0 '' 0 skiphotfixwarn
ClearErrors
nsExec::ExecToStack 'cmd /Q /C "%SYSTEMROOT%\System32\wbem\wmic.exe qfe get hotfixid | %SYSTEMROOT%\System32\findstr.exe "^KB2999226""'
Pop $0 ; return value (it always 0 even if an error occured)
Pop $1 ; command output KB2999226
StrCmp $1 "" 0 skiphotfixwarn
MessageBox MB_YESNO|MB_ICONQUESTION "${MSG_HotfixNeeded}" IDNO +2
ExecShell open "https://support.microsoft.com/en-us/help/2999226/update-for-universal-c-runtime-in-windows"
skiphotfixwarn:
FunctionEnd

View File

@ -37,3 +37,5 @@
!define MSG_InvalidInstallPath "Install path invalid!" !define MSG_InvalidInstallPath "Install path invalid!"
!define MSG_PortableWriteError "Error occurred when creating 'falkon.conf' in installation folder. Create it manually." !define MSG_PortableWriteError "Error occurred when creating 'falkon.conf' in installation folder. Create it manually."
!define MSG_HotfixNeeded "To run Falkon you have to install hotfix 'KB2999226'. Proceed to Windows update website?"