Struct wix::initialize::Builder

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

A builder for running the cargo wix init subcommand.

Implementations§

source§

impl<'a> Builder<'a>

source

pub fn new() -> Self

Creates a new Builder instance.

source

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

Sets the path to a bitmap (BMP) file to be used as a banner image across the top of each dialog in the installer.

The banner image must be 493 x 58 pixels. See the Wix Toolset documentation for details about customization.

source

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

Sets the path to the binaries.

The default is to, first, collect all of the bin sections and use the name field within each bin section of the package’s manifest for each binary’s name and create the following source with the .exe file extension: target\release\<binary-name>.exe, where <binary-name> is replaced with the name obtained from each bin section. All binaries are included in the installer. If no bin sections exist, then the package’s name field is used and only one binary is included in the installer.

This method skips creating the binary names and sources from the package’s manifest (Cargo.toml) and uses the supplied paths, regardless of the number of bin sections in the package’s manifest. The binary name is extracted from each supplied path as the file stem (file name without extension).

This method is useful for including binaries, a.k.a. executables, in the installer that are necessary for the application to run but are not necessarily Rust/Cargo built binaries. However, this method overrides all binaries in the Cargo-based project, so if the installer is to include a mixture of external and internal binaries, the internal binaries must be explicitly included in this method.

source

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

Sets the copyright holder for the generated license file and EULA.

The default is to use the authors field of the package’s manifest (Cargo.toml). This method can be used to override the default and set a different copyright holder if and when a Rich Text Format (RTF) license and EULA are generated based on the value of the license field in the package’s manifest (Cargo.toml).

This value is ignored and not used if an EULA is set with the eula method, if a custom EULA is set using the license-file field in the package’s manifest (Cargo.toml), or an EULA is not generated from the license field in the package’s manifest (Cargo.toml).

source

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

Sets the copyright year for the generated license file and EULA.

The default is to use the current year. This method can be used to override the default and set a specific year if and when a Rich Text Format (RTF) license and EULA are generated based on the value of the license field in the package’s manifest (Cargo.toml).

This value is ignored and not used if an EULA is set with the eula method, if a custom EULA is set using the license-file field in the package’s manifest (Cargo.toml), or an EULA is not generated from the license field in the package’s manifest (Cargo.toml).

source

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

Sets the description.

This overrides the description determined from the description field in the package’s manifest (Cargo.toml).

source

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

Sets the path to a bitmap (.bmp) file that will be displayed on the first dialog to the left.

The image must be 493 x 312 pixels. See the Wix Toolset documentation for details about customization.

source

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

Sets the path to a custom End User License Agreement (EULA).

The EULA is the text that appears in the license agreement dialog of the installer, where a checkbox is present for the user to agree to the terms of the license. Typically, this is the same as the license file that is included as a sidecar file in the installation destination of the executable.

The default is to generate an EULA from an embedded template as a RTF file based on the name of the license specified in the license field of the package’s manifest (Cargo.toml). This method can be used to override the default and specify a custom EULA. A custom EULA must be in the RTF format and have the .rtf file extension.

If the license field is not specified or a template for the license does not exist but the license-file field does specify a path to a file with the RTF extension, then that RTF file is used as the EULA for the license agreement dialog in the installer. Finally, if the license-file does not exist or it specifies a file that does not have the .rtf extension, then the license agreement dialog is skipped and there is no EULA for the installer. This would override the default behavior and ensure the license agreement dialog is used.

source

pub fn force(&mut self, f: bool) -> &mut Self

Forces the generation of new output even if the various outputs already exists at the destination.

source

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

Sets the help URL.

The default is to obtain a URL from one of the following fields in the package’s manifest (Cargo.toml): documentation, homepage, or repository. If none of these are specified, then the default is to exclude a help URL from the installer. This will override the default behavior and provide a help URL for the installer if none of the fields exist.

The help URL is the URL that appears in the Add/Remove Program control panel, a.k.a. ARPHELPLINK.

source

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

Sets the path to a package’s manifest (Cargo.toml) to be used to generate a WiX Source (wxs) file from the embedded template.

A wix and wix\main.wxs file will be created in the same directory as the package’s manifest. The default is to use the package’s manifest in the current working directory.

source

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

Sets the path to a file to be used as the sidecar license file.

This will override the license-file field in the package’s manifest (Cargo.toml). If the file has the .rtf extension, then it will also be used for the EULA in the license agreement dialog for the installer. Otherwise, the eula method can be used to set an RTF file as the EULA for the license agreement dialog that is independent of the sidecar license file.

The default is to use the value specified in the license-file field of the package’s manifest or generate a license file and EULA from an embedded template based on the license ID used in the license field of the package’s manifest. If none of these fields are specified or overridden, then a license file is not included in the installation directory and the license agreement dialog is skipped in the installer.

source

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

Sets the manufacturer.

Default is to use the authors field of the package’s manifest (Cargo.toml). This would override the default value.

source

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

Sets the destination for creating all of the output from initialization.

The default is to create all initialization output in the same folder as the package’s manifest (Cargo.toml). Thus, a wix folder will be created within the same folder as the Cargo.toml file and all initialization created files will be placed in the wix folder.

This method can be used to override the default output destination and have the files related to creating an installer placed in a different location inside or outside of the package’s project folder.

source

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

Sets the path to an image file to be used for product icon.

The product icon is the icon that appears for an installed application in the Add/Remove Programs (ARP) control panel. If a product icon is not defined for an application within the installer, then the Windows OS assigns a generic one.

source

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

Sets the package within a workspace to initialize an installer.

Each package within a workspace has its own package manifest, i.e. Cargo.toml. This indicates within package manifest within a workspace should be used when initializing an installer.

source

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

Sets the GUID for the path component.

The default automatically generates the GUID needed for the path component. A GUID is needed so that the path component can be successfully removed on uninstall.

Generally, the path component GUID should be generated only once per project/product and then the same GUID used every time the installer is created. The GUID is stored in the WiX Source (WXS) file. However, this allows using an existing GUID, possibly obtained with another tool.

source

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

Sets the product name.

The default is to use the name field under the package section of the package’s manifest (Cargo.toml). This overrides that value. An error occurs if the name field is not found in the manifest.

The product name is also used for the disk prompt during installation and the name of the default installation destination. For example, a product anme of Example will have an installation destination of C:\Program Files\Example as the default during installation.

source

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

Sets the Upgrade Code GUID.

The default automatically generates the need GUID for the UpgradeCode attribute to the Product tag. The Upgrade Code uniquely identifies the installer. It is used to determine if the new installer is the same product and the current installation should be removed and upgraded to this version. If the GUIDs of the current product and new product do not match, then Windows will treat the two installers as separate products.

Generally, the upgrade code should be generated only one per project/product and then the same code used every time the installer is created and the GUID is stored in the WiX Source (WXS) file. However, this allows the user to provide an existing GUID for the upgrade code.

source

pub fn build(&mut self) -> Execution

Builds a read-only initialization execution.

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.