diff --git a/windows/installer.nsi b/windows/installer.nsi --- a/windows/installer.nsi +++ b/windows/installer.nsi @@ -402,6 +402,7 @@ doAbort: Abort skip: + call notifyUserIfHotfixNeeded FunctionEnd Function RegisterCapabilities @@ -491,3 +492,20 @@ StrCmp $installAsPortable "YES" 0 +2 Abort 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 diff --git a/windows/strings.nsh b/windows/strings.nsh --- a/windows/strings.nsh +++ b/windows/strings.nsh @@ -37,3 +37,5 @@ !define MSG_InvalidInstallPath "Install path invalid!" !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?"