I want to programmatically install a folder in Visual Studio’s “Extensions” folder. The closest i can get is using the VS100COMNTOOLS environment variable. What i want to do is go back one level from the “Tools” folder, the go into IDE/Extensions, something like VS100COMNTOOLS..\IDE\Extensions. This is my code:
namespace TemplatesCustomAction
{
public class CustomActions
{
[CustomAction]
public static ActionResult CustomAction1(Session session)
{
var vspath = Environment.GetEnvironmentVariable("VS100COMNTOOLS");
session["VSINSTALLATIONFOLDER"] = string.Format(@"{0}\..\IDE\Extensions", vspath);
return ActionResult.Success;
}
}
}
Use
Path.GetFullPath:Though I’d also rather use
Path.Combine: