Expand description
§wix
Library
The goal of the cargo-wix project and the wix
library is to make it easy
to create a Windows installer (msi) for any Rust project. The cargo-wix
project is primarily implemented as a cargo subcommand, but its core
functionality has been organized into a separate library. Documentation for
the binary and Command Line Interface (CLI) are provided in the module-level
documentation for the binary and the cargo wix --help
command.
§Table of Contents
§Usage
First, add this to your Cargo.toml
:
[dependencies]
wix = "0.1"
Next, if not using Rust 2018 edition, then add this to the lib.rs
or
main.rs
file for your project:
extern crate wix;
§Organization
Each subcommand is organized into a separate module. So, there is a
create
, initialize
, print
, etc. module within the crate. Some of the
modules are in a single Rust source file, while others are organized into
sub-folders. Each module follows the Builder design pattern, so there is a
Builder
and Execution
struct for each module/subcommand. The Builder
struct is used to customize the execution of the subcommand and builds an
Execution
struct. The Execution
struct is responsible for actually
executing the subcommand, which generally involves executing a process with
the std::process::Command
struct, but not always. Each method for the
Builder
struct generally corresponds to a CLI option or argument found in
the cargo wix
subcommand and binary.
Modules§
- clean
- The implementation for the
clean
command. This command is focused on cleaning up build output, similar to thecargo clean
subcommand. - create
- The implementation for the
create
, or default, command. The default command,cargo wix
, is focused on creating, or building, the installer using the WiX Toolset. - initialize
- The implementation for the
init
command. Theinit
command for thecargo wix
subcommand is focused on creating a WiX Source file (wxs) based on the contents of the Cargo manifest file (Cargo.toml) for the project and any run-time based settings. - The implementation for the
print
command. This command is focused on printing various templates based on a package’s manifest (Cargo.toml) or end-user input. - purge
- The implementation for the
purge
command. This command is focused on removing all files associated withcargo wix
subcommand. - sign
- The implementation for the
sign
command. This command focuses on signing installers using the Windows SDKsigntool
application. - stored_
path - Utilities for working with paths that need to be stored in files in a cross-platform way.
Enums§
- Cultures
- The various culture codes for localization.
- Error
- The error type for wix-related operations and associated traits.
- Template
- The different templates that can be printed or written to a file.
- Timestamp
Server - The aliases for the URLs to different Microsoft Authenticode timestamp servers.
- WixArch
- The different architectures supported by the WiX Toolset.
Constants§
- BINARY_
FOLDER_ NAME - The name of the folder where binaries are typically stored.
- CARGO
- The name of the builder application for a Rust project.
- CARGO_
MANIFEST_ FILE - The file name with extension for a package’s manifest.
- EXE_
FILE_ EXTENSION - The file extension for an executable.
- LICENSE_
FILE_ NAME - The file name without an extension when generating a license.
- MSIEXEC
- The application name without the file extension of the
msiexec
utility. - MSI_
FILE_ EXTENSION - The file extension for a Windows installer.
- RTF_
FILE_ EXTENSION - The file extension for a Rich Text Format (RTF) file.
- SIGNTOOL
- The name of the signer application from the Windows SDK.
- SIGNTOOL_
PATH_ KEY - The name of the environment variable to specify the path to the signer application.
- WIX
- The default name of the folder for output from this subcommand.
- WIX_
COMPILER - The application name without the file extension of the compiler for the Windows installer.
- WIX_
LINKER - The application name without the file extension of the linker for the Windows installer.
- WIX_
OBJECT_ FILE_ EXTENSION - The file extension for a WiX Toolset object file, which is the output from the WiX compiler.
- WIX_
PATH_ KEY - The name of the environment variable created by the WiX Toolset installer
that points to the
bin
folder for the WiX Toolet’s compiler (candle.exe) and linker (light.exe). - WIX_
SOURCE_ FILE_ EXTENSION - The file extension of the WiX Source file, which is the input to the WiX Toolset compiler.
- WIX_
SOURCE_ FILE_ NAME - The default file name for the WiX Source file, which is the input to the WiX Toolset compiler.