Struct wix::create::Builder

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

A builder for running the cargo wix subcommand.

Implementations§

source§

impl<'a> Builder<'a>

source

pub fn new() -> Self

Creates a new Builder instance.

source

pub fn bin_path(&mut self, b: Option<&'a str>) -> &mut Self

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.

source

pub fn capture_output(&mut self, c: bool) -> &mut Self

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.

source

pub fn compiler_args(&mut self, c: Option<Vec<&'a str>>) -> &mut Self

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.

source

pub fn culture(&mut self, c: Option<&'a str>) -> &mut Self

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

source

pub fn debug_build(&mut self, d: bool) -> &mut Self

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.

source

pub fn debug_name(&mut self, d: bool) -> &mut Self

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.

source

pub fn includes(&mut self, i: Option<Vec<&'a str>>) -> &mut Self

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

source

pub fn input(&mut self, i: Option<&'a str>) -> &mut Self

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

source

pub fn linker_args(&mut self, l: Option<Vec<&'a str>>) -> &mut Self

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.

source

pub fn locale(&mut self, l: Option<&'a str>) -> &mut Self

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

source

pub fn name(&mut self, p: Option<&'a str>) -> &mut Self

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

source

pub fn no_build(&mut self, n: bool) -> &mut Self

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

source

pub fn target_bin_dir(&mut self, p: Option<&'a str>) -> &mut Self

Specifies that binaries should be sourced from the given directory.

Specifically this sets CargoTargetBinDir in wxs templates. It is intended to be combined with no_build(true) to let another tool orchestrate cargo-wix and handle the builds for it.

source

pub fn install(&mut self, n: bool) -> &mut Self

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

source

pub fn output(&mut self, o: Option<&'a str>) -> &mut Self

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

source

pub fn package(&mut self, p: Option<&'a str>) -> &mut Self

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.

source

pub fn target(&mut self, v: Option<&'a str>) -> &mut Self

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.

source

pub fn version(&mut self, v: Option<&'a str>) -> &mut Self

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

source

pub fn build(&mut self) -> Execution

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

source

pub fn profile(&mut self, profile: Option<&'a str>) -> &mut Self

Trait Implementations§

source§

impl<'a> Clone for Builder<'a>

source§

fn clone(&self) -> Builder<'a>

Returns a copy 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<'a> Debug for Builder<'a>

source§

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

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

impl<'a> Default for Builder<'a>

source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for Builder<'a>

§

impl<'a> Send for Builder<'a>

§

impl<'a> Sync for Builder<'a>

§

impl<'a> Unpin for Builder<'a>

§

impl<'a> UnwindSafe for Builder<'a>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.