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

Check every Visual Studio installation until a good one is found #1466

Merged
merged 1 commit into from
Oct 26, 2024

Conversation

ArthurClho
Copy link
Contributor

I ran into an error today with my unusual setup. I have VS Community installed only with the C# build tools and and the BuildTools package with the VisualC++ tools. gvsbuild did successfully detect both installations but still threw me an error:

Visual Studio installation(s) found:
    Visual Studio Community 2022 @ C:\Program Files\Microsoft Visual Studio\2022\Community
    Visual Studio Build Tools 2022 @ C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools

Error:
  C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat could not be found.
  Please check you have Visual Studio installed at C:\Program Files\Microsoft Visual Studio\2022\Community
  and that it supports the target platform x64.

The problem was that __find_vs_path_with_vs_version returned the first Visual Studio it found that matched the specified version without any further checks. I've modified it to return a list of paths that match the version and then check each one.

@ArthurClho ArthurClho force-pushed the check-multiple-vs-installations branch from ef8a1cb to 3889c01 Compare October 24, 2024 15:41
Copy link
Member

@danyeaw danyeaw left a comment

Choose a reason for hiding this comment

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

Thanks @ArthurClho, this is a nice improvement!

@danyeaw danyeaw merged commit c2ce397 into wingtk:main Oct 26, 2024
8 checks passed
@danyeaw danyeaw added bug fix and removed bug labels Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants