Skip to content

Commit

Permalink
Cherry-pick #9899 - Allow ASM to be loaded from non-root product inst…
Browse files Browse the repository at this point in the history
…all directories (#9904)

* Add support for loading ASM from RSA install location (#9884)

* support for loading ASM from RSA install location

* cleanup

* resolve cherry-pick conflicts
  • Loading branch information
aparajit-pratap authored Aug 12, 2019
1 parent 78b42ce commit 338b8e4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
11 changes: 7 additions & 4 deletions src/Tools/DynamoInstallDetective/ProductLookUp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ public class InstalledProductLookUp : IProductLookUp
/// Product name for lookup
/// </summary>
public string ProductLookUpName { get; private set; }

private readonly Func<string, string> fileLocator;

static RegistryKey OpenKey(string key)
Expand Down Expand Up @@ -158,8 +159,9 @@ static string GetDisplayName(RegistryKey key)
/// <param name="fileLookup">file name pattern to lookup</param>
public InstalledProductLookUp(string lookUpName, string fileLookup)
{
this.ProductLookUpName = lookUpName;
this.fileLocator = (path) => Directory.GetFiles(path, fileLookup).FirstOrDefault();
ProductLookUpName = lookUpName;
fileLocator = (path) => Directory.EnumerateFiles(path, fileLookup, SearchOption.AllDirectories)
.FirstOrDefault();
}

public InstalledProductLookUp(string lookUpName, Func<string, string> fileLocator)
Expand Down Expand Up @@ -254,8 +256,9 @@ class InstalledProduct : IInstalledProduct

public InstalledProduct(string installLocation, InstalledProductLookUp lookUp)
{
InstallLocation = installLocation;
var corePath = lookUp.GetCoreFilePathFromInstallation(InstallLocation);
var corePath = lookUp.GetCoreFilePathFromInstallation(installLocation);
InstallLocation = File.Exists(corePath) ? Path.GetDirectoryName(corePath) : installLocation;

VersionInfo = lookUp.GetVersionInfoFromFile(corePath);
ProductName = string.Format("{0} {1}.{2}", lookUp.ProductLookUpName, VersionInfo.Item1, VersionInfo.Item2);
VersionString = string.Format("{0}.{1}.{2}.{3}", VersionInfo.Item1, VersionInfo.Item2, VersionInfo.Item3, VersionInfo.Item4);
Expand Down
2 changes: 1 addition & 1 deletion src/Tools/DynamoShapeManager/Utilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static class Utilities
/// <summary>
/// Key words for Products containing ASM binaries
/// </summary>
private static readonly List<string> ProductsWithASM = new List<string>() { "Revit", "Civil", "FormIt" };
private static readonly List<string> ProductsWithASM = new List<string>() { "Revit", "Civil", "Robot Structural Analysis", "FormIt" };

#region public properties
public static readonly string GeometryFactoryAssembly = "LibG.ProtoInterface.dll";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
<SpecificVersion>False</SpecificVersion>
<Private>True</Private>
</Reference>
<Reference Include="nunit.framework">
<HintPath>..\..\extern\NUnit\nunit.framework.dll</HintPath>
<Private>False</Private>
<Reference Include="nunit.framework, Version=2.6.2.12296, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\extern\NUnit\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down

0 comments on commit 338b8e4

Please sign in to comment.