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

Fix Visual Studio install detection in release-tool.ps1 #10101

Merged
merged 3 commits into from
Jan 27, 2024

Conversation

ultralapse
Copy link
Contributor

@ultralapse ultralapse commented Dec 14, 2023

Get-CimInstance MSFT_VSInstance doesn't work for all Windows and Visual Studio installs as it uses the default namespace root/cimv2.

Get-CimInstance MSFT_VSInstance -Namespace root/cimv2/vs should work

Screenshots

Circled red is the Get-CimInstance MSFT_VSInstance command not working
Circled green is the Get-CimInstance MSFT_VSInstance -Namespace root/cimv2/vs command working.

image

Testing strategy

The script ran successfully in powershell after the edits were made.

Type of change

  • ✅ Bug fix (non-breaking change that fixes an issue)

@ultralapse
Copy link
Contributor Author

Saw that this was fixed in another branch. I will close

@ultralapse ultralapse closed this Dec 14, 2023
@ultralapse
Copy link
Contributor Author

Will reopen for now, might be useful since the fix in the other branch involves manually installing a powershell module

@ultralapse ultralapse reopened this Dec 14, 2023
@ultralapse ultralapse changed the title Update release-tool.ps1 to work on all Windows and Visual Studio Installs Fix Visual Studio install detection in release-tool.ps1 Dec 14, 2023
ultralapse referenced this pull request Dec 14, 2023
* Requires `Install-Module VSSetup -Scope CurrentUser` to be run before using the release tool.
* The latest version of Visual Studio 2022 removes the ability to find itself with WIM (the previous method)
@droidmonkey
Copy link
Member

droidmonkey commented Dec 14, 2023

This is nuts, they changed it without any documentation (I'm not surprised it's microsoft...)

@droidmonkey
Copy link
Member

droidmonkey commented Dec 14, 2023

Hmmm, I had referenced this article before, looks like they recently added the namespace flag.

https://learn.microsoft.com/en-us/visualstudio/install/tools-for-managing-visual-studio-instances?view=vs-2022&source=recommendations

Yup it was added mid october: MicrosoftDocs/visualstudio-docs@46e97eb

@droidmonkey
Copy link
Member

I'll have to sign the release script before merge, no need to merge develop into this

ultralapse and others added 3 commits January 27, 2024 08:45
`Get-CimInstance MSFT_VSInstance` does not always work as it uses the default namespace root/cimv2. Specifying `Get-CimInstance MSFT_VSInstance -Namespace root/cimv2/vs` allows it to work.

I have included a try catch block to only explictly specify the namespace if the default command fails.
Removed try catch block, clearly the Get-CimInstance MSFT_VSInstance doesn't work
@droidmonkey droidmonkey added the pr: backported Pull request backported to previous release label Jan 27, 2024
@droidmonkey droidmonkey merged commit 442d65a into keepassxreboot:develop Jan 27, 2024
2 of 8 checks passed
droidmonkey added a commit that referenced this pull request Jan 27, 2024
* Update release-tool.ps1

`Get-CimInstance MSFT_VSInstance` does not always work as it uses the default namespace root/cimv2. Specifying `Get-CimInstance MSFT_VSInstance -Namespace root/cimv2/vs` allows it to work.

Co-authored-by: Jonathan White <[email protected]>
pull bot pushed a commit to mengzhisuoliu/keepassxc that referenced this pull request Jan 27, 2024
…ot#10101)

* Update release-tool.ps1

`Get-CimInstance MSFT_VSInstance` does not always work as it uses the default namespace root/cimv2. Specifying `Get-CimInstance MSFT_VSInstance -Namespace root/cimv2/vs` allows it to work.

Co-authored-by: Jonathan White <[email protected]>
@phoerious phoerious added pr: bugfix Pull request that fixes a bug and removed bug labels Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build system pr: backported Pull request backported to previous release pr: bugfix Pull request that fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants