Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ jobs:
build_command: npx electron-builder --publish never --win --x64
artifact_name: windows-x64-artifacts
- os: windows-latest
display_name: Windows ia32
display_name: Windows win32
build_command: npx electron-builder --publish never --win --ia32
artifact_name: windows-ia32-artifacts
artifact_name: windows-win32-artifacts
- os: ubuntu-latest
display_name: Linux x64
build_command: npx electron-builder --publish never --linux --x64
Expand Down
28 changes: 16 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ jobs:
build_command: npx electron-builder --publish never --win --x64
artifact_name: windows-x64-artifacts
- os: windows-latest
display_name: Windows ia32
display_name: Windows win32
build_command: npx electron-builder --publish never --win --ia32
artifact_name: windows-ia32-artifacts
artifact_name: windows-win32-artifacts
- os: ubuntu-latest
display_name: Linux x64
build_command: npx electron-builder --publish never --linux --x64
Expand Down Expand Up @@ -121,26 +121,30 @@ jobs:
fi
fi

# --- Windows (ia32) ---
if [[ -d artifacts/windows-ia32-artifacts ]]; then
for file in artifacts/windows-ia32-artifacts/*.exe; do
# --- Windows (win32) ---
if [[ -d artifacts/windows-win32-artifacts ]]; then
for file in artifacts/windows-win32-artifacts/*.exe; do
base="$(basename "$file")"
target="$base"
if [[ "$base" != *-ia32.exe ]]; then
target="${base%.exe}-ia32.exe"
if [[ "$base" == *-ia32* ]]; then
target="${base//-ia32/-win32}"
elif [[ "$base" != *-win32.exe ]]; then
target="${base%.exe}-win32.exe"
fi
cp "$file" "release_upload/$target"
done
for file in artifacts/windows-ia32-artifacts/*.exe.blockmap; do
for file in artifacts/windows-win32-artifacts/*.exe.blockmap; do
base="$(basename "$file")"
target="$base"
if [[ "$base" != *-ia32.exe.blockmap ]]; then
target="${base/.exe/-ia32.exe}"
if [[ "$base" == *-ia32* ]]; then
target="${base//-ia32/-win32}"
elif [[ "$base" != *-win32.exe.blockmap ]]; then
target="${base/.exe/-win32.exe}"
fi
cp "$file" "release_upload/$target"
done
if [[ -f artifacts/windows-ia32-artifacts/latest.yml ]]; then
cp artifacts/windows-ia32-artifacts/latest.yml release_upload/latest-ia32.yml
if [[ -f artifacts/windows-win32-artifacts/latest.yml ]]; then
cp artifacts/windows-win32-artifacts/latest.yml release_upload/latest-win32.yml
fi
Comment on lines +124 to 148

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Update win32 metadata when renaming artifacts

The release step now renames 32‑bit Windows installers and blockmaps from *-ia32* to *-win32*, but it still uploads the unmodified latest.yml generated by electron‑builder. That metadata file continues to reference the original *-ia32* filenames, so the auto‑updater will try to download *-ia32.exe assets that no longer exist once the files have been renamed to *-win32.exe. This will break updates for Windows 32‑bit builds. The metadata needs to be rewritten (or generated with win32 names) to match the renamed artifacts before copying.

Useful? React with 👍 / 👎.

fi

Expand Down
10 changes: 5 additions & 5 deletions tests/autoUpdateHelpers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {

test('detectArchFromFileName recognises common Windows architectures', () => {
assert.equal(detectArchFromFileName('app-setup-x64.exe'), 'x64');
assert.equal(detectArchFromFileName('app-setup-ia32.exe'), 'ia32');
assert.equal(detectArchFromFileName('app-setup-win32.exe'), 'ia32');
assert.equal(detectArchFromFileName('APP-X86.msi'), 'ia32');
assert.equal(detectArchFromFileName('build-aarch64.zip'), 'arm64');
assert.equal(detectArchFromFileName('installer-armhf.tar.gz'), 'armv7l');
Expand Down Expand Up @@ -50,7 +50,7 @@ const createUpdateInfo = (overrides: Partial<UpdateDownloadedEvent>): UpdateDown
test('extractCandidateNamesFromUpdateInfo aggregates filenames from multiple sources', () => {
const info = createUpdateInfo({
files: [
{ url: 'https://example.com/app-ia32.exe' } as any,
{ url: 'https://example.com/app-win32.exe' } as any,
{ url: 'https://example.com/app-x64.exe?raw=1' } as any,
],
path: '/tmp/legacy/App-x64.exe',
Expand All @@ -59,11 +59,11 @@ test('extractCandidateNamesFromUpdateInfo aggregates filenames from multiple sou

const candidates = extractCandidateNamesFromUpdateInfo(info, '.exe');
const sorted = [...candidates].sort();
assert.deepEqual(sorted, ['App-x64.exe', 'app-ia32.exe', 'app-x64.exe']);
assert.deepEqual(sorted, ['App-x64.exe', 'app-win32.exe', 'app-x64.exe']);
});

test('filterNamesByArch prefers matches but falls back when none exist', () => {
const names = ['app-ia32.exe', 'app-x64.exe'];
const names = ['app-win32.exe', 'app-x64.exe'];
assert.deepEqual(filterNamesByArch(names, 'x64'), ['app-x64.exe']);
assert.deepEqual(filterNamesByArch(names, 'arm64'), names);
assert.deepEqual(filterNamesByArch(names, null), names);
Expand All @@ -72,7 +72,7 @@ test('filterNamesByArch prefers matches but falls back when none exist', () => {
test('determineDownloadedUpdateArch prioritises metadata that matches the downloaded file', () => {
const info = createUpdateInfo({
files: [
{ url: 'https://example.com/app-1.2.3-windows-ia32-setup.exe' } as any,
{ url: 'https://example.com/app-1.2.3-windows-win32-setup.exe' } as any,
{ url: 'https://example.com/app-1.2.3-windows-x64-setup.exe' } as any,
],
downloadedFile: '/tmp/app-1.2.3-windows-x64-setup.exe',
Expand Down