Add 32-bit (x86) Windows build support

Re-introduce Win32 platform configurations to support 32-bit Windows,
which was dropped in 2023. This enables CCExtractor to run on 32-bit
Windows 10 systems.

Changes:
- Add Win32 (x86) platform to VS solution and project configs
- Make vcpkg triplet conditional (x86-windows-static for Win32)
- Update rust.bat to support i686-pc-windows-msvc via RUST_TARGET env var
- Add preprocessor conditional in installer.wxs for ProgramFilesFolder
- Convert CI build workflow to matrix strategy (x64 + x86)
- Update release workflow to produce both x64 and x86 installers

Closes #2116

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Carlos Fernandez
2026-02-18 09:35:11 -08:00
parent 0626bb5929
commit 1aa9762f19
6 changed files with 230 additions and 39 deletions

View File

@@ -2,7 +2,6 @@ name: Build CCExtractor on Windows
env:
RUSTFLAGS: -Ctarget-feature=+crt-static
VCPKG_DEFAULT_TRIPLET: x64-windows-static
VCPKG_COMMIT: ab2977be50c702126336e5088f4836060733c899
on:
@@ -30,6 +29,20 @@ on:
jobs:
build:
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
include:
- arch: x64
platform: x64
vcpkg_triplet: x64-windows-static
rust_target: x86_64-pc-windows-msvc
gpac_install: "C:\\Program Files\\GPAC"
- arch: x86
platform: Win32
vcpkg_triplet: x86-windows-static
rust_target: i686-pc-windows-msvc
gpac_install: "C:\\Program Files\\GPAC"
steps:
- name: Check out repository
uses: actions/checkout@v6
@@ -41,7 +54,7 @@ jobs:
# Install GPAC (fast, ~30s, not worth caching complexity)
- name: Install gpac
run: choco install gpac --version 2.4.0 --no-progress
run: choco install gpac --version 2.4.0 --no-progress ${{ matrix.arch == 'x86' && '--forcex86' || '' }}
# Use lukka/run-vcpkg for better caching
- name: Setup vcpkg
@@ -58,13 +71,13 @@ jobs:
uses: actions/cache@v5
with:
path: ${{ github.workspace }}/vcpkg/installed
key: vcpkg-installed-${{ runner.os }}-${{ env.VCPKG_COMMIT }}-${{ hashFiles('windows/vcpkg.json') }}
key: vcpkg-installed-${{ runner.os }}-${{ matrix.vcpkg_triplet }}-${{ env.VCPKG_COMMIT }}-${{ hashFiles('windows/vcpkg.json') }}
restore-keys: |
vcpkg-installed-${{ runner.os }}-${{ env.VCPKG_COMMIT }}-
vcpkg-installed-${{ runner.os }}-${{ matrix.vcpkg_triplet }}-${{ env.VCPKG_COMMIT }}-
- name: Install vcpkg dependencies
if: steps.vcpkg-installed-cache.outputs.cache-hit != 'true'
run: ${{ github.workspace }}/vcpkg/vcpkg.exe install --x-install-root ${{ github.workspace }}/vcpkg/installed/
run: ${{ github.workspace }}/vcpkg/vcpkg.exe install --triplet ${{ matrix.vcpkg_triplet }} --x-install-root ${{ github.workspace }}/vcpkg/installed/
working-directory: windows
# Cache Rust/Cargo artifacts
@@ -79,21 +92,24 @@ jobs:
${{ runner.os }}-cargo-registry-
# Cache Cargo build artifacts - rust.bat sets CARGO_TARGET_DIR to windows/
# which results in artifacts at windows/x86_64-pc-windows-msvc/
- name: Cache Cargo build artifacts
uses: actions/cache@v5
with:
path: ${{ github.workspace }}/windows/x86_64-pc-windows-msvc
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('src/rust/**/*.rs') }}
path: ${{ github.workspace }}/windows/${{ matrix.rust_target }}
key: ${{ runner.os }}-${{ matrix.arch }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('src/rust/**/*.rs') }}
restore-keys: |
${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}-
${{ runner.os }}-cargo-build-
${{ runner.os }}-${{ matrix.arch }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}-
${{ runner.os }}-${{ matrix.arch }}-cargo-build-
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.rust_target }}
- name: Install Win 10 SDK
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
# Build Release-Full
- name: Build Release-Full
@@ -102,20 +118,22 @@ jobs:
LLVM_CONFIG_PATH: "C:\\Program Files\\LLVM\\bin\\llvm-config"
BINDGEN_EXTRA_CLANG_ARGS: -fmsc-version=0
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
run: msbuild ccextractor.sln /p:Configuration=Release-Full /p:Platform=x64
VCPKG_DEFAULT_TRIPLET: ${{ matrix.vcpkg_triplet }}
run: msbuild ccextractor.sln /p:Configuration=Release-Full /p:Platform=${{ matrix.platform }}
working-directory: ./windows
- name: Display Release version information
if: matrix.arch == 'x64'
run: ./ccextractorwinfull.exe --version
working-directory: ./windows/x64/Release-Full
working-directory: ./windows/${{ matrix.platform }}/Release-Full
- name: Upload Release artifact
uses: actions/upload-artifact@v6
with:
name: CCExtractor Windows Release build
name: CCExtractor Windows ${{ matrix.arch }} Release build
path: |
./windows/x64/Release-Full/ccextractorwinfull.exe
./windows/x64/Release-Full/*.dll
./windows/${{ matrix.platform }}/Release-Full/ccextractorwinfull.exe
./windows/${{ matrix.platform }}/Release-Full/*.dll
# Build Debug-Full (reuses cached Cargo artifacts)
- name: Build Debug-Full
@@ -124,19 +142,21 @@ jobs:
LLVM_CONFIG_PATH: "C:\\Program Files\\LLVM\\bin\\llvm-config"
BINDGEN_EXTRA_CLANG_ARGS: -fmsc-version=0
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
run: msbuild ccextractor.sln /p:Configuration=Debug-Full /p:Platform=x64
VCPKG_DEFAULT_TRIPLET: ${{ matrix.vcpkg_triplet }}
run: msbuild ccextractor.sln /p:Configuration=Debug-Full /p:Platform=${{ matrix.platform }}
working-directory: ./windows
- name: Display Debug version information
if: matrix.arch == 'x64'
continue-on-error: true
run: ./ccextractorwinfull.exe --version
working-directory: ./windows/x64/Debug-Full
working-directory: ./windows/${{ matrix.platform }}/Debug-Full
- name: Upload Debug artifact
uses: actions/upload-artifact@v6
with:
name: CCExtractor Windows Debug build
name: CCExtractor Windows ${{ matrix.arch }} Debug build
path: |
./windows/x64/Debug-Full/ccextractorwinfull.exe
./windows/x64/Debug-Full/ccextractorwinfull.pdb
./windows/x64/Debug-Full/*.dll
./windows/${{ matrix.platform }}/Debug-Full/ccextractorwinfull.exe
./windows/${{ matrix.platform }}/Debug-Full/ccextractorwinfull.pdb
./windows/${{ matrix.platform }}/Debug-Full/*.dll

View File

@@ -10,13 +10,28 @@ permissions:
env:
RUSTFLAGS: -Ctarget-feature=+crt-static
VCPKG_DEFAULT_TRIPLET: x64-windows-static
VCPKG_DEFAULT_BINARY_CACHE: C:\vcpkg\.cache
VCPKG_COMMIT: ab2977be50c702126336e5088f4836060733c899
jobs:
build_windows:
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
include:
- arch: x64
platform: x64
vcpkg_triplet: x64-windows-static
rust_target: x86_64-pc-windows-msvc
wix_arch: x64
suffix: ""
- arch: x86
platform: Win32
vcpkg_triplet: x86-windows-static
rust_target: i686-pc-windows-msvc
wix_arch: x86
suffix: "_x86"
steps:
- name: Check out repository
uses: actions/checkout@v6
@@ -46,7 +61,7 @@ jobs:
with:
msbuild-architecture: x64
- name: Install gpac
run: choco install gpac --version 2.4.0
run: choco install gpac --version 2.4.0 ${{ matrix.arch == 'x86' && '--forcex86' || '' }}
- name: Setup vcpkg
run: mkdir C:\vcpkg\.cache
- name: Cache vcpkg
@@ -55,20 +70,22 @@ jobs:
with:
path: |
C:\vcpkg\.cache
key: vcpkg-${{ runner.os }}-${{ env.VCPKG_COMMIT }}
key: vcpkg-${{ runner.os }}-${{ matrix.vcpkg_triplet }}-${{ env.VCPKG_COMMIT }}
- name: Build vcpkg
run: |
git clone https://github.com/microsoft/vcpkg
./vcpkg/bootstrap-vcpkg.bat
- name: Install dependencies
run: ${{ github.workspace }}/vcpkg/vcpkg.exe install --x-install-root ${{ github.workspace }}/vcpkg/installed/
run: ${{ github.workspace }}/vcpkg/vcpkg.exe install --triplet ${{ matrix.vcpkg_triplet }} --x-install-root ${{ github.workspace }}/vcpkg/installed/
working-directory: windows
- uses: actions-rs/toolchain@v1
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
override: true
targets: ${{ matrix.rust_target }}
- name: Install Win 10 SDK
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
- name: build Release-Full
env:
LIBCLANG_PATH: "C:\\Program Files\\LLVM\\lib"
@@ -76,10 +93,11 @@ jobs:
CARGO_TARGET_DIR: "..\\..\\windows"
BINDGEN_EXTRA_CLANG_ARGS: -fmsc-version=0
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
run: msbuild ccextractor.sln /p:Configuration=Release-Full /p:Platform=x64
VCPKG_DEFAULT_TRIPLET: ${{ matrix.vcpkg_triplet }}
run: msbuild ccextractor.sln /p:Configuration=Release-Full /p:Platform=${{ matrix.platform }}
working-directory: ./windows
- name: Copy files to directory for installer
run: mkdir installer; cp ./x64/Release-Full/ccextractorwinfull.exe ./installer; cp ./x64/Release-Full/*.dll ./installer
run: mkdir installer; cp ./${{ matrix.platform }}/Release-Full/ccextractorwinfull.exe ./installer; cp ./${{ matrix.platform }}/Release-Full/*.dll ./installer
working-directory: ./windows
- name: Download tessdata for OCR support
run: |
@@ -106,15 +124,15 @@ jobs:
run: Get-ChildItem -Recurse ./installer
working-directory: ./windows
- name: Create portable zip
run: Compress-Archive -Path ./installer/* -DestinationPath ./CCExtractor.${{ steps.get_version.outputs.DISPLAY_VERSION }}_win_portable.zip
run: Compress-Archive -Path ./installer/* -DestinationPath ./CCExtractor.${{ steps.get_version.outputs.DISPLAY_VERSION }}${{ matrix.suffix }}_win_portable.zip
working-directory: ./windows
- name: Build installer
run: wix build -arch x64 -ext WixToolset.UI.wixext -d "AppVersion=${{ steps.get_version.outputs.VERSION }}" -o CCExtractor.${{ steps.get_version.outputs.DISPLAY_VERSION }}.msi installer.wxs CustomUI.wxs
run: wix build -arch ${{ matrix.wix_arch }} -ext WixToolset.UI.wixext -d "AppVersion=${{ steps.get_version.outputs.VERSION }}" -o CCExtractor.${{ steps.get_version.outputs.DISPLAY_VERSION }}${{ matrix.suffix }}.msi installer.wxs CustomUI.wxs
working-directory: ./windows
- name: Upload as asset
uses: AButler/upload-release-assets@v3.0
with:
files: './windows/CCExtractor.${{ steps.get_version.outputs.DISPLAY_VERSION }}.msi;./windows/CCExtractor.${{ steps.get_version.outputs.DISPLAY_VERSION }}_win_portable.zip'
files: './windows/CCExtractor.${{ steps.get_version.outputs.DISPLAY_VERSION }}${{ matrix.suffix }}.msi;./windows/CCExtractor.${{ steps.get_version.outputs.DISPLAY_VERSION }}${{ matrix.suffix }}_win_portable.zip'
repo-token: ${{ secrets.GITHUB_TOKEN }}
create_linux_package:
runs-on: ubuntu-latest