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

vswhere requires -prerelease to detect vs2022 #252

Closed
gorlak opened this issue Nov 30, 2021 · 7 comments
Closed

vswhere requires -prerelease to detect vs2022 #252

gorlak opened this issue Nov 30, 2021 · 7 comments

Comments

@gorlak
Copy link

gorlak commented Nov 30, 2021

Similar to #249, but now vs2022 is released, and the release version is installed (17.0.2 at the time of this writing), the -prerelease flag is still required:

>"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional                                                                                                                                                                                

>"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -prerelease -property installationPath
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional
C:\Program Files\Microsoft Visual Studio\2022\Professional
@heaths
Copy link
Member

heaths commented Nov 30, 2021

Can you output all the text for VS2022 and paste it here?

@gorlak
Copy link
Author

gorlak commented Nov 30, 2021

Here you go vswhere.txt

🤔 : isPrerelease: 0

@heaths
Copy link
Member

heaths commented Nov 30, 2021

Actually, the bigger problem here seems to be why VS2019 was chosen for -latest over VS2022. In your first example, you added -latest and only one instance will show up. If you exclude that, I imagine VS2022 shows up. Correct?

Can you download and try the latest release to see if that still happens there?

https://github.com/microsoft/vswhere/releases/latest

@gorlak
Copy link
Author

gorlak commented Nov 30, 2021

Ah, actually yes:

>"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -property installationPath
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional
C:\Program Files\Microsoft Visual Studio\2022\Professional

Actually, I think I wasn't clear on how -latest was intended to work. This wasn't working, and I added latest thinking perhaps vswhere was filtering out 2022 since it was just released. Perhaps it wasn't listed because the installer was install 7.0.2, and it was in pending reboot state or something.

So it seems to be a "latest version sorting" issue of some sort, then?

@gorlak
Copy link
Author

gorlak commented Nov 30, 2021

Wait, what the hell, it works now:

>"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath
C:\Program Files\Microsoft Visual Studio\2022\Professional

That's... strange. 🤔

@gorlak gorlak closed this as completed Nov 30, 2021
@gorlak
Copy link
Author

gorlak commented Nov 30, 2021

I'm going to assume this was a 17.0.1 and lower defect that was fixed w/ reboot after installing 17.0.2

@heaths
Copy link
Member

heaths commented Nov 30, 2021

If a reboot was pending for VS2022, it would not be included by default because the product is not in a supported state. Your text output didn't indicate that (there is a state vswhere checks), but if you took that after a reboot, that would be why.

For more information about -latest and other switches, run vswhere with -help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants