Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for loading ASM from RSA install location #9884

Merged
merged 2 commits into from
Aug 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Tools/DynamoInstallDetective/ProductLookUp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ static string GetDisplayName(RegistryKey key)
public InstalledProductLookUp(string lookUpName, string fileLookup)
{
this.ProductLookUpName = lookUpName;
this.fileLocator = (path) => Directory.GetFiles(path, fileLookup).FirstOrDefault();
this.fileLocator = (path) => Directory.GetFiles(path, fileLookup, SearchOption.AllDirectories).FirstOrDefault();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aparajit-pratap Did you notice any noticeable slow down with such searching option with RSA?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't notice any difference as I don't suspect there is a noticeable slowdown if any after this change. In any case, I think this part of the fix might be unavoidable due to the fact that there is no guarantee that ASM will always be found in the root directory of an installation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aparajit-pratap Thank you, sounds reasonable here.

}

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

public InstalledProduct(string installLocation, InstalledProductLookUp lookUp)
{
InstallLocation = installLocation;
var corePath = lookUp.GetCoreFilePathFromInstallation(InstallLocation);
var corePath = lookUp.GetCoreFilePathFromInstallation(installLocation);
InstallLocation = Path.GetDirectoryName(corePath);
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" };
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ASM from RSA will be used if there is no Revit or Civil3D installed on the user's machine.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot if changing the order here affect the ASM paths found?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it does. See:

foreach (KeyValuePair<string, Tuple<int, int, int, int>> install in installations)

We first iterate over the different LibG versions and then over the supported products list and whichever matches first, comes out the winner. So it does matter if we play with the order. For example if Revit and RSA are both installed, and there is a match, ASM will be loaded from Revit and if we swap Revit with RSA, ASM will be loaded from RSA.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is refreshing to me. Keeping the order of Revit first looks safe.


#region public properties
public static readonly string GeometryFactoryAssembly = "LibG.ProtoInterface.dll";
Expand Down