From 6590011ef155debeb89990cb2e1a143f8dd02f97 Mon Sep 17 00:00:00 2001 From: David Sparer Date: Thu, 4 Aug 2016 13:36:08 -0600 Subject: [PATCH 1/2] Refactored the CustomActions for checking if a KB is installed. Made it more generic --- .../CustomActions/CustomActions.cs | 10 ++++++- .../CustomActions/CustomActions.csproj | 2 +- ...ersionChecker.cs => InstalledKbChecker.cs} | 28 ++++++++++--------- 3 files changed, 25 insertions(+), 15 deletions(-) rename InstallerProjects/CustomActions/{RdpVersionChecker.cs => InstalledKbChecker.cs} (53%) diff --git a/InstallerProjects/CustomActions/CustomActions.cs b/InstallerProjects/CustomActions/CustomActions.cs index 00c73fea..c8e3242d 100644 --- a/InstallerProjects/CustomActions/CustomActions.cs +++ b/InstallerProjects/CustomActions/CustomActions.cs @@ -7,7 +7,15 @@ namespace CustomActions [CustomAction] public static ActionResult IsMinimumRdpVersionInstalled(Session session) { - var rdpVersionChecker = new RdpVersionChecker(session); + var rdpVersionChecker = new InstalledKbChecker("MINIMUM_RDP_KB", "MINIMUM_RDP_VERSION_INSTALLED", session); + rdpVersionChecker.Execute(); + return ActionResult.Success; + } + + [CustomAction] + public static ActionResult IsRdpDtlsUpdateInstalled(Session session) + { + var rdpVersionChecker = new InstalledKbChecker("RDP_DTLS_KB", "RDP_DTLS_UPDATE_INSTALLED", session); rdpVersionChecker.Execute(); return ActionResult.Success; } diff --git a/InstallerProjects/CustomActions/CustomActions.csproj b/InstallerProjects/CustomActions/CustomActions.csproj index dd3a949a..cf1d5043 100644 --- a/InstallerProjects/CustomActions/CustomActions.csproj +++ b/InstallerProjects/CustomActions/CustomActions.csproj @@ -47,7 +47,7 @@ - + diff --git a/InstallerProjects/CustomActions/RdpVersionChecker.cs b/InstallerProjects/CustomActions/InstalledKbChecker.cs similarity index 53% rename from InstallerProjects/CustomActions/RdpVersionChecker.cs rename to InstallerProjects/CustomActions/InstalledKbChecker.cs index 111b4ec3..3a9fb5a3 100644 --- a/InstallerProjects/CustomActions/RdpVersionChecker.cs +++ b/InstallerProjects/CustomActions/InstalledKbChecker.cs @@ -3,14 +3,16 @@ using Microsoft.Deployment.WindowsInstaller; namespace CustomActions { - public class RdpVersionChecker + public class InstalledKbChecker { private readonly Session _session; - private const string MinimumVersionInstalledReturnVar = "MINIMUM_RDP_VERSION_INSTALLED"; - private const string MinimumRdpKbVariable = "MINIMUM_RDP_KB"; + private readonly string _kbVariable; + private readonly string _returnVar; - public RdpVersionChecker(Session session) + public InstalledKbChecker(string kbVariable, string returnVar, Session session) { + _kbVariable = kbVariable; + _returnVar = returnVar; _session = session; } @@ -18,11 +20,11 @@ namespace CustomActions { try { - _session.Log("Begin IsMinimumRdpVersionInstalled"); - var minimumKb = _session[MinimumRdpKbVariable]; + _session.Log("Begin InstalledKbChecker"); + var minimumKb = _session[_kbVariable]; var isUpdateInstalled = IsUpdateInstalled(minimumKb); SetReturnValue(isUpdateInstalled); - _session.Log("End IsMinimumRdpVersionInstalled"); + _session.Log("End InstalledKbChecker"); return true; } catch (Exception e) @@ -32,20 +34,20 @@ namespace CustomActions } } - private bool IsUpdateInstalled(string minimumKb) + private bool IsUpdateInstalled(string kb) { - _session.Log("Checking if '{0}' is installed", minimumKb); + _session.Log($"Checking if '{kb}' is installed"); var updateGatherer = new InstalledWindowsUpdateGatherer(); - var isUpdateInstalled = updateGatherer.IsUpdateInstalled(minimumKb); - _session.Log("KB is installed = '{0}'", isUpdateInstalled); + var isUpdateInstalled = updateGatherer.IsUpdateInstalled(kb); + _session.Log($"KB is installed = '{isUpdateInstalled}'"); return isUpdateInstalled; } private void SetReturnValue(bool isUpdateInstalled) { var updateInstalledVal = isUpdateInstalled ? "1" : "0"; - _session[MinimumVersionInstalledReturnVar] = updateInstalledVal; - _session.Log($"Set property '{MinimumVersionInstalledReturnVar}' to '{updateInstalledVal}'"); + _session[_returnVar] = updateInstalledVal; + _session.Log($"Set property '{_returnVar}' to '{updateInstalledVal}'"); } } } \ No newline at end of file From f438fb65f84ac3072531a0d61c6ce2d933e3296a Mon Sep 17 00:00:00 2001 From: David Sparer Date: Thu, 4 Aug 2016 13:37:36 -0600 Subject: [PATCH 2/2] Installer now checkes for KB2574819 on win7 before installation can occur --- CHANGELOG.TXT | 15 +++++++++++++++ .../CheckForInstalledWindowsUpdates.wxs | 3 +++ InstallerProjects/Installer/Includes/Config.wxi | 1 + .../Installer/Localizations/en-US.wxl | 1 + InstallerProjects/Installer/mRemoteNGV1.wxs | 9 ++++++++- 5 files changed, 28 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index 92132926..b46b8f07 100644 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -1,3 +1,18 @@ +1.75 SOMETHING (2016-x-x): + General Changes: + ---------------- + + + Features/Enhancements: + ---------------------- + + + Fixes: + ------ + MR-896: Added prerequisite installer check for KB2574819. Prevents "Class not registered" errors when opening RDP connections. + + + 1.75 Alpha 2 (2016-08-03): General Changes: diff --git a/InstallerProjects/Installer/CustomActions/CheckForInstalledWindowsUpdates.wxs b/InstallerProjects/Installer/CustomActions/CheckForInstalledWindowsUpdates.wxs index ac827814..583fc20c 100644 --- a/InstallerProjects/Installer/CustomActions/CheckForInstalledWindowsUpdates.wxs +++ b/InstallerProjects/Installer/CustomActions/CheckForInstalledWindowsUpdates.wxs @@ -4,4 +4,7 @@ + + + \ No newline at end of file diff --git a/InstallerProjects/Installer/Includes/Config.wxi b/InstallerProjects/Installer/Includes/Config.wxi index 02e3838d..e54e30ec 100644 --- a/InstallerProjects/Installer/Includes/Config.wxi +++ b/InstallerProjects/Installer/Includes/Config.wxi @@ -19,6 +19,7 @@ + diff --git a/InstallerProjects/Installer/Localizations/en-US.wxl b/InstallerProjects/Installer/Localizations/en-US.wxl index 625275c7..6812f546 100644 --- a/InstallerProjects/Installer/Localizations/en-US.wxl +++ b/InstallerProjects/Installer/Localizations/en-US.wxl @@ -7,6 +7,7 @@ mRemoteNG requires Microsoft .NET Framework [REQUIREDDOTNETFRAMEWORKVERSION] or higher. mRemoteNG requires Windows 7 SP1 or higher to run. Please update your operating system and try again. mRemoteNG requires RDP 8.0 or higher to run. Windows 7 users will need to install KB2592687 + mRemoteNG requires KB2574819 in order to create RDP connections. Windows 7 users will need to install this KB. For mRemoteNG to run on Windows 7, it requires Service Pack 1 to be installed. Please install Service Pack 1 and try again. diff --git a/InstallerProjects/Installer/mRemoteNGV1.wxs b/InstallerProjects/Installer/mRemoteNGV1.wxs index 0f20ea88..f59aa0b2 100644 --- a/InstallerProjects/Installer/mRemoteNGV1.wxs +++ b/InstallerProjects/Installer/mRemoteNGV1.wxs @@ -16,6 +16,8 @@ + + @@ -26,7 +28,8 @@ - (NOT Installed) AND (VersionNT = 601 OR VersionNT64 = 601) + (NOT Installed) AND (VersionNT = 601 OR VersionNT64 = 601) + (NOT Installed) AND (VersionNT = 601 OR VersionNT64 = 601) (NOT Installed) AND (LEGACYVERSIONINSTALLED = 1) @@ -49,6 +52,10 @@ + + + = 602 OR VersionNT64 >= 602) OR ((VersionNT = 601 OR VersionNT64 = 601) AND (RDP_DTLS_UPDATE_INSTALLED = 1))]]> + = 602 OR VersionNT64 >= 602) OR ((VersionNT = 601 OR VersionNT64 = 601) AND (MINIMUM_RDP_VERSION_INSTALLED = 1))]]>