From d8eab735f8ef6b180e5f76bbdb82cd5809b022b5 Mon Sep 17 00:00:00 2001 From: Caelan Sayler Date: Mon, 26 May 2025 19:51:38 +0100 Subject: [PATCH] Add CI steps to build and bundle wix dll --- .github/workflows/build.yml | 10 +++++++--- src/Directory.Build.targets | 3 +++ .../Msi/Templates/MsiTemplate.hbs | 7 ------- src/vpk/Velopack.Packaging/HelperFile.cs | 19 ++++++++++++++++--- 4 files changed, 26 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d686c988..7155bc3b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,11 +44,11 @@ jobs: target\i686-win7-windows-msvc\release\*.exe target\i686-win7-windows-msvc\release\*.pdb - name: Build Rust (x86) - run: cargo +nightly build --target i686-win7-windows-msvc -Z build-std="core,alloc,std,panic_abort" --release -p velopack_nodeffi -p velopack_libc + run: cargo +nightly build --target i686-win7-windows-msvc -Z build-std="core,alloc,std,panic_abort" --release -p velopack_nodeffi -p velopack_libc -p velopack_wix - name: Build Rust (x64) - run: cargo +nightly build --target x86_64-win7-windows-msvc -Z build-std="core,alloc,std,panic_abort" --release -p velopack_nodeffi -p velopack_libc + run: cargo +nightly build --target x86_64-win7-windows-msvc -Z build-std="core,alloc,std,panic_abort" --release -p velopack_nodeffi -p velopack_libc -p velopack_wix - name: Build Rust (arm64) - run: cargo +nightly build --target aarch64-pc-windows-msvc --release -p velopack_nodeffi -p velopack_libc + run: cargo +nightly build --target aarch64-pc-windows-msvc --release -p velopack_nodeffi -p velopack_libc -p velopack_wix - name: Collect Artifacts run: | move target\i686-win7-windows-msvc\release\velopack_nodeffi.dll target\velopack_nodeffi_win_x86_msvc.node @@ -66,6 +66,10 @@ jobs: move target\i686-win7-windows-msvc\release\velopack_libc.lib target\velopack_libc_win_x86_msvc.lib move target\x86_64-win7-windows-msvc\release\velopack_libc.lib target\velopack_libc_win_x64_msvc.lib move target\aarch64-pc-windows-msvc\release\velopack_libc.lib target\velopack_libc_win_arm64_msvc.lib + + move target\i686-win7-windows-msvc\release\velopack_wix.dll target\velopack_wix_x86.dll + move target\x86_64-win7-windows-msvc\release\velopack_wix.dll target\velopack_wix_x64.dll + move target\aarch64-pc-windows-msvc\release\velopack_wix.dll target\velopack_wix_arm64.dll - name: Upload Rust Build Artifacts uses: actions/upload-artifact@v4 with: diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets index 67b5d964..48e2cada 100644 --- a/src/Directory.Build.targets +++ b/src/Directory.Build.targets @@ -44,6 +44,9 @@ + + + diff --git a/src/vpk/Velopack.Packaging.Windows/Msi/Templates/MsiTemplate.hbs b/src/vpk/Velopack.Packaging.Windows/Msi/Templates/MsiTemplate.hbs index 23509bd5..7f43f660 100644 --- a/src/vpk/Velopack.Packaging.Windows/Msi/Templates/MsiTemplate.hbs +++ b/src/vpk/Velopack.Packaging.Windows/Msi/Templates/MsiTemplate.hbs @@ -85,13 +85,6 @@ - - - - - - - diff --git a/src/vpk/Velopack.Packaging/HelperFile.cs b/src/vpk/Velopack.Packaging/HelperFile.cs index e3ae5862..977516bc 100644 --- a/src/vpk/Velopack.Packaging/HelperFile.cs +++ b/src/vpk/Velopack.Packaging/HelperFile.cs @@ -36,6 +36,21 @@ public static class HelperFile throw new PlatformNotSupportedException($"Update binary is not available for this platform ({target})."); } + public static string GetWixNativeModulePath(RID target) + { +#if DEBUG + return FindHelperFile("velopack_wix.dll"); +#else + return target.Architecture switch { + RuntimeCpu.x86 => FindHelperFile("velopack_wix_x86.dll"), + RuntimeCpu.x64 => FindHelperFile("velopack_wix_x64.dll"), + RuntimeCpu.arm64 => FindHelperFile("velopack_wix_arm64.dll"), + _ => throw new PlatformNotSupportedException($"Wix binary is not available for this platform ({target}).") + }; +#endif + // return @"C:\Source\velopack\target\debug\velopack_wix.dll"; + } + public static string GetUpdatePath(RID target, ILogger log) => FindHelperFile(GetUpdateExeName(target, log)); public static string GetZstdPath() @@ -69,17 +84,15 @@ public static class HelperFile [SupportedOSPlatform("windows")] public static string WixPath => FindHelperFile($"wix\\{WixVersion}\\wix.exe"); - + [SupportedOSPlatform("windows")] public static string WixUiExtPath => FindHelperFile($"wix\\{WixVersion}\\WixToolset.UI.wixext.dll"); [SupportedOSPlatform("windows")] public const string WixVersion = "5.0.2"; - [SupportedOSPlatform("windows")] public static string WixAssetsTopBanner => FindHelperFile("wix\\assets\\top-banner.bmp"); - [SupportedOSPlatform("windows")] public static string WixAssetsDialogBackground => FindHelperFile("wix\\assets\\dialog-background.bmp"); [SupportedOSPlatform("windows")]