diff --git a/.github/workflows/release_nightly.yml b/.github/workflows/release_nightly.yml
index e0ee77813..e05c59e8a 100644
--- a/.github/workflows/release_nightly.yml
+++ b/.github/workflows/release_nightly.yml
@@ -89,12 +89,14 @@ jobs:
target: i686-pc-windows-msvc
RUSTFLAGS: -Ctarget-feature=+crt-static
DESKTOP_FEATURES: jpegxr
+ MSI_ARCH: x86
- build_name: windows-x86_64
os: windows-latest
target: x86_64-pc-windows-msvc
RUSTFLAGS: -Ctarget-feature=+crt-static
DESKTOP_FEATURES: jpegxr
+ MSI_ARCH: x64
env:
PACKAGE_FILE: ${{ needs.create-nightly-release.outputs.package_prefix }}-${{ matrix.build_name }}.${{ startsWith(matrix.build_name, 'win') && 'zip' || 'tar.gz' }}
@@ -117,6 +119,13 @@ jobs:
sudo apt-get update
sudo apt install -y libasound2-dev libxcb-shape0-dev libxcb-xfixes0-dev libgtk-3-dev libudev-dev
+ - name: Install WiX
+ run: |
+ dotnet tool install --global wix
+ wix extension add -g WixToolset.UI.wixext
+ wix extension add -g WixToolset.Util.wixext
+ if: runner.os == 'Windows'
+
- name: Cargo build
run: cargo build --locked --package ruffle_desktop --release ${{matrix.DESKTOP_FEATURES && '--features' }} ${{matrix.DESKTOP_FEATURES}} ${{ matrix.target && '--target' }} ${{ matrix.target }}
env:
@@ -129,6 +138,15 @@ jobs:
cp README.md package/README.md
cp LICENSE.md package/LICENSE.md
+ - name: Package MSI
+ run: |
+ cd desktop/packages/windows/wix
+ wix build ruffle.wxs -ext WixToolset.UI.wixext -ext WixToolset.Util.wixext -arch ${{ matrix.MSI_ARCH }} -o ../../../../package/setup.msi -pdbtype none
+ env:
+ RUFFLE_VERSION: "0.1.0"
+ CARGO_BUILD_DIR: target/${{ matrix.target }}/release
+ if: runner.os == 'Windows'
+
- name: Package Windows
if: runner.os == 'Windows'
run: |
diff --git a/desktop/packages/windows/wix/README.md b/desktop/packages/windows/wix/README.md
new file mode 100644
index 000000000..eb6341e49
--- /dev/null
+++ b/desktop/packages/windows/wix/README.md
@@ -0,0 +1,25 @@
+# Ruffle installer (.msi)
+## Prerequisites
+To build the msi, you need to set up your environment first:
+- [Install `wix`](https://wixtoolset.org/docs/intro/#nettool) (`dotnet tool install --global wix`)
+- `wix extension add -g WixToolset.UI.wixext` to add the UI extension
+- `wix extension add -g WixToolset.Util.wixext` to add the util extension
+- [Build Ruffle desktop](../../../../README.md) for releases (`cargo build --release`)
+ - or at least have a prebuilt `exe` ready to go at `target/release/ruffle_desktop.exe` (inside repository root)
+
+## Environment variables
+### `RUFFLE_VERSION` (required)
+This should be set to the version of Ruffle that this MSI contains.
+The format should either be `1.2.3` or `1.2.3.4` - however the fourth value is IGNORED by Windows for "is it the same version or newer" checks.
+
+### `CARGO_BUILD_DIR` (optional)
+This should be set to the folder that contains `ruffle_desktop`. The default value is `../../../../target/release`.
+
+# Build
+In this directory, run: `wix build ruffle.wxs -ext WixToolset.UI.wixext -ext WixToolset.Util.wixext -arch x64`
+
+You can change `-arch` to `x86` to mark the msi as x86 (and install to, for example, `Program Files (x86)`)
+
+Add `-pdbtype none` to disable generation of the `.wixpdb` if you wish.
+
+Add `-o foo.msi` to control where the MSI is placed.
diff --git a/desktop/packages/windows/wix/banner.png b/desktop/packages/windows/wix/banner.png
new file mode 100644
index 000000000..a735ee9b5
Binary files /dev/null and b/desktop/packages/windows/wix/banner.png differ
diff --git a/desktop/packages/windows/wix/dialog.png b/desktop/packages/windows/wix/dialog.png
new file mode 100644
index 000000000..5a8862c22
Binary files /dev/null and b/desktop/packages/windows/wix/dialog.png differ
diff --git a/desktop/packages/windows/wix/dialog.wxi b/desktop/packages/windows/wix/dialog.wxi
new file mode 100644
index 000000000..7f1c06b67
--- /dev/null
+++ b/desktop/packages/windows/wix/dialog.wxi
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/desktop/packages/windows/wix/ruffle.wxs b/desktop/packages/windows/wix/ruffle.wxs
new file mode 100644
index 000000000..7ad400c3c
--- /dev/null
+++ b/desktop/packages/windows/wix/ruffle.wxs
@@ -0,0 +1,182 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+