Installer

Struct Installer 

Source
pub struct Installer {
Show 39 fields pub locale: Option<LanguageTag>, pub platform: Platform, pub minimum_os_version: Option<MinimumOSVersion>, pub architecture: Architecture, pub type: Option<InstallerType>, pub nested_installer_type: Option<NestedInstallerType>, pub nested_installer_files: BTreeSet<NestedInstallerFiles>, pub scope: Option<Scope>, pub url: DecodedUrl, pub sha_256: Sha256String, pub signature_sha_256: Option<Sha256String>, pub install_modes: InstallModes, pub switches: InstallerSwitches, pub success_codes: BTreeSet<InstallerSuccessCode>, pub expected_return_codes: BTreeSet<ExpectedReturnCodes>, pub upgrade_behavior: Option<UpgradeBehavior>, pub commands: BTreeSet<Command>, pub protocols: BTreeSet<Protocol>, pub file_extensions: BTreeSet<FileExtension>, pub dependencies: Dependencies, pub package_family_name: Option<PackageFamilyName<'static>>, pub product_code: Option<String>, pub capabilities: BTreeSet<Capability>, pub restricted_capabilities: BTreeSet<RestrictedCapability>, pub markets: Option<Markets>, pub aborts_terminal: bool, pub release_date: Option<CompactString>, pub install_location_required: bool, pub require_explicit_upgrade: bool, pub display_install_warnings: bool, pub unsupported_os_architectures: UnsupportedOSArchitecture, pub unsupported_arguments: UnsupportedArguments, pub apps_and_features_entries: AppsAndFeaturesEntries, pub elevation_requirement: Option<ElevationRequirement>, pub installation_metadata: InstallationMetadata, pub download_command_prohibited: bool, pub repair_behavior: Option<RepairBehavior>, pub archive_binaries_depend_on_path: bool, pub authentication: Option<Authentication>,
}

Fields§

§locale: Option<LanguageTag>

The locale for an installer not the package meta-data.

Some installers are compiled with locale or language specific properties. If this key is present, it is used to represent the package locale for an installer.

§platform: Platform

The Windows platform targeted by the installer.

The Windows Package Manager currently supports “Windows.Desktop” and “Windows.Universal”.

§minimum_os_version: Option<MinimumOSVersion>

The minimum version of the Windows operating system supported by the package.

§architecture: Architecture

The hardware architecture targeted by the installer.

The Windows Package Manager will attempt to determine the best architecture to use. If emulation is available and the native hardware architecture does not have a supported installer, the emulated architecture may be used.

§type: Option<InstallerType>

The installer type for the package.

The Windows Package Manager supports MSIX, MSI, and executable installers. Some well known formats (Inno, Nullsoft, WiX, and Burn) provide standard sets of installer switches to provide different installer experiences. Portable packages are supported as of Windows Package Manager 1.3. Zip packages are supported as of Windows Package Manager 1.5.

§nested_installer_type: Option<NestedInstallerType>

The installer type of the file within the archive which will be used as the installer.

§nested_installer_files: BTreeSet<NestedInstallerFiles>

A list of all the installers to be executed within an archive.

§scope: Option<Scope>

The scope the package is installed under.

The two configurations are user and machine. Some installers support only one of these scopes while others support both via arguments passed to the installer using InstallerSwitches.

§url: DecodedUrl

The URL to download the installer.

§sha_256: Sha256String

The SHA 256 hash for the installer. It is used to confirm the installer has not been modified. The Windows Package Manager will compare the hash in the manifest with the calculated hash of the installer after it has been downloaded.

§signature_sha_256: Option<Sha256String>

The signature file (AppxSignature.p7x) inside an MSIX installer. It is used to provide streaming install for MSIX packages.

§install_modes: InstallModes

The install modes supported by the installer.

The Microsoft community package repository requires a package support “silent” and “silent with progress”. The Windows Package Manager also supports “interactive” installers.

§switches: InstallerSwitches

The set of switches passed to installers.

§success_codes: BTreeSet<InstallerSuccessCode>

Any status codes returned by the installer representing a success condition other than zero.

§expected_return_codes: BTreeSet<ExpectedReturnCodes>

Any status codes returned by the installer representing a condition other than zero.

§upgrade_behavior: Option<UpgradeBehavior>

What the Windows Package Manager should do regarding the currently installed package during a package upgrade.

If the package should be uninstalled first, the uninstallPrevious value should be specified. If the package should not be upgraded through WinGet, the deny value should be specified.

§commands: BTreeSet<Command>

Any commands or aliases used to execute the package after it has been installed.

§protocols: BTreeSet<Protocol>

Any protocols (i.e. URI schemes) supported by the package. For example: ["ftp", "ldap"]. Entries shouldn’t have trailing colons. The Windows Package Manager does not support any behavior related to protocols handled by a package.

§file_extensions: BTreeSet<FileExtension>

Any file extensions supported by the package.

For example: ["html", "jpg"]. Entries shouldn’t have leading dots. The Windows Package Manager does not support any behavior related to the file extensions supported by the package.

§dependencies: Dependencies

Any dependencies required to install or run the package.

§package_family_name: Option<PackageFamilyName<'static>>

The package family name specified in an MSIX installer.

This value is used to assist with matching packages from a source to the program installed in Windows via Add / Remove Programs for list, and upgrade behavior.

§product_code: Option<String>

The product code.

This value is used to assist with matching packages from a source to the program installed in Windows via Add / Remove Programs for list, and upgrade behavior.

§capabilities: BTreeSet<Capability>

The capabilities provided by an MSIX package.

More information is available for App capability declarations.

§restricted_capabilities: BTreeSet<RestrictedCapability>

The restricted capabilities provided by an MSIX package.

More information is available for App capability declarations.

§markets: Option<Markets>

Any markets a package may or may not be installed in.

§aborts_terminal: bool

The behavior associated with installers that abort the terminal.

This most often occurs when a user is performing an upgrade of the running terminal.

§release_date: Option<CompactString>

The release date for a package, in RFC 3339 / ISO 8601 format, i.e. “YYYY-MM-DD”.

§install_location_required: bool

The requirement to have an install location specified.

These installers are known to deploy files to the location the installer is executed in.

§require_explicit_upgrade: bool

Identifies packages that upgrade themselves.

By default, they are excluded from winget upgrade --all.

§display_install_warnings: bool

Whether a warning message is displayed to the user prior to install or upgrade if the package is known to interfere with any running applications.

§unsupported_os_architectures: UnsupportedOSArchitecture

Any architectures a package is known not to be compatible with.

Generally, this is associated with emulation modes.

§unsupported_arguments: UnsupportedArguments

The list of Windows Package Manager Client arguments the installer does not support.

Only the --log and --location arguments can be specified as unsupported arguments for an installer.

§apps_and_features_entries: AppsAndFeaturesEntries

The values reported by Windows Apps & Features.

When a package is installed, entries are made into the Windows Registry.

§elevation_requirement: Option<ElevationRequirement>

The scope in which scope a package is required to be executed under.

Some packages require user level execution while others require administrative level execution.

§installation_metadata: InstallationMetadata

Allows for additional metadata to be used for deeper installation detection.

§download_command_prohibited: bool

When true, this flag will prohibit the manifest from being downloaded for offline installation with the winget download command.

§repair_behavior: Option<RepairBehavior>

This field controls what method is used to repair existing installations of packages.

Specifying modify will use the ModifyPath string from the package’s ARP data, uninstaller will use the Uninstall string from the package’s ARP data, and installer will download and run the installer. In each case, the Repair value from InstallerSwitches will be added as an argument when invoking the command to repair the package.

§archive_binaries_depend_on_path: bool

This field controls the behavior of environment variables when installing portable packages from an archive (i.e. zip).

Specifying true will add the install location directly to the PATH environment variable. Specifying false will use the default behavior of adding a symlink to the links folder, if supported, or adding the install location directly to PATH if symlinks are not supported.

§authentication: Option<Authentication>

This field controls the authentication for Entra ID secured private sources.

Resource and scope information can be included if a specific resource is needed to download or install the package.

Implementations§

Source§

impl Installer

Source

pub fn merge_with(self, other: Self) -> Self

Merges two installers.

If a key of self is equal to its default, it will take the value from other. If the key of self is not equal to its default, it will retain that value and the equivalent key in other is ignored.

Trait Implementations§

Source§

impl Clone for Installer

Source§

fn clone(&self) -> Installer

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Installer

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Installer

Source§

fn default() -> Installer

Returns the “default value” for a type. Read more
Source§

impl Hash for Installer

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for Installer

Source§

fn cmp(&self, other: &Installer) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for Installer

Source§

fn eq(&self, other: &Installer) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for Installer

Source§

fn partial_cmp(&self, other: &Installer) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Eq for Installer

Source§

impl StructuralPartialEq for Installer

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> ErasedDestructor for T
where T: 'static,