https://github.com/heaths/vssetup-rs
Utility classes for enumerating Microsoft Visual Studio setup instances
https://github.com/heaths/vssetup-rs
Last synced: 5 months ago
JSON representation
Utility classes for enumerating Microsoft Visual Studio setup instances
- Host: GitHub
- URL: https://github.com/heaths/vssetup-rs
- Owner: heaths
- License: mit
- Created: 2020-10-30T15:46:59.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2022-01-14T04:44:12.000Z (over 4 years ago)
- Last Synced: 2025-04-06T17:14:01.831Z (about 1 year ago)
- Language: Rust
- Size: 31.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Visual Studio Setup Configuration
[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 [Rust](https://www.rust-lang.org).
## Example
First add this crate to your Cargo.toml file:
```toml
[dependencies]
vssetup = "0.1.0"
```
You'll then need to use the crate in your project:
```rust
extern crate vssetup;
use vssetup::SetupConfiguration;
```
Make sure you initialize COM in your application. You can then enumerate and display instances:
```rust
use windows::{initialize_sta, Result};
fn main() -> Result<()> {
initialize_sta()?;
let config = SetupConfiguration::new();
if let Some(e) = config.instances() {
for instance in e {
println!("{}", instance.installation_path()?);
}
}
Ok(())
}
```
See [src/bin/vswhere.rs](https://github.com/heaths/vssetup-rs/blob/master/src/bin/vswhere.rs) for more examples.
## FAQ
* **On what platforms does this work?**
This crate will only compile and work on Windows.
* **Is this project supported by Microsoft?**
Though I am the developer who wrote the Setup Configuration API while working for Microsoft, this crate is unsupported by Microsoft.