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

added button to launch VS installer (or download VS if not found) #13

Merged
merged 2 commits into from
Sep 25, 2023
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
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
Loading