cargo-wix
cargo-wix copied to clipboard
Create an installation integration test
As mentioned in #129, a test that actually runs an installer (MSI) created with the cargo-wix subcommand should be added and the correctness verified. The msiexec
command could be used.
I tried refactoring the run
method for the Execution
type in the create
module following the idea from https://github.com/volks73/cargo-wix/pull/129#issuecomment-730471302. It is not really going to work because the linker/light command's paths and option values depend on the actual execution of the compiler/candle command. Specifically, the WiX Object files must exist on disk before the linker command is built. The WiX Object files are used to determine if a bundle (exe) or installer (msi) are being created. There might be another way to determine that information, but building up the std::process::Command
variables and then testing these is currently too complicated.
I had another thought to add a trait and run_with
method. The trait would define "hooks" that are called after the commands are built, but immediately before they are executed. We could then test the commands are built correctly, like checking the -arch
exists, with a "TestHook" implementation of the trait. This could also be useful for users of the wix
crate/library to execute various actions before and after the "stock" commands are executed.