pub struct Builder<'a> { /* private fields */ }
Expand description

A builder for running the cargo wix subcommand.

Implementations

Creates a new Builder instance.

Sets the path to the WiX Toolset’s bin folder.

The WiX Toolset’s bin folder should contain the needed candle.exe and light.exe applications. The default is to use the WIX system environment variable that is created during installation of the WiX Toolset. This will override any value obtained from the environment.

Enables or disables capturing of the output from the builder (cargo), compiler (candle), linker (light), and signer (signtool).

The default is to capture all output, i.e. display nothing in the console but the log statements.

Adds an argument to the compiler command.

This “passes” the argument directly to the WiX compiler (candle.exe). See the help documentation for the WiX compiler for information about valid options and flags.

Sets the culture to use with the linker (light.exe) for building a localized installer.

This value will override any defaults and skip looking for a value in the [package.metadata.wix] section of the package’s manifest (Cargo.toml).

Builds the package with the Debug profile instead of the Release profile.

See the Cargo book for more information about release profiles. The default is to use the Release profile when creating the installer. This value is ignored if the no_build method is set to true.

Appends -debug to the file stem for the installer (msi).

If true, then -debug is added as suffix to the file stem (string before the dot and file extension) for the installer’s file name. For example, if true, then file name would be example-0.1.0-x86_64-debug.msi. The default is to not append the -debug because the Release profile is the default.

Generally, this should be used in combination with the debug_build method to indicate the installer is for a debugging variant of the installed binary.

Adds multiple WiX Source (wxs) files to the creation of an installer.

By default, any .wxs file located in the project’s wix folder will be included in the creation of an installer for the project. This method adds, or appends, to the list of .wxs files. The value is a relative or absolute path.

This value will override any default and skip looking for a value in the [package.metadata.wix] section of the package’s manifest (Cargo.toml).

Sets the path to a package’s manifest (Cargo.toml) file.

A package’s manifest is used to create an installer. If no path is specified, then the current working directory (CWD) is used. An error will occur if there is no Cargo.toml file in the CWD or at the specified path. Either an absolute or relative path is valid.

This value will override any default and skip looking for a value in the [package.metadata.wix] section of the package’s manifest (Cargo.toml).

Adds an argument to the linker command.

This “passes” the argument directly to the WiX linker (light.exe). See the help documentation for the WiX compiler for information about valid options and flags.

Sets the path to a WiX localization file, .wxl, for the linker (light.exe).

The WiX localization file is an XML file that contains localization strings.

This value will override any default and skip looking for a value in the [package.metadata.wix] section of the package’s manifest (Cargo.toml).

Sets the name.

The default is to use the name field under the [package] section of the package’s manifest (Cargo.toml). This overrides that value.

The installer (msi) that is created will be named in the following format: “name-major.minor.patch-platform.msi”, where name is the value specified with this method or the value from the name field under the [package] section, the major.minor.patch is the version number from the package’s manifest version field or the value specified at the command line, and the platform is either “i686” or “x86_64” depending on the build environment.

This does not change the name of the executable that is installed. The name of the executable can be changed by modifying the WiX Source (wxs) file with a text editor.

This value will override any default and skip looking for a value in the [package.metadata.wix] section of the package’s manifest (Cargo.toml).

Skips the building of the project with the release profile.

If true, the project will not be built using the release profile, i.e. the cargo build --release command will not be executed. The default is to build the project before each creation. This is useful if building the project is more involved or is handled in a separate process.

This value will override any default and skip looking for a value in the [package.metadata.wix] section of the package’s manifest (Cargo.toml).

Runs the installer after creating it.

If true, the MSI installer will be created and then launched. This will automatically open the installation wizard for the project and allow the user to install it.

This value will override any default and skip looking for a value in the [package.metadata.wix] section of the package’s manifest (Cargo.toml).

Sets the output file and destination.

The default is to create a MSI file with the <product-name>-<version>-<arch>.msi file name and extension in the target\wix folder. Use this method to override the destination and file name of the Windows installer.

If the path is to an existing folder or contains a trailing slash (forward or backward), then the default MSI file name is used, but the installer will be available at the specified path. When specifying a file name and path, the .msi file is not required. It will be added automatically.

This value will override any default and skip looking for a value in the [package.metadata.wix] section of the package’s manifest (Cargo.toml).

Sets the package.

If the project is organized using a workspace, this selects the package by name to create an installer. If a workspace is not used, then this has no effect.

Sets the build target.

The default is to use the default target for the environment. Use this method to change the target for the build and installer creation. The value should be a string from the rustc --print target-list command. This enables “cross-compilation” of installers similar to the cross-compilation of Rust code, but only for Windows targets.

Sets the version.

This overrides the version field of the package’s manifest (Cargo.toml). The version should be in the “Major.Minor.Patch” notation.

This value will override any default and skip looking for a value in the [package.metadata.wix] section of the package’s manifest (Cargo.toml).

Builds a context for creating, or building, the installer.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.