Merge branch 'MR-896_RDP_Class_not_registered' into develop

This commit is contained in:
David Sparer
2016-08-04 13:39:37 -06:00
8 changed files with 53 additions and 16 deletions

View File

@@ -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:

View File

@@ -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;
}

View File

@@ -47,7 +47,7 @@
<Compile Include="CustomActions.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="InstalledWindowsUpdateGatherer.cs" />
<Compile Include="RdpVersionChecker.cs" />
<Compile Include="InstalledKbChecker.cs" />
<Compile Include="UninstallNsisVersions.cs" />
<Content Include="CustomAction.config" />
</ItemGroup>

View File

@@ -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}'");
}
}
}

View File

@@ -4,4 +4,7 @@
<Fragment>
<CustomAction Id="CheckIfMinimumRdpInstalled" Return="check" Execute="immediate" BinaryKey="CustomActions.CA.dll" DllEntry="IsMinimumRdpVersionInstalled" />
</Fragment>
<Fragment>
<CustomAction Id="CheckIfRdpDtlsUpdateInstalled" Return="check" Execute="immediate" BinaryKey="CustomActions.CA.dll" DllEntry="IsRdpDtlsUpdateInstalled" />
</Fragment>
</Wix>

View File

@@ -19,6 +19,7 @@
<?define Rdp80Kb = "KB2592687" ?>
<?define Rdp81Kb = "KB2923545" ?>
<?define MinimumRdpKb = $(var.Rdp80Kb) ?>
<?define RdpDtlsKb = "KB2574819" ?>
<?define IGNOREPREREQUISITES = 0 ?>
<?if $(var.Platform) = x64 ?>

View File

@@ -7,6 +7,7 @@
<String Id="Install_NeedDotNetFrameworkVersion">mRemoteNG requires Microsoft .NET Framework [REQUIREDDOTNETFRAMEWORKVERSION] or higher.</String>
<String Id="Install_OSVersionRequirement">mRemoteNG requires Windows 7 SP1 or higher to run. Please update your operating system and try again.</String>
<String Id="Install_RDP80Requirement">mRemoteNG requires RDP 8.0 or higher to run. Windows 7 users will need to install KB2592687</String>
<String Id="Install_RDPDtlsRequirement">mRemoteNG requires KB2574819 in order to create RDP connections. Windows 7 users will need to install this KB.</String>
<String Id="Install_Win7RequiresSP1">For mRemoteNG to run on Windows 7, it requires Service Pack 1 to be installed. Please install Service Pack 1 and try again.</String>
<!-- Directories and File names -->

View File

@@ -16,6 +16,8 @@
<Property Id="APPLICATIONROOTDIRECTORY">
<RegistrySearch Id='mRemoteNGRegistry' Type='raw' Root='HKLM' Key='Software\mRemoteNG' Name='InstallDir' />
</Property>
<Property Id='RDP_DTLS_KB' Value='$(var.RdpDtlsKb)' />
<Property Id='RDP_DTLS_UPDATE_INSTALLED' Value='0' Secure='yes' />
<Property Id='MINIMUM_RDP_KB' Value='$(var.MinimumRdpKb)' />
<Property Id='MINIMUM_RDP_VERSION_INSTALLED' Value='0' Secure='yes' />
<Property Id='REQUIREDDOTNETFRAMEWORKVERSION' Value='$(var.RequiredDotNetFrameworkVersion)' />
@@ -26,7 +28,8 @@
<InstallUISequence>
<Custom Action="CheckIfMinimumRdpInstalled" After="AppSearch">(NOT Installed) AND (VersionNT = 601 OR VersionNT64 = 601)</Custom>
<Custom Action="CheckIfRdpDtlsUpdateInstalled" After="AppSearch">(NOT Installed) AND (VersionNT = 601 OR VersionNT64 = 601)</Custom>
<Custom Action="CheckIfMinimumRdpInstalled" After="CheckIfRdpDtlsUpdateInstalled">(NOT Installed) AND (VersionNT = 601 OR VersionNT64 = 601)</Custom>
<LaunchConditions After="SetWIX_IS_NETFRAMEWORK_40_OR_LATER_INSTALLED" />
<Custom Action="CheckIfLegacyVersionInstalled" After="LaunchConditions" />
<Custom Action="UninstallLegacyVersion" After="CheckIfLegacyVersionInstalled">(NOT Installed) AND (LEGACYVERSIONINSTALLED = 1)</Custom>
@@ -49,6 +52,10 @@
<Condition Message="!(loc.Install_NeedDotNetFrameworkVersion)">
<![CDATA[Installed OR (IGNOREPREREQUISITES = 1) OR WIX_IS_NETFRAMEWORK_40_OR_LATER_INSTALLED = 1]]>
</Condition>
<!-- If Win7, require RDP DTLS update (KB2574819) -->
<Condition Message="!(loc.Install_RDPDtlsRequirement)">
<![CDATA[Installed OR (IGNOREPREREQUISITES = 1) OR (VersionNT >= 602 OR VersionNT64 >= 602) OR ((VersionNT = 601 OR VersionNT64 = 601) AND (RDP_DTLS_UPDATE_INSTALLED = 1))]]>
</Condition>
<!-- If Win7, require RDP 8.0 update (KB2592687) -->
<Condition Message="!(loc.Install_RDP80Requirement)">
<![CDATA[Installed OR (IGNOREPREREQUISITES = 1) OR (VersionNT >= 602 OR VersionNT64 >= 602) OR ((VersionNT = 601 OR VersionNT64 = 601) AND (MINIMUM_RDP_VERSION_INSTALLED = 1))]]>