Skip to content

Commit

Permalink
Merge pull request #13 from Hefaistos68/feature/add-vs-installer
Browse files Browse the repository at this point in the history
added button to launch VS installer (or download VS if not found)
  • Loading branch information
Hefaistos68 authored Sep 25, 2023
2 parents 9d136cf + 76a9e97 commit a2b43d3
Show file tree
Hide file tree
Showing 12 changed files with 247 additions and 84 deletions.
29 changes: 29 additions & 0 deletions VSLXshared/DataModel/VisualStudioInstanceManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,35 @@ public int Count
}
}

/// <summary>
/// Gets the installer path.
/// </summary>
public static string InstallerPath
{
get
{
string location = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Microsoft Visual Studio", "Installer");
string location86 = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), "Microsoft Visual Studio", "Installer");
string installerPath = Path.Combine(location, "vs_installer.exe");
string installerPath86 = Path.Combine(location86, "vs_installer.exe");

if(Directory.Exists(location) || Directory.Exists(location86))
{
if (File.Exists(installerPath))
{
return installerPath;
}
if (File.Exists(installerPath86))
{
return installerPath86;
}
}

// not found, return the microsoft download site for Visual Studio
return "https://visualstudio.microsoft.com/downloads/";
}
}

/// <summary>
/// Access an instance by index
/// </summary>
Expand Down
113 changes: 68 additions & 45 deletions VSLauncherX/MainDialog.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a2b43d3

Please sign in to comment.