Skip to content

heaths/vssetup-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Visual Studio Setup Configuration

Microsoft Visual Studio 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 provides a set of interface. This crate provides a safe and idiomatic wrapper for Rust.

Example

First add this crate to your Cargo.toml file:

[dependencies]
vssetup = "0.1.0"

You'll then need to use the crate in your project:

extern crate vssetup;
use vssetup::SetupConfiguration;

Make sure you initialize COM in your application. You can then enumerate and display instances:

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 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.

About

Utility classes for enumerating Microsoft Visual Studio setup instances

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages