From 61871e37ffe0a4b0a699698ffa9ae5a54f273c24 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 18 Nov 2026 21:02:51 +1100 Subject: [PATCH] Fix Linux GUI executable casing in nightly archive electron-builder's Linux target lowercases the GUI binary by default, so the nightly tarball shipped `projectGenerator-x.y.z/projectgenerator`. The openFrameworks installer looks for case-sensitive `projectGenerator` and fails before its bundled CLI fallback runs. Set `executableName` on the `linux` config so the GUI binary keeps its correct case alongside the existing ASAR layout and unpacked native CLI. Extend `scripts/test_asar_package.cjs` to check the GUI executable filename (exact case, no lowercase variant) and its exec bit on Linux, so the regression surfaces in CI across Ubuntu 24 x64, Ubuntu 22 x64 and Linux arm64. Bump GUI 0.122.0 -> 0.123.0 and CLI 0.127.0 -> 0.128.0 per the repo's release-version policy. --- commandLine/src/defines.h | 2 +- frontend/npm-shrinkwrap.json | 4 ++-- frontend/package.json | 5 +++-- scripts/test_asar_package.cjs | 26 ++++++++++++++++++++++++++ 4 files changed, 32 insertions(+), 5 deletions(-) diff --git a/commandLine/src/defines.h b/commandLine/src/defines.h index a72e02bd..ac63ee45 100644 --- a/commandLine/src/defines.h +++ b/commandLine/src/defines.h @@ -1,5 +1,5 @@ #define OFPROJECTGENERATOR_MAJOR_VERSION "0" -#define OFPROJECTGENERATOR_MINOR_VERSION "127" +#define OFPROJECTGENERATOR_MINOR_VERSION "128" #define OFPROJECTGENERATOR_PATCH_VERSION "0" #define PG_VERSION (OFPROJECTGENERATOR_MAJOR_VERSION "." OFPROJECTGENERATOR_MINOR_VERSION "." OFPROJECTGENERATOR_PATCH_VERSION) diff --git a/frontend/npm-shrinkwrap.json b/frontend/npm-shrinkwrap.json index 8c2dfb9d..2198ff73 100644 --- a/frontend/npm-shrinkwrap.json +++ b/frontend/npm-shrinkwrap.json @@ -1,12 +1,12 @@ { "name": "projectGenerator", - "version": "0.122.0", + "version": "0.123.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "projectGenerator", - "version": "0.122.0", + "version": "0.123.0", "license": "MIT", "dependencies": { "@types/jquery": "^3.5.34", diff --git a/frontend/package.json b/frontend/package.json index 79f1a71a..97591fcc 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,7 +1,7 @@ { "name": "projectGenerator", "productName": "projectGenerator", - "version": "0.122.0", + "version": "0.123.0", "description": "Build electron GUI openFrameworks projectGenerator", "license": "MIT", "main": "index.js", @@ -58,7 +58,8 @@ }, "linux": { "icon": "static/icon", - "target": "tar.gz" + "target": "tar.gz", + "executableName": "projectGenerator" }, "files": [ "index.html", diff --git a/scripts/test_asar_package.cjs b/scripts/test_asar_package.cjs index 2e73f388..eca9fd3b 100644 --- a/scripts/test_asar_package.cjs +++ b/scripts/test_asar_package.cjs @@ -7,6 +7,31 @@ const { pathToFileURL } = require('node:url'); const { spawnSync } = require('node:child_process'); const { bundledGeneratorPath } = require('../frontend/packaged-paths'); +function verifyGuiExecutable(resourcesDir) { + // On Linux and Windows, electron-builder places the GUI binary alongside + // resources/. The openFrameworks installer expects the case-sensitive + // name `projectGenerator` (.exe on Windows). A lowercase executable + // breaks installation on case-sensitive filesystems before the bundled + // CLI fallback is reached. Use a directory listing so the check holds + // on case-sensitive (Linux ext4) and still catches regressions. + if (process.platform !== 'linux' && process.platform !== 'win32') return; + const unpacked = path.resolve(resourcesDir, '..'); + const expectedName = process.platform === 'win32' ? 'projectGenerator.exe' : 'projectGenerator'; + const wrongName = process.platform === 'win32' ? 'projectgenerator.exe' : 'projectgenerator'; + const entries = fs.readdirSync(unpacked); + assert.ok(entries.includes(expectedName), `GUI executable missing or wrongly cased: expected ${expectedName} in ${unpacked} (found: ${entries.join(', ')})`); + if (expectedName !== wrongName) { + assert.ok(!entries.includes(wrongName), `Lowercase GUI executable must not exist: ${path.join(unpacked, wrongName)}`); + } + const target = path.join(unpacked, expectedName); + const stat = fs.statSync(target); + assert.ok(stat.isFile(), `GUI executable is not a regular file: ${target}`); + if (process.platform === 'linux') { + assert.ok((stat.mode & 0o111) !== 0, `GUI executable missing execute bit: ${target} (mode ${stat.mode.toString(8)})`); + } + console.log(`GUI executable verified: ${target}`); +} + async function main() { assert.ok(process.argv[2], 'Pass the packaged app resources directory'); const archive = path.resolve(process.argv[2], 'app.asar'); @@ -23,6 +48,7 @@ async function main() { if (result.error) throw result.error; assert.equal(result.status, 0, result.stderr || result.stdout); assert.match(result.stdout, /version/); + verifyGuiExecutable(process.argv[2]); console.log('ASAR assets, unpacked native generator and spawn --version passed'); console.log(result.stdout.trim()); }