Skip to content

Commit

Permalink
DYN-9999 : add asc install path to system path (#15717)
Browse files Browse the repository at this point in the history
Co-authored-by: Bogdan Zavu <[email protected]>
  • Loading branch information
BogdanZavu and zavub authored Dec 10, 2024
1 parent b845513 commit 4f85a18
Showing 1 changed file with 22 additions and 1 deletion.
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");
}

}

installedPath = installPath;
return status;
}

Expand Down

0 comments on commit 4f85a18

Please sign in to comment.