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, 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
, inititalize
, 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
command. This command is focused on
cleaning up build output, similar to the cargo clean
subcommand.create
, or default, command. The default
command, cargo wix
, is focused on creating, or building, the installer
using the WiX Toolset.init
command. The init
command for the cargo 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.print
command. This command is focused on
printing various templates based on a package’s manifest (Cargo.toml) or
end-user input.purge
command. This command is focused on
removing all files associated with cargo wix
subcommand.sign
command. This command focuses on signing
installers using the Windows SDK signtool
application.Enums
Platform
attribute of the Package
element.Constants
bin
folder for the WiX Toolet’s compiler (candle.exe)
and linker (light.exe).