52 lines
2 KiB
Diff
52 lines
2 KiB
Diff
we can't do fuses because we ship one binary in the electron package.
|
|
and we can't import them here, since they are in devDependencies, which are uninstalled at this stage.
|
|
|
|
--- ./electron-builder.ts.orig
|
|
+++ ./electron-builder.ts
|
|
@@ -2,8 +2,7 @@
|
|
import * as fs from "node:fs";
|
|
import * as path from "node:path";
|
|
import * as plist from "plist";
|
|
-import { AfterPackContext, Arch, Configuration as BaseConfiguration, Platform } from "electron-builder";
|
|
-import { computeData } from "app-builder-lib/out/asar/integrity";
|
|
+import { Configuration as BaseConfiguration } from "electron-builder";
|
|
import { readFile, writeFile } from "node:fs/promises";
|
|
|
|
/**
|
|
@@ -46,26 +45,6 @@
|
|
} & BaseConfiguration["deb"];
|
|
}
|
|
|
|
-async function injectAsarIntegrity(context: AfterPackContext) {
|
|
- const packager = context.packager;
|
|
-
|
|
- // We only need to re-generate asar on universal Mac builds, due to https://github.com/electron/universal/issues/116
|
|
- if (packager.platform !== Platform.MAC || context.arch !== Arch.universal) return;
|
|
-
|
|
- const resourcesPath = packager.getResourcesDir(context.appOutDir);
|
|
- const asarIntegrity = await computeData({
|
|
- resourcesPath,
|
|
- resourcesRelativePath: "Resources",
|
|
- resourcesDestinationPath: resourcesPath,
|
|
- extraResourceMatchers: [],
|
|
- });
|
|
-
|
|
- const plistPath = path.join(resourcesPath, "..", "Info.plist");
|
|
- const data = plist.parse(await readFile(plistPath, "utf8")) as unknown as Writable<plist.PlistObject>;
|
|
- data["ElectronAsarIntegrity"] = asarIntegrity as unknown as Writable<plist.PlistValue>;
|
|
- await writeFile(plistPath, plist.build(data));
|
|
-}
|
|
-
|
|
/**
|
|
* @type {import('electron-builder').Configuration}
|
|
* @see https://www.electron.build/configuration/configuration
|
|
@@ -89,9 +68,6 @@
|
|
|
|
loadBrowserProcessSpecificV8Snapshot: false,
|
|
enableEmbeddedAsarIntegrityValidation: true,
|
|
- },
|
|
- afterPack: async (context: AfterPackContext) => {
|
|
- await injectAsarIntegrity(context);
|
|
},
|
|
files: [
|
|
"package.json",
|