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>
impl<'a> Builder<'a>
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.
sourcepub fn binaries(&mut self, b: Option<Vec<&'a str>>) -> &mut Self
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.
sourcepub fn copyright_holder(&mut self, h: Option<&'a str>) -> &mut Self
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).
sourcepub fn copyright_year(&mut self, y: Option<&'a str>) -> &mut Self
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).
sourcepub fn description(&mut self, d: Option<&'a str>) -> &mut Self
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).
sourcepub fn dialog(&mut self, d: Option<&'a str>) -> &mut Self
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.
sourcepub fn eula(&mut self, e: Option<&'a str>) -> &mut Self
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.
sourcepub fn force(&mut self, f: bool) -> &mut Self
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.
sourcepub fn help_url(&mut self, h: Option<&'a str>) -> &mut Self
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
.
sourcepub fn input(&mut self, i: Option<&'a str>) -> &mut Self
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.
sourcepub fn license(&mut self, l: Option<&'a str>) -> &mut Self
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.
sourcepub fn manufacturer(&mut self, m: Option<&'a str>) -> &mut Self
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.
sourcepub fn output(&mut self, o: Option<&'a str>) -> &mut Self
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.
sourcepub fn product_icon(&mut self, p: Option<&'a str>) -> &mut Self
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.
sourcepub fn package(&mut self, p: Option<&'a str>) -> &mut Self
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.
sourcepub fn path_guid(&mut self, p: Option<&'a str>) -> &mut Self
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.
sourcepub fn product_name(&mut self, p: Option<&'a str>) -> &mut Self
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.
sourcepub fn upgrade_guid(&mut self, u: Option<&'a str>) -> &mut Self
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.