From 29fbbf5dc4cc55102752e20d1f85cbd49ee7333a Mon Sep 17 00:00:00 2001 From: Razi Alavizadeh Date: Wed, 6 Jun 2018 23:42:08 +0430 Subject: [PATCH] Windows: Warn user about needed hotfix BUG: 394905 FIXED-IN: 3.0.2 --- windows/installer.nsi | 18 ++++++++++++++++++ windows/strings.nsh | 2 ++ 2 files changed, 20 insertions(+) diff --git a/windows/installer.nsi b/windows/installer.nsi index 3a13f802c..2d67bf07a 100644 --- a/windows/installer.nsi +++ b/windows/installer.nsi @@ -402,6 +402,7 @@ Function .onInit doAbort: Abort skip: + call notifyUserIfHotfixNeeded FunctionEnd Function RegisterCapabilities @@ -491,3 +492,20 @@ Function SkipComponentsIfPortableInstalltion 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 index b33597e9f..1da4a42a3 100644 --- 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?"