Add CI steps to build and bundle wix dll

This commit is contained in:
Caelan Sayler
2025-05-26 19:51:38 +01:00
parent 408ea6043b
commit d8eab735f8
4 changed files with 26 additions and 13 deletions

View File

@@ -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:

View File

@@ -44,6 +44,9 @@
<None Include="$(MSBuildThisFileDirectory)..\target\release\UpdateMac" Pack="true" PackagePath="vendor" />
<None Include="$(MSBuildThisFileDirectory)..\target\release\UpdateNix_x64" Pack="true" PackagePath="vendor" />
<None Include="$(MSBuildThisFileDirectory)..\target\release\UpdateNix_arm64" Pack="true" PackagePath="vendor" />
<None Include="$(MSBuildThisFileDirectory)..\target\release\velopack_wix_x86.dll" Pack="true" PackagePath="vendor" />
<None Include="$(MSBuildThisFileDirectory)..\target\release\velopack_wix_x64.dll" Pack="true" PackagePath="vendor" />
<None Include="$(MSBuildThisFileDirectory)..\target\release\velopack_wix_arm64.dll" Pack="true" PackagePath="vendor" />
</ItemGroup>
</Target>

View File

@@ -85,13 +85,6 @@
<Files Include="{{SourceDirectoryPath}}\**"/>
<!-- <CustomAction Id="RemoveAppDirectory" Directory="INSTALLFOLDER" Impersonate="no"-->
<!-- ExeCommand="cmd.exe /C rmdir /S /Q &quot;[INSTALLFOLDER]&quot;" Execute="deferred" Return="ignore"/>-->
<!-- <CustomAction Id="RemoveTempDirectory" Directory="TempFolder" Impersonate="yes"-->
<!-- ExeCommand="cmd.exe /C rmdir /S /Q &quot;%TEMP%\velopack_{{AppId}}&quot;" Execute="deferred" Return="ignore"/>-->
<!-- <CustomAction Id="LaunchApplication" Directory="INSTALLFOLDER" Impersonate="yes"-->
<!-- ExeCommand="&quot;[INSTALLFOLDER]{{StubFileName}}&quot;" Execute="immediate" Return="ignore"/>-->
<!-- Add our custom Rust module for custom actions -->
<Binary Id="RustDll" SourceFile="{{RustNativeModulePath}}"/>
<Property Id="RustAppId" Value="{{AppTitle}}"/>

View File

@@ -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")]