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

DYN-9999 : add asc install path to system path #15717

Merged
merged 1 commit into from
Dec 10, 2024
Merged
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
23 changes: 22 additions & 1 deletion src/Tools/DynamoInstallDetective/AscSDKWrapper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Diagnostics;
using System.IO;
using Microsoft.Win32;

Expand Down Expand Up @@ -156,9 +157,29 @@ public ASC_STATUS GetInstalledPath(ref string installedPath)
return ASC_STATUS.INITIALIZE_FAILED;
}

if (!string.IsNullOrEmpty(installPath))
{
installedPath = installPath;
return ASC_STATUS.SUCCESS;
}

var status = ReadASCVersionFromEnv() == ASC_STATUS.SUCCESS ? ASC_STATUS.SUCCESS : ReadASCInstallPathFromRegistry(majorRelease);
installedPath = installPath;
if (status == ASC_STATUS.SUCCESS)
{
try
{
string currentPath = Environment.GetEnvironmentVariable("PATH", EnvironmentVariableTarget.Process);
string updatedPath = currentPath + ";" + installPath;
Environment.SetEnvironmentVariable("PATH", updatedPath, EnvironmentVariableTarget.Process);
}
catch
{
Trace.WriteLine("Failed to update path for ASC component");
Copy link
Member

Choose a reason for hiding this comment

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

does trace make it to the dynamo log?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, trace does not make it to dynamo log.

}

}

installedPath = installPath;
return status;
}

Expand Down
Loading