fix: prevent duplicate macOS app entries
Add one-click DMG installation, automatically eject verified EdgeEver installer images, and remove unpacked build products after package verification. Prepare v1.6.38 native release metadata.\n\nRefs #115\nRefs #116
This commit is contained in:
1 parent
3aeca0442b
commit
65ece55bfb
9 files changed
+170
-22
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
||||
import { existsSync, readFileSync, readdirSync, rmSync, statSync } from "node:fs";
|
||||
import { basename, join } from "node:path";
|
||||
import { listPackage } from "@electron/asar";
|
||||
|
||||
@@ -29,7 +29,9 @@ for (const sidecarPath of files.filter((path) => /[\\/]resources[\\/]sidecar[\\/
|
||||
|
||||
if (requestedPlatform === "darwin") {
|
||||
assert.ok(existsSync(join(outputDirectory, `EdgeEver-${version}-mac-arm64.dmg`)), "macOS package must contain the current arm64 DMG");
|
||||
const appResources = join(outputDirectory, "mac-arm64", "EdgeEver.app", "Contents", "Resources");
|
||||
const unpackedApp = join(outputDirectory, "mac-arm64", "EdgeEver.app");
|
||||
assert.ok(existsSync(unpackedApp), "macOS package must contain the unpacked app bundle");
|
||||
const appResources = join(unpackedApp, "Contents", "Resources");
|
||||
const sidecar = join(appResources, "sidecar", "edgeever-sidecar");
|
||||
assert.ok(existsSync(sidecar), `macOS app bundle is missing the sidecar: ${sidecar}`);
|
||||
const asarPath = join(appResources, "app.asar");
|
||||
@@ -37,6 +39,10 @@ if (requestedPlatform === "darwin") {
|
||||
const asarFiles = new Set(listPackage(asarPath));
|
||||
assert.ok(asarFiles.has("/src/preload/index.cjs"), "macOS app bundle must contain the sandbox-compatible CommonJS preload");
|
||||
assert.ok(!asarFiles.has("/src/preload/index.mjs"), "macOS app bundle must not contain the unsupported ESM preload");
|
||||
// LaunchServices registers unpacked build products as additional document
|
||||
// handlers. The signed DMG/ZIP are the release artifacts, so discard the
|
||||
// disposable unpacked bundle once its contents have passed verification.
|
||||
rmSync(unpackedApp, { recursive: true, force: true });
|
||||
} else if (requestedPlatform === "win32") {
|
||||
const installer = matchingPrefix(`EdgeEver-${version}-windows-`).some((path) => path.endsWith(".exe"));
|
||||
const unpacked = existsSync(join(outputDirectory, "win-arm64-unpacked", "EdgeEver.exe"));
|
||||
|
||||
Reference in new issue
Block a user