https://github.com/heaths/go-vssetup
Go bindings for Visual Studio Setup Configuration
https://github.com/heaths/go-vssetup
interop visual-studio
Last synced: 8 months ago
JSON representation
Go bindings for Visual Studio Setup Configuration
- Host: GitHub
- URL: https://github.com/heaths/go-vssetup
- Owner: heaths
- License: mit
- Created: 2021-09-09T08:23:44.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-11-23T06:00:11.000Z (over 4 years ago)
- Last Synced: 2025-05-26T06:58:08.712Z (about 1 year ago)
- Topics: interop, visual-studio
- Language: Go
- Homepage:
- Size: 1.4 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Visual Studio Setup Configuration
[](https://github.com/heaths/go-vssetup/releases/latest)
[](https://pkg.go.dev/github.com/heaths/go-vssetup?GOOS=windows)
[](https://github.com/heaths/go-vssetup/actions/workflows/ci.yml)
[Microsoft Visual Studio](https://visualstudio.microsoft.com) 2017 and newer uses a new setup engine that allows multiple instances to be installed quickly and in different configuration. To enumerate these instances and find one that fulfills your requirements, the [Setup Configuration API](https://devblogs.microsoft.com/setup/documentation-available-for-the-setup-configuration-api) provides a set of interface. This crate provides a safe and idiomatic wrapper for [Go](https://golang.org).
## Example
First install the heaths/go-vssetup module:
```bash
go get github.com/heaths/go-vssetup
```
You can then use the `vssetup` module to enumerate instances:
```go
// Enumerate launchable instances.
instances, _ := vssetup.Instances(false)
for _, instance := range instances {
if installationPath, err := instance.InstallationPath(); err == nil {
fmt.Println("InstallationPath =", installationPath)
}
}
```
### vswhere
While this project is not meant to replace the official [vswhere] that ships with Visual Studio and is available in some package managers, nor is it meant to be fully compatible with all official vswhere options, this project does have a `vswhere` command that allows you to quickly see this module in action:
```bash
go run ./cmd/vswhere
```
You can also download a binary from [releases](https://github.com/heaths/go-vssetup/releases). It is not call-compatible with the official [vswhere].
## FAQ
* **On what platforms does this work?**
This module should compile on any platform but will only return available instances on Windows if Visual Studio 2017 or newer is installed.
* **Is this project supported by Microsoft?**
Though I am the developer who wrote the Setup Configuration API while working for Microsoft, this module is unsupported by Microsoft.
[vswhere]: https://github.com/microsoft/vswhere