Skip to main content

SetupPropertyStore

Struct SetupPropertyStore 

Source
pub struct SetupPropertyStore { /* private fields */ }

Implementations§

Source§

impl SetupPropertyStore

Source

pub fn GetNames(&self) -> Result<SafeArray<BSTR>, HRESULT>

Examples found in repository?
examples/vsall.rs (line 69)
9fn main() -> Result<(), HRESULT> {
10    com::initialize()?;
11
12    let list_packages = std::env::args().skip(1).any(|arg| arg == "--packages");
13    let display_help = std::env::args()
14        .skip(1)
15        .any(|arg| arg == "-h" || arg == "--help");
16    if display_help {
17        println!("usage: vsall [--packages]");
18        return Ok(());
19    }
20
21    let setup = SetupConfiguration::new()?;
22    let mut first = false;
23    for instance in setup.EnumInstances()? {
24        if first {
25            first = false;
26        } else {
27            println!();
28        }
29        println!(
30            "displayName: {}",
31            instance.GetDisplayName(0x400)?.to_string()
32        );
33        println!(
34            "description: {}",
35            instance.GetDescription(0x400)?.to_string()
36        );
37        println!("instanceId: {}", instance.GetInstanceId()?);
38        println!(
39            "installDate: FILETIME({})",
40            &instance.GetInstallDate()?.as_u64()
41        );
42        println!("installationPath: {}", instance.GetInstallationPath()?);
43        println!(
44            "installationVersion: {}",
45            instance.GetInstallationVersion()?
46        );
47        println!("state: {}", instance.GetState()?);
48        println!("enginePath: {}", instance.GetEnginePath()?);
49        println!("productPath: {}", instance.GetProductPath()?.to_string());
50        if let Ok(Some(product)) = instance.GetProduct() {
51            println!("product: {{");
52            println!("    id: {}", product.GetId()?);
53            println!("    uniqueId: {}", product.GetUniqueId()?);
54            println!("    version: {}", product.GetVersion()?);
55            println!("    type: {}", product.GetType()?);
56            println!("    branch: {}", product.GetBranch()?);
57            println!("    chip: {}", product.GetChip()?);
58            println!("    isExtension: {}", product.GetIsExtension()?);
59            println!("    isInstalled: {}", product.GetIsInstalled()?);
60            println!("    language: {}", product.GetLanguage()?);
61            println!(
62                "    supportsExtensions: {}",
63                product.GetSupportsExtensions()?
64            );
65            println!("}}");
66        }
67        if let Ok(properties) = instance.to_property_store() {
68            println!("propertyStore: {{");
69            for property in properties.GetNames()?.iter() {
70                let value = properties.GetValue(property)?;
71                println!("    {property}: {value}");
72            }
73            println!("}}");
74        }
75        if let Ok(Some(properties)) = instance.GetProperties() {
76            println!("properties: {{");
77            for property in properties.GetNames()?.iter() {
78                let value = properties.GetValue(property)?;
79                println!("    {property}: {value}");
80            }
81            println!("}}");
82        }
83
84        if let Ok(catalog) = instance.to_catalog() {
85            println!("catalog: {{");
86            println!("    isPrerelease: {}", catalog.IsPrerelease()?);
87            if let Ok(Some(properties)) = catalog.GetCatalogInfo() {
88                for property in properties.GetNames()?.iter() {
89                    let value = properties.GetValue(property)?;
90                    println!("    {property}: {value}");
91                }
92            }
93            println!("}}");
94        }
95        if list_packages && let Ok(packages) = instance.GetPackages() {
96            println!("packages: [");
97            for package in packages.iter() {
98                println!("    {{");
99                println!("        id: {}", package.GetId()?);
100                println!("        uniqueId: {}", package.GetUniqueId()?);
101                println!("        version: {}", package.GetVersion()?);
102                println!("        type: {}", package.GetType()?);
103                println!("        branch: {}", package.GetBranch()?);
104                println!("        chip: {}", package.GetChip()?);
105                println!("        isExtension: {}", package.GetIsExtension()?);
106                println!("        language: {}", package.GetLanguage()?);
107                println!("        }}");
108            }
109            println!("]");
110        }
111    }
112    Ok(())
113}
Source

pub fn GetValue<'w, W: TryInto<WideStr<'w>>>( &self, name: W, ) -> Result<Variant, HRESULT>

Examples found in repository?
examples/vsall.rs (line 70)
9fn main() -> Result<(), HRESULT> {
10    com::initialize()?;
11
12    let list_packages = std::env::args().skip(1).any(|arg| arg == "--packages");
13    let display_help = std::env::args()
14        .skip(1)
15        .any(|arg| arg == "-h" || arg == "--help");
16    if display_help {
17        println!("usage: vsall [--packages]");
18        return Ok(());
19    }
20
21    let setup = SetupConfiguration::new()?;
22    let mut first = false;
23    for instance in setup.EnumInstances()? {
24        if first {
25            first = false;
26        } else {
27            println!();
28        }
29        println!(
30            "displayName: {}",
31            instance.GetDisplayName(0x400)?.to_string()
32        );
33        println!(
34            "description: {}",
35            instance.GetDescription(0x400)?.to_string()
36        );
37        println!("instanceId: {}", instance.GetInstanceId()?);
38        println!(
39            "installDate: FILETIME({})",
40            &instance.GetInstallDate()?.as_u64()
41        );
42        println!("installationPath: {}", instance.GetInstallationPath()?);
43        println!(
44            "installationVersion: {}",
45            instance.GetInstallationVersion()?
46        );
47        println!("state: {}", instance.GetState()?);
48        println!("enginePath: {}", instance.GetEnginePath()?);
49        println!("productPath: {}", instance.GetProductPath()?.to_string());
50        if let Ok(Some(product)) = instance.GetProduct() {
51            println!("product: {{");
52            println!("    id: {}", product.GetId()?);
53            println!("    uniqueId: {}", product.GetUniqueId()?);
54            println!("    version: {}", product.GetVersion()?);
55            println!("    type: {}", product.GetType()?);
56            println!("    branch: {}", product.GetBranch()?);
57            println!("    chip: {}", product.GetChip()?);
58            println!("    isExtension: {}", product.GetIsExtension()?);
59            println!("    isInstalled: {}", product.GetIsInstalled()?);
60            println!("    language: {}", product.GetLanguage()?);
61            println!(
62                "    supportsExtensions: {}",
63                product.GetSupportsExtensions()?
64            );
65            println!("}}");
66        }
67        if let Ok(properties) = instance.to_property_store() {
68            println!("propertyStore: {{");
69            for property in properties.GetNames()?.iter() {
70                let value = properties.GetValue(property)?;
71                println!("    {property}: {value}");
72            }
73            println!("}}");
74        }
75        if let Ok(Some(properties)) = instance.GetProperties() {
76            println!("properties: {{");
77            for property in properties.GetNames()?.iter() {
78                let value = properties.GetValue(property)?;
79                println!("    {property}: {value}");
80            }
81            println!("}}");
82        }
83
84        if let Ok(catalog) = instance.to_catalog() {
85            println!("catalog: {{");
86            println!("    isPrerelease: {}", catalog.IsPrerelease()?);
87            if let Ok(Some(properties)) = catalog.GetCatalogInfo() {
88                for property in properties.GetNames()?.iter() {
89                    let value = properties.GetValue(property)?;
90                    println!("    {property}: {value}");
91                }
92            }
93            println!("}}");
94        }
95        if list_packages && let Ok(packages) = instance.GetPackages() {
96            println!("packages: [");
97            for package in packages.iter() {
98                println!("    {{");
99                println!("        id: {}", package.GetId()?);
100                println!("        uniqueId: {}", package.GetUniqueId()?);
101                println!("        version: {}", package.GetVersion()?);
102                println!("        type: {}", package.GetType()?);
103                println!("        branch: {}", package.GetBranch()?);
104                println!("        chip: {}", package.GetChip()?);
105                println!("        isExtension: {}", package.GetIsExtension()?);
106                println!("        language: {}", package.GetLanguage()?);
107                println!("        }}");
108            }
109            println!("]");
110        }
111    }
112    Ok(())
113}

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.