cargo-wix icon indicating copy to clipboard operation
cargo-wix copied to clipboard

Create Bundle-based Template for Workspaces

Open volks73 opened this issue 4 years ago • 0 comments

A template for a WiX Source (wxs) file should be added to the subcommand that is used to generate a main.wxs when a virtual manifest (workspace) is detected. This would help address #74, where each binary crate within a workspace would have its own MSI package and main.wxs, but then a wix\main.wxs with a Bundle tag would be used within the root of the workspace, i.e. same folder as the Cargo.toml file with the [workspace] section.

Basis for creating the template would be from this:

<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Bundle Version="1.0.0" UpgradeCode="[Your GUID Here]">
    <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense"/>
   <Chain>
      <MsiPackage SourceFile="client\target\wix\client-0.1.0-x86_64.msi" />
      <MsiPackage SourceFile="server\target\wix\server-0.1.0-x86_64.msi" />
    </Chain>
  </Bundle>
</Wix>

Where a MsiPackage tag would be added to the Chain tag for each binary member with its own MSI package. The version number and architecture of the MSI file names would need to be changed to preprocessor variables so that these values do not need to be manually updated each time the member package version numbers are updated.

Also, a line needs to be added to the BootstrapperApplicationRef tag for specifying the RTF license file. I am not sure how to handle the RTF license file with a virtual manifest. In theory, it is possible for member packages to have different licenses and there is no license key or license-file key in virtual manifests. This might have to be something that is defined in the [package.metadata.wix], which is also available to define in a virtual manifest. It might be something that is only defined with the cargo wix init subcommand and the appropriate option. A warning could be displayed if one is not defined, just like the cargo wix init subcommand in "regular" packages.

The GUID would be generated automatically with the cargo wix init subcommand.

This is mostly for the cargo wix init and cargo wix print subcommand. The default create subcommand will need to be updated and tracked with a separate issue because it would require executing three create commands.

volks73 avatar Mar 22 '20 20:03 volks73