Skip to content

Commit f115bef

Browse files
committed
fix(website): keep the Windows download on the x64 installer
1 parent d204209 commit f115bef

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

‎website/src/lib/release.test.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ test("the 1.7.0 .dmg names still resolve", () => {
4646
assert.equal(findAsset(old, "macIntel")?.name, "Openscreen-Mac-x64-1.7.0.dmg");
4747
});
4848

49+
test("windows takes the x64 installer once a release also ships an arm64 one", () => {
50+
const both = release("Openscreen.Setup.2.1.0-arm64.exe", "Openscreen.Setup.2.1.0-x64.exe");
51+
assert.equal(findAsset(both, "windows")?.name, "Openscreen.Setup.2.1.0-x64.exe");
52+
});
53+
4954
test("a missing asset or a failed lookup gives null, which the page turns into /releases/latest", () => {
5055
assert.equal(findAsset(release("Openscreen.Setup.1.11.0.exe"), "macArm"), null);
5156
assert.equal(findAsset(null, "windows"), null);

‎website/src/lib/release.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ export type AppLanguage = { lang: string; name: string };
4040
export const ASSET_PATTERNS = {
4141
macArm: /mac.*(arm64|apple-silicon).*\.dmg$/i,
4242
macIntel: /mac.*(x64|intel).*\.dmg$/i,
43-
windows: /\.exe$/i,
43+
// The x64 installer. A release also carries an -arm64.exe, which an x64 PC cannot run;
44+
// Windows on ARM runs the x64 one under emulation.
45+
windows: /^(?!.*arm64).*\.exe$/i,
4446
deb: /\.deb$/i,
4547
rpm: /\.rpm$/i,
4648
pacman: /\.pacman$/i,

0 commit comments

Comments
 (0)