app-builder-lib 27.0.0-alpha.3 → 27.0.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/codeSign/mac/macCodeSign.d.ts.map +1 -1
- package/dist/codeSign/mac/macCodeSign.js +3 -6
- package/dist/codeSign/mac/macCodeSign.js.map +1 -1
- package/dist/codeSign/win/signtoolBaseSignManager.d.ts.map +1 -1
- package/dist/codeSign/win/signtoolBaseSignManager.js +11 -3
- package/dist/codeSign/win/signtoolBaseSignManager.js.map +1 -1
- package/dist/codeSign/win/windowsSignAzureManager.d.ts.map +1 -1
- package/dist/codeSign/win/windowsSignAzureManager.js +31 -21
- package/dist/codeSign/win/windowsSignAzureManager.js.map +1 -1
- package/dist/configuration.d.ts +37 -44
- package/dist/configuration.d.ts.map +1 -1
- package/dist/configuration.js.map +1 -1
- package/dist/electron/ElectronFramework.js +2 -2
- package/dist/electron/ElectronFramework.js.map +1 -1
- package/dist/electron/electronVersion.d.ts.map +1 -1
- package/dist/electron/electronVersion.js +1 -11
- package/dist/electron/electronVersion.js.map +1 -1
- package/dist/fileMatcher.d.ts +27 -2
- package/dist/fileMatcher.d.ts.map +1 -1
- package/dist/fileMatcher.js +204 -16
- package/dist/fileMatcher.js.map +1 -1
- package/dist/indexInternal.d.ts +6 -5
- package/dist/indexInternal.d.ts.map +1 -1
- package/dist/indexInternal.js +6 -5
- package/dist/indexInternal.js.map +1 -1
- package/dist/macPackager.d.ts +5 -0
- package/dist/macPackager.d.ts.map +1 -1
- package/dist/macPackager.js +35 -0
- package/dist/macPackager.js.map +1 -1
- package/dist/node-module-collector/moduleManager.d.ts +3 -1
- package/dist/node-module-collector/moduleManager.d.ts.map +1 -1
- package/dist/node-module-collector/moduleManager.js +9 -1
- package/dist/node-module-collector/moduleManager.js.map +1 -1
- package/dist/node-module-collector/nodeModulesCollector.d.ts +13 -23
- package/dist/node-module-collector/nodeModulesCollector.d.ts.map +1 -1
- package/dist/node-module-collector/nodeModulesCollector.js +52 -122
- package/dist/node-module-collector/nodeModulesCollector.js.map +1 -1
- package/dist/node-module-collector/pnpmNodeModulesCollector.js +5 -5
- package/dist/node-module-collector/pnpmNodeModulesCollector.js.map +1 -1
- package/dist/node-module-collector/types.d.ts +2 -0
- package/dist/node-module-collector/types.d.ts.map +1 -1
- package/dist/node-module-collector/types.js.map +1 -1
- package/dist/options/PlatformSpecificBuildOptions.d.ts +0 -6
- package/dist/options/PlatformSpecificBuildOptions.d.ts.map +1 -1
- package/dist/options/PlatformSpecificBuildOptions.js.map +1 -1
- package/dist/options/SnapOptions.d.ts +15 -13
- package/dist/options/SnapOptions.d.ts.map +1 -1
- package/dist/options/SnapOptions.js.map +1 -1
- package/dist/options/linuxOptions.d.ts +0 -10
- package/dist/options/linuxOptions.d.ts.map +1 -1
- package/dist/options/linuxOptions.js.map +1 -1
- package/dist/options/winOptions.d.ts +164 -34
- package/dist/options/winOptions.d.ts.map +1 -1
- package/dist/options/winOptions.js.map +1 -1
- package/dist/packager.d.ts +2 -0
- package/dist/packager.d.ts.map +1 -1
- package/dist/packager.js +20 -22
- package/dist/packager.js.map +1 -1
- package/dist/platformPackager.d.ts +3 -0
- package/dist/platformPackager.d.ts.map +1 -1
- package/dist/platformPackager.js +11 -6
- package/dist/platformPackager.js.map +1 -1
- package/dist/publish/PublishManager.d.ts +1 -0
- package/dist/publish/PublishManager.d.ts.map +1 -1
- package/dist/publish/PublishManager.js +7 -2
- package/dist/publish/PublishManager.js.map +1 -1
- package/dist/targets/linux/FlatpakTarget.d.ts.map +1 -1
- package/dist/targets/linux/FlatpakTarget.js +4 -1
- package/dist/targets/linux/FlatpakTarget.js.map +1 -1
- package/dist/targets/linux/FpmTarget.d.ts +6 -0
- package/dist/targets/linux/FpmTarget.d.ts.map +1 -1
- package/dist/targets/linux/FpmTarget.js +28 -6
- package/dist/targets/linux/FpmTarget.js.map +1 -1
- package/dist/targets/linux/LinuxTargetHelper.d.ts +14 -0
- package/dist/targets/linux/LinuxTargetHelper.d.ts.map +1 -1
- package/dist/targets/linux/LinuxTargetHelper.js +38 -59
- package/dist/targets/linux/LinuxTargetHelper.js.map +1 -1
- package/dist/targets/linux/appimage/AppImageTarget.d.ts +1 -0
- package/dist/targets/linux/appimage/AppImageTarget.d.ts.map +1 -1
- package/dist/targets/linux/appimage/AppImageTarget.js +12 -14
- package/dist/targets/linux/appimage/AppImageTarget.js.map +1 -1
- package/dist/targets/linux/appimage/appImageUtil.d.ts +4 -0
- package/dist/targets/linux/appimage/appImageUtil.d.ts.map +1 -1
- package/dist/targets/linux/appimage/appImageUtil.js +11 -4
- package/dist/targets/linux/appimage/appImageUtil.js.map +1 -1
- package/dist/targets/linux/appimage/appLauncher.d.ts.map +1 -1
- package/dist/targets/linux/appimage/appLauncher.js +5 -11
- package/dist/targets/linux/appimage/appLauncher.js.map +1 -1
- package/dist/targets/linux/launcherScript.d.ts +32 -0
- package/dist/targets/linux/launcherScript.d.ts.map +1 -0
- package/dist/targets/linux/launcherScript.js +24 -0
- package/dist/targets/linux/launcherScript.js.map +1 -0
- package/dist/targets/linux/snap/SnapTarget.d.ts +1 -1
- package/dist/targets/linux/snap/SnapTarget.d.ts.map +1 -1
- package/dist/targets/linux/snap/SnapTarget.js +23 -1
- package/dist/targets/linux/snap/SnapTarget.js.map +1 -1
- package/dist/targets/linux/snap/core24.d.ts +1 -1
- package/dist/targets/linux/snap/core24.d.ts.map +1 -1
- package/dist/targets/linux/snap/core24.js +3 -2
- package/dist/targets/linux/snap/core24.js.map +1 -1
- package/dist/targets/linux/snap/coreCustom.d.ts +1 -1
- package/dist/targets/linux/snap/coreCustom.d.ts.map +1 -1
- package/dist/targets/linux/snap/coreCustom.js +2 -2
- package/dist/targets/linux/snap/coreCustom.js.map +1 -1
- package/dist/targets/linux/snap/coreLegacy.d.ts +1 -1
- package/dist/targets/linux/snap/coreLegacy.d.ts.map +1 -1
- package/dist/targets/linux/snap/coreLegacy.js +8 -7
- package/dist/targets/linux/snap/coreLegacy.js.map +1 -1
- package/dist/targets/linux/snap/snapCommand.d.ts +2 -2
- package/dist/targets/linux/snap/snapCommand.d.ts.map +1 -1
- package/dist/targets/linux/snap/snapCommand.js +4 -10
- package/dist/targets/linux/snap/snapCommand.js.map +1 -1
- package/dist/targets/linux/snap/snapcraftBuilder.d.ts +7 -1
- package/dist/targets/linux/snap/snapcraftBuilder.d.ts.map +1 -1
- package/dist/targets/linux/snap/snapcraftBuilder.js +57 -20
- package/dist/targets/linux/snap/snapcraftBuilder.js.map +1 -1
- package/dist/targets/targetFactory.d.ts +7 -0
- package/dist/targets/targetFactory.d.ts.map +1 -1
- package/dist/targets/targetFactory.js +28 -0
- package/dist/targets/targetFactory.js.map +1 -1
- package/dist/targets/win/AppxTarget.d.ts.map +1 -1
- package/dist/targets/win/AppxTarget.js +17 -9
- package/dist/targets/win/AppxTarget.js.map +1 -1
- package/dist/targets/win/MsiTarget.d.ts.map +1 -1
- package/dist/targets/win/MsiTarget.js +8 -11
- package/dist/targets/win/MsiTarget.js.map +1 -1
- package/dist/targets/win/nsis/NsisTarget.d.ts +3 -2
- package/dist/targets/win/nsis/NsisTarget.d.ts.map +1 -1
- package/dist/targets/win/nsis/NsisTarget.js +26 -49
- package/dist/targets/win/nsis/NsisTarget.js.map +1 -1
- package/dist/targets/win/nsis/nsisScriptGenerator.d.ts.map +1 -1
- package/dist/targets/win/nsis/nsisScriptGenerator.js +3 -2
- package/dist/targets/win/nsis/nsisScriptGenerator.js.map +1 -1
- package/dist/targets/win/nsis/nsisUtil.d.ts +5 -2
- package/dist/targets/win/nsis/nsisUtil.d.ts.map +1 -1
- package/dist/targets/win/nsis/nsisUtil.js +46 -22
- package/dist/targets/win/nsis/nsisUtil.js.map +1 -1
- package/dist/targets/win/nsis/progId.d.ts +21 -0
- package/dist/targets/win/nsis/progId.d.ts.map +1 -0
- package/dist/targets/win/nsis/progId.js +60 -0
- package/dist/targets/win/nsis/progId.js.map +1 -0
- package/dist/toolsets/7zip.d.ts.map +1 -1
- package/dist/toolsets/7zip.js +3 -1
- package/dist/toolsets/7zip.js.map +1 -1
- package/dist/toolsets/appimage.d.ts +3 -3
- package/dist/toolsets/appimage.d.ts.map +1 -1
- package/dist/toolsets/appimage.js +9 -6
- package/dist/toolsets/appimage.js.map +1 -1
- package/dist/toolsets/custom.d.ts +1 -3
- package/dist/toolsets/custom.d.ts.map +1 -1
- package/dist/toolsets/custom.js +4 -133
- package/dist/toolsets/custom.js.map +1 -1
- package/dist/toolsets/fpm.d.ts.map +1 -1
- package/dist/toolsets/fpm.js +11 -5
- package/dist/toolsets/fpm.js.map +1 -1
- package/dist/toolsets/icons.d.ts.map +1 -1
- package/dist/toolsets/icons.js +13 -2
- package/dist/toolsets/icons.js.map +1 -1
- package/dist/toolsets/linuxToolsMac.d.ts.map +1 -1
- package/dist/toolsets/linuxToolsMac.js +4 -1
- package/dist/toolsets/linuxToolsMac.js.map +1 -1
- package/dist/toolsets/nsis.d.ts.map +1 -1
- package/dist/toolsets/nsis.js +6 -3
- package/dist/toolsets/nsis.js.map +1 -1
- package/dist/toolsets/version.d.ts +12 -0
- package/dist/toolsets/version.d.ts.map +1 -0
- package/dist/toolsets/version.js +13 -0
- package/dist/toolsets/version.js.map +1 -0
- package/dist/toolsets/winCodeSign.d.ts +11 -3
- package/dist/toolsets/winCodeSign.d.ts.map +1 -1
- package/dist/toolsets/winCodeSign.js +45 -27
- package/dist/toolsets/winCodeSign.js.map +1 -1
- package/dist/toolsets/wine.d.ts +2 -1
- package/dist/toolsets/wine.d.ts.map +1 -1
- package/dist/toolsets/wine.js +15 -13
- package/dist/toolsets/wine.js.map +1 -1
- package/dist/util/NodeModuleCopyHelper.js +3 -3
- package/dist/util/NodeModuleCopyHelper.js.map +1 -1
- package/dist/util/appFileCopier.d.ts +39 -0
- package/dist/util/appFileCopier.d.ts.map +1 -1
- package/dist/util/appFileCopier.js +71 -20
- package/dist/util/appFileCopier.js.map +1 -1
- package/dist/util/archCompatibility.d.ts +42 -0
- package/dist/util/archCompatibility.d.ts.map +1 -0
- package/dist/util/archCompatibility.js +202 -0
- package/dist/util/archCompatibility.js.map +1 -0
- package/dist/util/config/config.d.ts +1 -0
- package/dist/util/config/config.d.ts.map +1 -1
- package/dist/util/config/config.js +4 -1
- package/dist/util/config/config.js.map +1 -1
- package/dist/util/config/load.d.ts +2 -2
- package/dist/util/config/load.d.ts.map +1 -1
- package/dist/util/config/load.js +3 -12
- package/dist/util/config/load.js.map +1 -1
- package/dist/util/config/schemaValidator.js +1 -1
- package/dist/util/config/schemaValidator.js.map +1 -1
- package/dist/util/electronGet.d.ts +6 -3
- package/dist/util/electronGet.d.ts.map +1 -1
- package/dist/util/electronGet.js +23 -9
- package/dist/util/electronGet.js.map +1 -1
- package/dist/util/flags.d.ts +0 -1
- package/dist/util/flags.d.ts.map +1 -1
- package/dist/util/flags.js +0 -3
- package/dist/util/flags.js.map +1 -1
- package/dist/util/hash.d.ts +1 -1
- package/dist/util/hash.d.ts.map +1 -1
- package/dist/util/hash.js +1 -15
- package/dist/util/hash.js.map +1 -1
- package/dist/util/installOrRebuild.d.ts +38 -0
- package/dist/util/installOrRebuild.d.ts.map +1 -0
- package/dist/util/{yarn.js → installOrRebuild.js} +65 -14
- package/dist/util/installOrRebuild.js.map +1 -0
- package/dist/util/langs.d.ts.map +1 -1
- package/dist/util/langs.js +1 -0
- package/dist/util/langs.js.map +1 -1
- package/dist/util/mac/macosIconComposer.d.ts +2 -1
- package/dist/util/mac/macosIconComposer.d.ts.map +1 -1
- package/dist/util/mac/macosIconComposer.js +40 -58
- package/dist/util/mac/macosIconComposer.js.map +1 -1
- package/dist/util/streamSpawnToFile.d.ts +47 -0
- package/dist/util/streamSpawnToFile.d.ts.map +1 -0
- package/dist/util/streamSpawnToFile.js +110 -0
- package/dist/util/streamSpawnToFile.js.map +1 -0
- package/dist/util/toolsetLock.d.ts +2 -0
- package/dist/util/toolsetLock.d.ts.map +1 -1
- package/dist/util/toolsetLock.js +31 -5
- package/dist/util/toolsetLock.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +8 -8
- package/scheme.json +94 -130
- package/templates/appx/appxmanifest.xml +1 -2
- package/templates/nsis/assistedMessages.yml +17 -0
- package/templates/nsis/messages.yml +5 -0
- package/dist/util/yarn.d.ts +0 -23
- package/dist/util/yarn.d.ts.map +0 -1
- package/dist/util/yarn.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom.js","sourceRoot":"","sources":["../../src/toolsets/custom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,eAAe,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACxG,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,IAAI,CAAA;AACxD,OAAO,KAAK,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1C,OAAO,KAAK,GAAG,MAAM,KAAK,CAAA;AAC1B,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAA;AAEpC,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAClF,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAEtC,KAAK,UAAU,qBAAqB,CAAC,MAAqB,EAAE,YAAoB;IAC9E,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,CAAA;IAC7B,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAA;QACtC,IAA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,IAAI,KAAK,CAAC,iBAAiB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAA;QAC3E,CAAC;QAED,MAAM,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAA;QAClD,MAAM,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC9B,CAAC;YAAS,CAAC;QACT,MAAM,OAAO,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,EAAE,4BAA4B,CAAC,CAAC,CAAA;IAC/E,CAAC;AACH,CAAC","sourcesContent":["import { exec, exists, log, sanitizeDirPath, to7zaOutputSwitch, validateSecuredUrl } from \"builder-util\"\nimport { createReadStream, createWriteStream } from \"fs\"\nimport * as fs from \"fs/promises\"\nimport { mkdir, rmdir, stat } from \"fs/promises\"\nimport * as path from \"path\"\nimport * as lockfile from \"proper-lockfile\"\nimport { pipeline } from \"stream/promises\"\nimport * as tar from \"tar\"\nimport * as unzipper from \"unzipper\"\nimport { ToolsetCustom } from \"../configuration.js\"\nimport { downloadBuilderToolset, getCacheDirectory } from \"../util/electronGet.js\"\nimport { getPath7za } from \"./7zip.js\"\n\nasync function validateCustomToolset(custom: ToolsetCustom, resourcesDir: string) {\n const url = custom.url.trim()\n try {\n const parsed = validateSecuredUrl(url)\n if (parsed.pathname.endsWith(\"/\")) {\n throw new Error(`URL must point to a file, but got ${parsed.href}`)\n }\n return { toolset: custom, type: \"url\" }\n } catch {\n // Ignore. If the URL is invalid, validate it as a file path\n }\n if (url.startsWith(\"file://\")) {\n const p = url.slice(\"file://\".length)\n const isWithinResources = path.normalize(p).startsWith(path.normalize(resourcesDir + path.sep))\n const isValid = path.isAbsolute(p) || isWithinResources\n const type =\n isValid &&\n (await exists(p)) &&\n (await stat(p)\n .then(s => (s.isDirectory() ? \"directory\" : s.isFile() ? \"file\" : false))\n .catch(() => false))\n if (type) {\n return { toolset: custom, type }\n }\n }\n throw new Error(`Invalid custom toolset: ${url}. Must be a valid https:// URL or a file:// path.`)\n}\n\n// Strip the file:// prefix and sanitize the path against resourcesDir (relative paths must be within it)\nfunction resolveFilePath(url: string, resourcesDir: string): string {\n const p = url.startsWith(\"file://\") ? url.slice(\"file://\".length) : url\n return path.isAbsolute(p) ? sanitizeDirPath(p) : sanitizeDirPath(p, resourcesDir)\n}\n\nconst _customToolsetCache = new Map<string, Promise<string>>()\n\nexport function clearCustomToolsetCache(): void {\n _customToolsetCache.clear()\n}\n\nexport function getCustomToolsetPath(custom: ToolsetCustom, resourcesDir: string): Promise<string> {\n const key = JSON.stringify({ url: custom.url, checksum: custom.checksum ?? \"\", resourcesDir })\n let cached = _customToolsetCache.get(key)\n if (cached == null) {\n cached = _resolveCustomToolsetPath(custom, resourcesDir)\n _customToolsetCache.set(key, cached)\n }\n return cached\n}\n\nasync function _resolveCustomToolsetPath(custom: ToolsetCustom, resourcesDir: string): Promise<string> {\n const { type, toolset } = await validateCustomToolset(custom, resourcesDir)\n\n if (type === \"directory\") {\n return resolveFilePath(toolset.url, resourcesDir)\n }\n\n if (!toolset.checksum) {\n throw new Error(`ToolsetCustom.checksum is required for ${type} toolsets (url: ${toolset.url})`)\n }\n\n const binaryVersion = toolset.version ?? toolset.checksum.substring(0, 8)\n const releaseName = `${binaryVersion}-${hashUrlSafe(toolset.url)}`\n\n if (type === \"url\") {\n return downloadBuilderToolset({\n releaseName: releaseName,\n filenameWithExt: path.basename(toolset.url),\n checksums: { [path.basename(toolset.url)]: toolset.checksum },\n overrideUrl: toolset.url,\n })\n } else if (type === \"file\") {\n const cacheDir = getCacheDirectory({ isAvoidSystemOnWindows: true, allowEnvVarOverride: true })\n const customToolsetDir = path.join(cacheDir, \"custom-toolsets\")\n await mkdir(customToolsetDir, { recursive: true })\n\n // wipe first to ensure idempotent extraction if the source file changed since last extraction\n const toolsetTarget = path.join(customToolsetDir, releaseName)\n if (await exists(toolsetTarget)) {\n await rmdir(toolsetTarget, { recursive: true })\n }\n await extractArchive(resolveFilePath(toolset.url, resourcesDir), toolsetTarget)\n return toolsetTarget\n }\n\n throw new Error(`Unsupported custom toolset type: ${type}`)\n}\n\nexport function hashUrlSafe(input: string, length = 6): string {\n let hash = 5381\n for (let i = 0; i < input.length; i++) {\n hash = ((hash << 5) + hash) ^ input.charCodeAt(i)\n }\n hash >>>= 0\n const out = hash.toString(36)\n return out.length >= length ? out.slice(0, length) : out.padStart(length, \"0\")\n}\n\nasync function extractZipStreaming(file: string, dir: string): Promise<void> {\n // Pass 1: read central directory once to collect Unix modes (one seek to EOF)\n const zipDir = await unzipper.Open.file(file)\n const entryModes = new Map<string, number>()\n for (const entry of zipDir.files) {\n const mode = (entry.externalFileAttributes >> 16) & 0xffff\n if (mode > 0) {\n entryModes.set(entry.path, mode)\n }\n }\n const isSymlink = (mode: number) => (mode & 0o170000) === 0o120000\n\n // Pass 2: stream from byte 0 — no per-entry seeks, no Docker hang\n const entries = createReadStream(file).pipe(unzipper.Parse({ forceStream: true }))\n for await (const entry of entries as AsyncIterable<unzipper.Entry>) {\n const destPath = path.resolve(dir, entry.path)\n if (!destPath.startsWith(dir + path.sep) && destPath !== dir) {\n throw new Error(`Path traversal blocked: ${entry.path}`)\n }\n const mode = entryModes.get(entry.path) ?? 0\n if (mode > 0 && isSymlink(mode)) {\n const target = (await entry.buffer()).toString()\n if (path.isAbsolute(target)) {\n throw new Error(`Absolute symlink target blocked: ${target}`)\n }\n const resolvedTarget = path.resolve(path.dirname(destPath), target)\n if (!resolvedTarget.startsWith(dir + path.sep) && resolvedTarget !== dir) {\n throw new Error(`Symlink target escapes extraction dir: ${target}`)\n }\n await fs.mkdir(path.dirname(destPath), { recursive: true })\n await fs.symlink(target, destPath)\n } else if (entry.type === \"Directory\") {\n await fs.mkdir(destPath, { recursive: true })\n entry.autodrain()\n } else {\n await fs.mkdir(path.dirname(destPath), { recursive: true })\n await pipeline(entry, createWriteStream(destPath))\n if (mode > 0) {\n await fs.chmod(destPath, mode & 0o7777)\n }\n }\n }\n}\n\nexport async function extractArchive(file: string, dir: string) {\n const tmpDir = `${dir}.tmp`\n await fs.mkdir(tmpDir, { recursive: true })\n\n const release = await lockfile.lock(tmpDir, {\n retries: { retries: 100, minTimeout: 1000, maxTimeout: 5000 },\n stale: 120000,\n })\n\n try {\n await fs.rm(tmpDir, { recursive: true, force: true })\n await fs.mkdir(tmpDir, { recursive: true })\n\n // Guard against transient window in @electron/get's non-atomic putFileInCache (remove → move).\n for (let i = 0; !(await exists(file)); i++) {\n if (i >= 4) {\n throw Object.assign(new Error(`Source archive not found after retries: ${file}`), { code: \"ENOENT\", path: file })\n }\n log.warn({ file, attempt: i + 1 }, \"source archive transiently missing, retrying\")\n await new Promise(r => setTimeout(r, 300 * (i + 1)))\n }\n\n if (file.endsWith(\".tar.gz\") || file.endsWith(\".tgz\")) {\n await tar.extract({ file, cwd: tmpDir, strip: 1 })\n } else if (file.endsWith(\".tar.xz\") || file.endsWith(\".txz\")) {\n const cmd7za = await getPath7za()\n const xzOutDir = `${tmpDir}.xz`\n await fs.rm(xzOutDir, { recursive: true, force: true })\n await fs.mkdir(xzOutDir, { recursive: true })\n try {\n await exec(cmd7za, [\"x\", \"-bd\", file, to7zaOutputSwitch(sanitizeDirPath(xzOutDir)), \"-y\"])\n const innerTar = (await fs.readdir(xzOutDir)).find(f => f.endsWith(\".tar\"))\n if (innerTar == null) {\n throw new Error(`xz decompression of ${path.basename(file)} produced no .tar archive`)\n }\n await tar.extract({ file: path.join(xzOutDir, innerTar), cwd: tmpDir, strip: 1 })\n } finally {\n await fs.rm(xzOutDir, { recursive: true, force: true })\n }\n } else if (file.endsWith(\".zip\")) {\n await extractZipStreaming(file, tmpDir)\n } else if (file.endsWith(\".7z\")) {\n const cmd7za = await getPath7za()\n try {\n await exec(cmd7za, [\"x\", \"-bd\", file, to7zaOutputSwitch(sanitizeDirPath(tmpDir)), \"-y\"])\n } catch (e: any) {\n const files = await fs.readdir(tmpDir)\n if (files.length === 0) {\n log.warn({ file, tmpDir, error: e.message }, \"7z extraction produced no output\")\n throw new Error(`7z extraction failed for ${file}: ${e.message}`)\n }\n log.warn({ error: e.message, filesExtracted: files.length }, \"7z reported error but extracted files\")\n }\n } else {\n throw new Error(`Unsupported archive format: ${path.basename(file)}`)\n }\n\n const extractedFiles = await fs.readdir(tmpDir)\n if (extractedFiles.length === 0) {\n throw new Error(`Extraction of ${path.basename(file)} produced no files`)\n }\n\n await fs.rm(dir, { recursive: true, force: true })\n await fs.rename(tmpDir, dir)\n } finally {\n await release().catch(err => log.warn({ err }, \"failed to release lockfile\"))\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"custom.js","sourceRoot":"","sources":["../../src/toolsets/custom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAC1E,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,OAAO,EAAE,6BAA6B,EAAE,sBAAsB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAE3H,KAAK,UAAU,qBAAqB,CAAC,MAAqB,EAAE,YAAqB;IAC/E,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,CAAA;IAC7B,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAA;QACtC,IAAI,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAClC,MAAM,IAAI,KAAK,CAAC,qCAAqC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAA;QACrE,CAAC;QACD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EA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AAI,KAAK,CAAC,oCAAoC,IAAI,EAAE,CAAC,CAAA;AAC7D,CAAC","sourcesContent":["import { exists, sanitizeDirPath, validateSecuredUrl } from \"builder-util\"\nimport { mkdir, rmdir, stat } from \"fs/promises\"\nimport * as path from \"path\"\nimport { ToolsetCustom } from \"../configuration.js\"\nimport { cacheDirectoryOverrideAllowed, downloadBuilderToolset, extractArchive, hashUrlSafe } from \"../util/electronGet.js\"\n\nasync function validateCustomToolset(custom: ToolsetCustom, resourcesDir?: string) {\n const url = custom.url.trim()\n try {\n const parsed = validateSecuredUrl(url)\n if (parsed.pathname.endsWith(\"/\")) {\n throw new Error(`URL must point to a file, but got ${parsed.href}`)\n }\n return { toolset: custom, type: \"url\" }\n } catch {\n // Ignore. If the URL is invalid, validate it as a file path\n }\n if (url.startsWith(\"file://\")) {\n const p = url.slice(\"file://\".length)\n const isWithinResources = resourcesDir ? path.normalize(p).startsWith(path.normalize(resourcesDir + path.sep)) : false\n const isValid = path.isAbsolute(p) || isWithinResources\n const type =\n isValid &&\n (await exists(p)) &&\n (await stat(p)\n .then(s => (s.isDirectory() ? \"directory\" : s.isFile() ? \"file\" : false))\n .catch(() => false))\n if (type) {\n return { toolset: custom, type }\n }\n }\n throw new Error(`Invalid custom toolset: ${url}. Must be a valid https:// URL or a file:// path.`)\n}\n\n// Strip the file:// prefix and sanitize the path against resourcesDir (relative paths must be within it)\nfunction resolveFilePath(url: string, resourcesDir?: string): string {\n const p = url.startsWith(\"file://\") ? url.slice(\"file://\".length) : url\n return path.isAbsolute(p) ? sanitizeDirPath(p) : sanitizeDirPath(p, resourcesDir)\n}\n\nconst _customToolsetCache = new Map<string, Promise<string>>()\n\nexport function clearCustomToolsetCache(): void {\n _customToolsetCache.clear()\n}\n\nexport function getCustomToolsetPath(custom: ToolsetCustom, resourcesDir?: string): Promise<string> {\n const key = JSON.stringify({ url: custom.url, checksum: custom.checksum ?? \"\", resourcesDir })\n let cached = _customToolsetCache.get(key)\n if (cached == null) {\n cached = _resolveCustomToolsetPath(custom, resourcesDir)\n _customToolsetCache.set(key, cached)\n }\n return cached\n}\n\nasync function _resolveCustomToolsetPath(custom: ToolsetCustom, resourcesDir?: string): Promise<string> {\n const { type, toolset } = await validateCustomToolset(custom, resourcesDir)\n\n if (type === \"directory\") {\n return resolveFilePath(toolset.url, resourcesDir)\n }\n\n if (!toolset.checksum) {\n throw new Error(`ToolsetCustom.checksum is required for ${type} toolsets (url: ${toolset.url})`)\n }\n\n const binaryVersion = toolset.version ?? toolset.checksum.substring(0, 8)\n const releaseName = `${binaryVersion}-${hashUrlSafe(toolset.url)}`\n\n if (type === \"url\") {\n return downloadBuilderToolset({\n releaseName: releaseName,\n filenameWithExt: path.basename(toolset.url),\n checksums: { [path.basename(toolset.url)]: toolset.checksum },\n overrideUrl: toolset.url,\n })\n } else if (type === \"file\") {\n const cacheDir = await cacheDirectoryOverrideAllowed.value\n const customToolsetDir = path.join(cacheDir, \"custom-toolsets\")\n await mkdir(customToolsetDir, { recursive: true })\n\n // wipe first to ensure idempotent extraction if the source file changed since last extraction\n const toolsetTarget = path.join(customToolsetDir, releaseName)\n if (await exists(toolsetTarget)) {\n await rmdir(toolsetTarget, { recursive: true })\n }\n await extractArchive(resolveFilePath(toolset.url, resourcesDir), toolsetTarget)\n return toolsetTarget\n }\n\n throw new Error(`Unsupported custom toolset type: ${type}`)\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fpm.d.ts","sourceRoot":"","sources":["../../src/toolsets/fpm.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fpm.d.ts","sourceRoot":"","sources":["../../src/toolsets/fpm.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAkBnD,wBAAsB,UAAU,CAAC,OAAO,EAAE,aAAa,CAAC,KAAK,CAAC,EAAE,YAAY,EAAE,MAAM,mBAyCnF"}
|
package/dist/toolsets/fpm.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { InvalidConfigurationError } from "builder-util";
|
|
1
2
|
import * as path from "path";
|
|
2
3
|
import { downloadBuilderToolset } from "../util/electronGet.js";
|
|
3
|
-
import { isUseSystemFpm } from "../util/flags.js";
|
|
4
4
|
import { getCustomToolsetPath } from "./custom.js";
|
|
5
|
+
import { resolveToolsetVersion } from "./version.js";
|
|
6
|
+
// Newest FPM bundle — selected when the config is unset / null / "latest".
|
|
7
|
+
const FPM_LATEST = "2.2.1";
|
|
5
8
|
const fpmChecksums = {
|
|
6
9
|
"2.2.1": {
|
|
7
10
|
"fpm-1.17.0-ruby-3.4.3-linux-amd64.7z": "2ef73acbcbfd26503369cb3a9b0345aa7fae251d69130537ee6ff47b402f828e",
|
|
@@ -13,13 +16,16 @@ const fpmChecksums = {
|
|
|
13
16
|
};
|
|
14
17
|
export async function getFpmPath(toolset, resourcesDir) {
|
|
15
18
|
const exec = "fpm";
|
|
16
|
-
|
|
17
|
-
return exec;
|
|
18
|
-
}
|
|
19
|
+
// A custom toolset is an explicit user override — honored on every platform, before any platform default/fallback.
|
|
19
20
|
if (typeof toolset === "object" && toolset != null) {
|
|
20
21
|
const vendorPath = await getCustomToolsetPath(toolset, resourcesDir);
|
|
21
22
|
return path.resolve(vendorPath, exec);
|
|
22
23
|
}
|
|
24
|
+
if (process.platform === "win32") {
|
|
25
|
+
// No fpm binary is bundled for Windows. Rather than resolving a bare `fpm` from $PATH (a binary-hijack
|
|
26
|
+
// vector), require an explicit custom toolset pointing at the directory that contains the fpm executable.
|
|
27
|
+
throw new InvalidConfigurationError(`fpm is not bundled for Windows. Configure a custom toolset pointing at the directory containing your fpm executable, e.g. toolsets: { fpm: { url: "file:///absolute/path/to/fpm/dir" } }`);
|
|
28
|
+
}
|
|
23
29
|
const getKey = () => {
|
|
24
30
|
if (process.platform === "linux") {
|
|
25
31
|
if (process.arch == "x64") {
|
|
@@ -37,7 +43,7 @@ export async function getFpmPath(toolset, resourcesDir) {
|
|
|
37
43
|
return "fpm-1.17.0-ruby-3.4.3-darwin-x86_64.7z";
|
|
38
44
|
};
|
|
39
45
|
const filename = getKey();
|
|
40
|
-
const version = toolset
|
|
46
|
+
const version = resolveToolsetVersion(toolset, FPM_LATEST);
|
|
41
47
|
const fpmPath = await downloadBuilderToolset({
|
|
42
48
|
releaseName: `fpm@${version}`,
|
|
43
49
|
filenameWithExt: filename,
|
package/dist/toolsets/fpm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fpm.js","sourceRoot":"","sources":["../../src/toolsets/fpm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"fpm.js","sourceRoot":"","sources":["../../src/toolsets/fpm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAEpD,2EAA2E;AAC3E,MAAM,UAAU,GAAG,OAAO,CAAA;AAE1B,MAAM,YAAY,GAAG;IACnB,OAAO,EAAE;QACP,sCAAsC,EAAE,kEAAkE;QAC1G,wCAAwC,EAAE,kEAAkE;QAC5G,wCAAwC,EAAE,kEAAkE;QAC5G,uCAAuC,EAAE,kEAAkE;QAC3G,qCAAqC,EAAE,kEAAkE;KAC1G;CACO,CAAA;AAEV,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,OAA6B,EAAE,YAAoB;IAClF,MAAM,IAAI,GAAG,KAAK,CAAA;IAClB,mHAAmH;IACnH,IAAI,OAAO,OAAO,KAAK,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"\nimport * as path from \"path\"\nimport { ToolsetConfig } from \"../configuration.js\"\nimport { downloadBuilderToolset } from \"../util/electronGet.js\"\nimport { getCustomToolsetPath } from \"./custom.js\"\nimport { resolveToolsetVersion } from \"./version.js\"\n\n// Newest FPM bundle — selected when the config is unset / null / \"latest\".\nconst FPM_LATEST = \"2.2.1\"\n\nconst fpmChecksums = {\n \"2.2.1\": {\n \"fpm-1.17.0-ruby-3.4.3-linux-amd64.7z\": \"2ef73acbcbfd26503369cb3a9b0345aa7fae251d69130537ee6ff47b402f828e\",\n \"fpm-1.17.0-ruby-3.4.3-darwin-x86_64.7z\": \"50eff4214e3e30e2a8bbc35854f80acabb3260ea9e87f5835c60f898eedb320e\",\n \"fpm-1.17.0-ruby-3.4.3-linux-arm64v8.7z\": \"553f047eacbc63423bae1eca5958bcdc720c1f6f4135cb815f5ec99f48d3bd55\",\n \"fpm-1.17.0-ruby-3.4.3-darwin-arm64.7z\": \"e44b60765367cd11b0b9fa5f1966762137ee45ec02d49a3e9668475031e97873\",\n \"fpm-1.17.0-ruby-3.4.3-linux-i386.7z\": \"f4091110728de8259dcab181761e74141b4b65d409a26e642c7271bd0b61eab4\",\n },\n} as const\n\nexport async function getFpmPath(toolset: ToolsetConfig[\"fpm\"], resourcesDir: string) {\n const exec = \"fpm\"\n // A custom toolset is an explicit user override — honored on every platform, before any platform default/fallback.\n if (typeof toolset === \"object\" && toolset != null) {\n const vendorPath = await getCustomToolsetPath(toolset, resourcesDir)\n return path.resolve(vendorPath, exec)\n }\n\n if (process.platform === \"win32\") {\n // No fpm binary is bundled for Windows. Rather than resolving a bare `fpm` from $PATH (a binary-hijack\n // vector), require an explicit custom toolset pointing at the directory that contains the fpm executable.\n throw new InvalidConfigurationError(\n `fpm is not bundled for Windows. Configure a custom toolset pointing at the directory containing your fpm executable, e.g. toolsets: { fpm: { url: \"file:///absolute/path/to/fpm/dir\" } }`\n )\n }\n\n const getKey = () => {\n if (process.platform === \"linux\") {\n if (process.arch == \"x64\") {\n return \"fpm-1.17.0-ruby-3.4.3-linux-amd64.7z\"\n } else if (process.arch === \"arm64\") {\n return \"fpm-1.17.0-ruby-3.4.3-linux-arm64v8.7z\"\n }\n return \"fpm-1.17.0-ruby-3.4.3-linux-i386.7z\"\n }\n // darwin arm64\n if (process.arch === \"arm64\") {\n return \"fpm-1.17.0-ruby-3.4.3-darwin-arm64.7z\"\n }\n return \"fpm-1.17.0-ruby-3.4.3-darwin-x86_64.7z\"\n }\n\n const filename = getKey()\n const version = resolveToolsetVersion(toolset, FPM_LATEST)\n const fpmPath = await downloadBuilderToolset({\n releaseName: `fpm@${version}`,\n filenameWithExt: filename,\n checksums: fpmChecksums[version],\n githubOrgRepo: \"electron-userland/electron-builder-binaries\",\n })\n return path.resolve(fpmPath, exec)\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../src/toolsets/icons.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../src/toolsets/icons.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAqBnD,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAW9G;AAED,KAAK,qBAAqB,GAAG;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,EAAE,MAAM,GAAG,KAAK,GAAG,KAAK,CAAA;IACpC,MAAM,EAAE,MAAM,CAAA;IACd,YAAY,EAAE,aAAa,CAAC,OAAO,CAAC,CAAA;IACpC,YAAY,EAAE,MAAM,CAAA;CACrB,CAAA;AAID,wBAAsB,YAAY,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAcxI"}
|
package/dist/toolsets/icons.js
CHANGED
|
@@ -1,17 +1,27 @@
|
|
|
1
1
|
import { exec, exists, InvalidConfigurationError, sanitizeDirPath } from "builder-util";
|
|
2
2
|
import * as path from "path";
|
|
3
3
|
import { downloadBuilderToolset } from "../util/electronGet.js";
|
|
4
|
+
import { withIconsLock } from "../util/toolsetLock.js";
|
|
4
5
|
import { getCustomToolsetPath } from "./custom.js";
|
|
6
|
+
import { resolveToolsetVersion } from "./version.js";
|
|
7
|
+
// Newest icons-conversion bundle — selected when the config is unset / null / "latest".
|
|
8
|
+
const ICONS_LATEST = "1.2.1";
|
|
5
9
|
const iconsToolsChecksums = {
|
|
6
10
|
"1.1.0": {
|
|
7
11
|
"icons-bundle.tar.gz": "2241c9501aa5ddd19317956449f50a1bc311df2c34058aae9bf8bfe62081eaec",
|
|
8
12
|
},
|
|
13
|
+
"1.2.0": {
|
|
14
|
+
"icons-bundle.tar.gz": "788add2400487fe00d5ceac4a8347bd71fc43c8c988fde879f929992ea0c03ea",
|
|
15
|
+
},
|
|
16
|
+
"1.2.1": {
|
|
17
|
+
"icons-bundle.tar.gz": "193241afc7c81ab165fa0af15ef0af88f796eb69e8e5bb4249a49310d8be242a",
|
|
18
|
+
},
|
|
9
19
|
};
|
|
10
20
|
export async function getIconsToolsetPath(icons, resourcesDir) {
|
|
11
21
|
if (typeof icons === "object" && icons != null) {
|
|
12
22
|
return getCustomToolsetPath(icons, resourcesDir);
|
|
13
23
|
}
|
|
14
|
-
const version = icons
|
|
24
|
+
const version = resolveToolsetVersion(icons, ICONS_LATEST);
|
|
15
25
|
return downloadBuilderToolset({
|
|
16
26
|
releaseName: `icons@${version}`,
|
|
17
27
|
filenameWithExt: "icons-bundle.tar.gz",
|
|
@@ -31,6 +41,7 @@ export async function runIconsTool({ inputFile, outputFormat, outDir, iconsTools
|
|
|
31
41
|
if (!(await exists(scriptPath))) {
|
|
32
42
|
throw new InvalidConfigurationError(`Icons tool not found at expected path: ${scriptPath}`);
|
|
33
43
|
}
|
|
34
|
-
|
|
44
|
+
// Serialize icon-tool spawns across processes: each reserves a large WebAssembly.Memory, andrunning many in parallel (e.g. across vitest workers) exhausts memory. See withIconsLock.
|
|
45
|
+
await withIconsLock(() => exec(process.execPath, [scriptPath, `--input`, safeInput, `--format`, outputFormat, `--out`, safeOutDir], { shell: false }));
|
|
35
46
|
}
|
|
36
47
|
//# sourceMappingURL=icons.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.js","sourceRoot":"","sources":["../../src/toolsets/icons.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AACvF,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"icons.js","sourceRoot":"","sources":["../../src/toolsets/icons.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AACvF,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAEpD,wFAAwF;AACxF,MAAM,YAAY,GAAG,OAAO,CAAA;AAE5B,MAAM,mBAAmB,GAAG;IAC1B,OAAO,EAAE;QACP,qBAAqB,EAAE,kEAAkE;KAC1F;IACD,OAAO,EAAE;QACP,qBAAqB,EAAE,kE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,EAAE,CAAC;QAChC,MAAM,IAAI,yBAAyB,CAAC,0CAA0C,UAAU,EAAE,CAAC,CAAA;IAC7F,CAAC;IACD,sLAAsL;IACtL,MAAM,aAAa,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU,CAAC,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAA;AACxJ,CAAC","sourcesContent":["import { exec, exists, InvalidConfigurationError, sanitizeDirPath } from \"builder-util\"\nimport * as path from \"path\"\nimport { ToolsetConfig } from \"../configuration.js\"\nimport { downloadBuilderToolset } from \"../util/electronGet.js\"\nimport { withIconsLock } from \"../util/toolsetLock.js\"\nimport { getCustomToolsetPath } from \"./custom.js\"\nimport { resolveToolsetVersion } from \"./version.js\"\n\n// Newest icons-conversion bundle — selected when the config is unset / null / \"latest\".\nconst ICONS_LATEST = \"1.2.1\"\n\nconst iconsToolsChecksums = {\n \"1.1.0\": {\n \"icons-bundle.tar.gz\": \"2241c9501aa5ddd19317956449f50a1bc311df2c34058aae9bf8bfe62081eaec\",\n },\n \"1.2.0\": {\n \"icons-bundle.tar.gz\": \"788add2400487fe00d5ceac4a8347bd71fc43c8c988fde879f929992ea0c03ea\",\n },\n \"1.2.1\": {\n \"icons-bundle.tar.gz\": \"193241afc7c81ab165fa0af15ef0af88f796eb69e8e5bb4249a49310d8be242a\",\n },\n} as const\n\nexport async function getIconsToolsetPath(icons: ToolsetConfig[\"icons\"], resourcesDir: string): Promise<string> {\n if (typeof icons === \"object\" && icons != null) {\n return getCustomToolsetPath(icons, resourcesDir)\n }\n const version = resolveToolsetVersion(icons, ICONS_LATEST)\n return downloadBuilderToolset({\n releaseName: `icons@${version}`,\n filenameWithExt: \"icons-bundle.tar.gz\",\n checksums: iconsToolsChecksums[version],\n githubOrgRepo: \"electron-userland/electron-builder-binaries\",\n })\n}\n\ntype IconConversionOptions = {\n inputFile: string\n outputFormat: \"icns\" | \"ico\" | \"set\"\n outDir: string\n iconsToolset: ToolsetConfig[\"icons\"]\n resourcesDir: string\n}\n\nconst VALID_OUTPUT_FORMATS = [\"icns\", \"ico\", \"set\"] as const\n\nexport async function runIconsTool({ inputFile, outputFormat, outDir, iconsToolset, resourcesDir }: IconConversionOptions): Promise<void> {\n if (!(VALID_OUTPUT_FORMATS as readonly string[]).includes(outputFormat)) {\n throw new InvalidConfigurationError(`Invalid icon output format: ${outputFormat}`)\n }\n const safeInput = sanitizeDirPath(inputFile)\n const safeOutDir = sanitizeDirPath(outDir)\n\n const toolsetPath = await getIconsToolsetPath(iconsToolset, resourcesDir)\n const scriptPath = sanitizeDirPath(path.resolve(toolsetPath, \"icon-tool.js\"), toolsetPath)\n if (!(await exists(scriptPath))) {\n throw new InvalidConfigurationError(`Icons tool not found at expected path: ${scriptPath}`)\n }\n // Serialize icon-tool spawns across processes: each reserves a large WebAssembly.Memory, andrunning many in parallel (e.g. across vitest workers) exhausts memory. See withIconsLock.\n await withIconsLock(() => exec(process.execPath, [scriptPath, `--input`, safeInput, `--format`, outputFormat, `--out`, safeOutDir], { shell: false }))\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linuxToolsMac.d.ts","sourceRoot":"","sources":["../../src/toolsets/linuxToolsMac.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"linuxToolsMac.d.ts","sourceRoot":"","sources":["../../src/toolsets/linuxToolsMac.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAcnD,wBAAsB,iBAAiB,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC,eAAe,CAAC,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAYxH;AAED,wBAAsB,uBAAuB,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC,eAAe,CAAC,EAAE,YAAY,CAAC,EAAE,MAAM;;;;GAQ5G"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import * as path from "path";
|
|
2
2
|
import { downloadBuilderToolset } from "../util/electronGet.js";
|
|
3
3
|
import { getCustomToolsetPath } from "./custom.js";
|
|
4
|
+
import { resolveToolsetVersion } from "./version.js";
|
|
5
|
+
// Newest linux-tools-mac bundle — selected when the config is unset / null / "latest".
|
|
6
|
+
const LINUX_TOOLS_MAC_LATEST = "1.0.0";
|
|
4
7
|
// no legacy toolset as macos arm64 BSD gtar/ar/lzip are not compatible with linux targets, so we always use newer toolset on macos for linux archives
|
|
5
8
|
const linuxToolsMacChecksums = {
|
|
6
9
|
"linux-tools-mac-darwin-arm64.tar.gz": "204e76f08364352edb28a6a4be87e8f9bd9340213865d9a0d1c664aa46fcf053",
|
|
@@ -13,7 +16,7 @@ export async function getLinuxToolsPath(toolset, resourcesDir) {
|
|
|
13
16
|
const arch = process.arch === "arm64" ? "arm64" : "x86_64";
|
|
14
17
|
const filename = `linux-tools-mac-darwin-${arch}.tar.gz`;
|
|
15
18
|
return downloadBuilderToolset({
|
|
16
|
-
releaseName: `linux-tools-mac@${toolset
|
|
19
|
+
releaseName: `linux-tools-mac@${resolveToolsetVersion(toolset, LINUX_TOOLS_MAC_LATEST)}`,
|
|
17
20
|
filenameWithExt: filename,
|
|
18
21
|
checksums: linuxToolsMacChecksums,
|
|
19
22
|
githubOrgRepo: "electron-userland/electron-builder-binaries",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linuxToolsMac.js","sourceRoot":"","sources":["../../src/toolsets/linuxToolsMac.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,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GAAW,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,KAAK,EAAE,GAAG,CAAC,CAAA;IAClE,OAAO;QACL,EAAE,EAAE,GAAG,CAAC,IAAI,CAAC;QACb,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC;QACjB,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC;KAClB,CAAA;AACH,CAAC","sourcesContent":["import * as path from \"path\"\nimport { ToolsetConfig } from \"../configuration.js\"\nimport { downloadBuilderToolset } from \"../util/electronGet.js\"\nimport { getCustomToolsetPath } from \"./custom.js\"\nimport { resolveToolsetVersion } from \"./version.js\"\n\n// Newest linux-tools-mac bundle — selected when the config is unset / null / \"latest\".\nconst LINUX_TOOLS_MAC_LATEST = \"1.0.0\"\n\n// no legacy toolset as macos arm64 BSD gtar/ar/lzip are not compatible with linux targets, so we always use newer toolset on macos for linux archives\nconst linuxToolsMacChecksums = {\n \"linux-tools-mac-darwin-arm64.tar.gz\": \"204e76f08364352edb28a6a4be87e8f9bd9340213865d9a0d1c664aa46fcf053\",\n \"linux-tools-mac-darwin-x86_64.tar.gz\": \"7ee26dfbd0d2a4c2c83b55a9416a30cc84876eef01c6497ca49bb016a190c726\",\n} as const\n\nexport async function getLinuxToolsPath(toolset?: ToolsetConfig[\"linuxToolsMac\"], resourcesDir?: string): Promise<string> {\n if (typeof toolset === \"object\" && toolset != null) {\n return getCustomToolsetPath(toolset, resourcesDir ?? \"\")\n }\n const arch = process.arch === \"arm64\" ? \"arm64\" : \"x86_64\"\n const filename: keyof typeof linuxToolsMacChecksums = `linux-tools-mac-darwin-${arch}.tar.gz`\n return downloadBuilderToolset({\n releaseName: `linux-tools-mac@${resolveToolsetVersion(toolset, LINUX_TOOLS_MAC_LATEST)}`,\n filenameWithExt: filename,\n checksums: linuxToolsMacChecksums,\n githubOrgRepo: \"electron-userland/electron-builder-binaries\",\n })\n}\n\nexport async function getLinuxToolsMacToolset(toolset?: ToolsetConfig[\"linuxToolsMac\"], resourcesDir?: string) {\n const linuxToolsPath = await getLinuxToolsPath(toolset, resourcesDir)\n const bin = (pkg: string) => path.join(linuxToolsPath, \"bin\", pkg)\n return {\n ar: bin(\"ar\"),\n lzip: bin(\"lzip\"),\n gtar: bin(\"gtar\"),\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nsis.d.ts","sourceRoot":"","sources":["../../src/toolsets/nsis.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAE9C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"nsis.d.ts","sourceRoot":"","sources":["../../src/toolsets/nsis.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAE9C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AA2BjD,eAAO,MAAM,aAAa;;;;;CAQhB,CAAA;AAkBV,wBAAsB,eAAe,CAAC,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CA4BpH;AAED,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAcrH;AAED,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CASrH"}
|
package/dist/toolsets/nsis.js
CHANGED
|
@@ -2,8 +2,11 @@ import { exists } from "builder-util";
|
|
|
2
2
|
import * as path from "path";
|
|
3
3
|
import { downloadBuilderToolset } from "../util/electronGet.js";
|
|
4
4
|
import { getCustomToolsetPath } from "./custom.js";
|
|
5
|
+
import { resolveToolsetVersion } from "./version.js";
|
|
5
6
|
import _fsExtra from "fs-extra";
|
|
6
7
|
const { stat } = _fsExtra;
|
|
8
|
+
// Newest NSIS bundle — selected when the config is unset / null / "latest".
|
|
9
|
+
const NSIS_LATEST = "1.2.1";
|
|
7
10
|
function getLegacyNsisBin() {
|
|
8
11
|
// Warning: Don't use v3.0.4.2 - https://github.com/electron-userland/electron-builder/issues/6334
|
|
9
12
|
return downloadBuilderToolset({
|
|
@@ -32,7 +35,7 @@ async function getNsisBundlePath(nsis, resourcesDir) {
|
|
|
32
35
|
if (typeof nsis === "object" && nsis != null) {
|
|
33
36
|
return getCustomToolsetPath(nsis, resourcesDir);
|
|
34
37
|
}
|
|
35
|
-
const resolved = nsis
|
|
38
|
+
const resolved = resolveToolsetVersion(nsis, NSIS_LATEST);
|
|
36
39
|
if (resolved === "0.0.0") {
|
|
37
40
|
return getLegacyNsisBin();
|
|
38
41
|
}
|
|
@@ -60,7 +63,7 @@ export async function getMakeNsisPath(nsis, resourcesDir) {
|
|
|
60
63
|
return { path: path.resolve(bundlePath, process.platform === "win32" ? "makensis.cmd" : "makensis") };
|
|
61
64
|
};
|
|
62
65
|
const bundlePath = await getNsisBundlePath(nsis, resourcesDir);
|
|
63
|
-
if (
|
|
66
|
+
if (nsis === "0.0.0") {
|
|
64
67
|
return legacyBundle(bundlePath);
|
|
65
68
|
}
|
|
66
69
|
if (typeof nsis === "object") {
|
|
@@ -82,7 +85,7 @@ export async function getNsisPluginsPath(nsis, resourcesDir) {
|
|
|
82
85
|
}
|
|
83
86
|
throw new Error(`Plugins directory not found in NSIS bundle at: ${bundlePath}. Expected one of: ${potentialPaths.join(", ")}`);
|
|
84
87
|
};
|
|
85
|
-
if (
|
|
88
|
+
if (nsis === "0.0.0") {
|
|
86
89
|
return path.resolve(await getLegacyNsisResourcesBin(), "plugins");
|
|
87
90
|
}
|
|
88
91
|
return resolvePluginsDir(await getNsisBundlePath(nsis, resourcesDir));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nsis.js","sourceRoot":"","sources":["../../src/toolsets/nsis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAErC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAG5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,QAAQ,MAAM,UAAU,CAAA;AAC/B,MAAM,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAA;AAEzB,SAAS,gBAAgB;IACvB,kGAAkG;IAClG,OAAO,sBAAsB,CAAC;QAC5B,WAAW,EAAE,cAAc;QAC3B,eAAe,EAAE,iBAAiB;QAClC,SAAS,EAAE,EAAE,iBAAiB,EAAE,kEAAkE,EAAE;KACrG,CAAC,CAAA;AACJ,CAAC;AAED,SAAS,yBAAyB;IAChC,OAAO,sBAAsB,CAAC;QAC5B,WAAW,EAAE,sBAAsB;QACnC,eAAe,EAAE,yBAAyB;QAC1C,SAAS,EAAE,EAAE,yBAAyB,EAAE,kEAAkE,EAAE;KAC7G,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,OAAO,EAAE;IACP,iEAAiE;KAClE;IACD,OAAO,EAAE;QACP,iBAAiB;QACjB,yBAAyB,EAAE,kEAAkE;KAC9F;CACO,CAAA;AAEV,KAAK,UAAU,iBAAiB,CAAC,
|
|
1
|
+
{"version":3,"file":"nsis.js","sourceRoot":"","sources":["../../src/toolsets/nsis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAErC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAG5B,OAAO,EAAE,sBAAsB,EAA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MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,IAAqC,EAAE,YAAoB;IAClG,MAAM,cAAc,GAAG,KAAK,EAAE,GAAW,EAAE,EAAE;QAC3C,MAAM,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,aAAa,CAAC,CAAA;QAC1C,IAAI,CAAC,MAAM,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;YAClD,OAAO,CAAC,CAAA;QACV,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,4CAA4C,GAAG,oBAAoB,CAAC,EAAE,CAAC,CAAA;IACzF,CAAC,CAAA;IACD,OAAO,cAAc,CAAC,MAAM,iBAAiB,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAA;AACpE,CAAC","sourcesContent":["import { exists } from \"builder-util\"\nimport { Nullish } from \"builder-util-runtime\"\nimport * as path from \"path\"\nimport { ToolsetConfig } from \"../configuration.js\"\nimport { ToolInfo } from \"../util/bundledTool.js\"\nimport { downloadBuilderToolset } from \"../util/electronGet.js\"\nimport { getCustomToolsetPath } from \"./custom.js\"\nimport { resolveToolsetVersion } from \"./version.js\"\nimport _fsExtra from \"fs-extra\"\nconst { stat } = _fsExtra\n\n// Newest NSIS bundle — selected when the config is unset / null / \"latest\".\nconst NSIS_LATEST = \"1.2.1\"\n\nfunction getLegacyNsisBin(): Promise<string> {\n // Warning: Don't use v3.0.4.2 - https://github.com/electron-userland/electron-builder/issues/6334\n return downloadBuilderToolset({\n releaseName: \"nsis-3.0.4.1\",\n filenameWithExt: \"nsis-3.0.4.1.7z\",\n checksums: { \"nsis-3.0.4.1.7z\": \"9877df902530f96357d13a7a31ae2b9df67f48b11ffc9a1700a7c961574ec5fa\" },\n })\n}\n\nfunction getLegacyNsisResourcesBin(): Promise<string> {\n return downloadBuilderToolset({\n releaseName: \"nsis-resources-3.4.1\",\n filenameWithExt: \"nsis-resources-3.4.1.7z\",\n checksums: { \"nsis-resources-3.4.1.7z\": \"593a9a92ef958321293ac6a2ee61e64bf1bd543142a5bd6b3d310709cc924103\" },\n })\n}\n\nexport const nsisChecksums = {\n \"0.0.0\": {\n // legacy — uses getLegacyNsisBin() / getLegacyNsisResourcesBin()\n },\n \"1.2.1\": {\n // unified bundle\n \"nsis-bundle-3.12.tar.gz\": \"56997fdefe25e7928a1a68b4583d08b240b66cf660234053b20131a74cc082f4\",\n },\n} as const\n\nasync function getNsisBundlePath(nsis: ToolsetConfig[\"nsis\"] | Nullish, resourcesDir: string): Promise<string> {\n if (typeof nsis === \"object\" && nsis != null) {\n return getCustomToolsetPath(nsis, resourcesDir)\n }\n const resolved = resolveToolsetVersion(nsis, NSIS_LATEST)\n if (resolved === \"0.0.0\") {\n return getLegacyNsisBin()\n }\n const file = \"nsis-bundle-3.12.tar.gz\"\n return downloadBuilderToolset({\n releaseName: `nsis@${resolved}`,\n filenameWithExt: file,\n checksums: { [file]: nsisChecksums[resolved][file] },\n })\n}\n\nexport async function getMakeNsisPath(nsis: ToolsetConfig[\"nsis\"] | Nullish, resourcesDir: string): Promise<ToolInfo> {\n const legacyBundle = (bundlePath: string) => {\n // legacy bundle: platform-specific subdirectories, NSISDIR must be set explicitly\n const env = { NSISDIR: bundlePath }\n if (process.platform === \"darwin\") {\n return { path: path.resolve(bundlePath, \"mac\", \"makensis\"), env }\n } else if (process.platform === \"win32\") {\n return { path: path.resolve(bundlePath, \"Bin\", \"makensis.exe\"), env }\n }\n return { path: path.resolve(bundlePath, \"linux\", \"makensis\"), env }\n }\n const entrypointBundle = (bundlePath: string) => {\n // the entrypoint script auto-sets NSISDIR\n return { path: path.resolve(bundlePath, process.platform === \"win32\" ? \"makensis.cmd\" : \"makensis\") }\n }\n\n const bundlePath = await getNsisBundlePath(nsis, resourcesDir)\n if (nsis === \"0.0.0\") {\n return legacyBundle(bundlePath)\n }\n if (typeof nsis === \"object\") {\n const entrypoint = entrypointBundle(bundlePath)\n if (await exists(entrypoint.path)) {\n return entrypoint\n }\n return legacyBundle(bundlePath)\n }\n return entrypointBundle(bundlePath)\n}\n\nexport async function getNsisPluginsPath(nsis: ToolsetConfig[\"nsis\"] | Nullish, resourcesDir: string): Promise<string> {\n const resolvePluginsDir = async (bundlePath: string) => {\n const potentialPaths = [path.resolve(bundlePath, \"plugins\"), path.resolve(bundlePath, \"windows\", \"Plugins\")]\n for (const p of potentialPaths) {\n if ((await exists(p)) && (await stat(p)).isDirectory()) {\n return p\n }\n }\n throw new Error(`Plugins directory not found in NSIS bundle at: ${bundlePath}. Expected one of: ${potentialPaths.join(\", \")}`)\n }\n if (nsis === \"0.0.0\") {\n return path.resolve(await getLegacyNsisResourcesBin(), \"plugins\")\n }\n return resolvePluginsDir(await getNsisBundlePath(nsis, resourcesDir))\n}\n\nexport async function getNsisElevatePath(nsis: ToolsetConfig[\"nsis\"] | Nullish, resourcesDir: string): Promise<string> {\n const resolveElevate = async (dir: string) => {\n const p = path.resolve(dir, \"elevate.exe\")\n if ((await exists(p)) && (await stat(p)).isFile()) {\n return p\n }\n throw new Error(`elevate.exe not found in NSIS bundle at: ${dir}. Expected path: ${p}`)\n }\n return resolveElevate(await getNsisBundlePath(nsis, resourcesDir))\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Nullish } from "builder-util-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Resolve the unset/null/`"latest"` sentinel to the newest concrete version for a toolset.
|
|
4
|
+
*
|
|
5
|
+
* `"latest"` is the documented "null"-state for every {@link ToolsetConfig} property: an unset
|
|
6
|
+
* property, `null`, `undefined`, and the literal `"latest"` all select the newest bundle.
|
|
7
|
+
*
|
|
8
|
+
* Callers must handle the {@link ToolsetCustom} (object) form before calling this — only the
|
|
9
|
+
* string/null/"latest" union is normalized here.
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolveToolsetVersion<T extends string>(value: T | "latest" | Nullish, latest: T): T;
|
|
12
|
+
//# sourceMappingURL=version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/toolsets/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAE9C;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,QAAQ,GAAG,OAAO,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAEnG"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve the unset/null/`"latest"` sentinel to the newest concrete version for a toolset.
|
|
3
|
+
*
|
|
4
|
+
* `"latest"` is the documented "null"-state for every {@link ToolsetConfig} property: an unset
|
|
5
|
+
* property, `null`, `undefined`, and the literal `"latest"` all select the newest bundle.
|
|
6
|
+
*
|
|
7
|
+
* Callers must handle the {@link ToolsetCustom} (object) form before calling this — only the
|
|
8
|
+
* string/null/"latest" union is normalized here.
|
|
9
|
+
*/
|
|
10
|
+
export function resolveToolsetVersion(value, latest) {
|
|
11
|
+
return value == null || value === "latest" ? latest : value;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/toolsets/version.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,UAAU,qBAAqB,CAAmB,KAA6B,EAAE,MAAS;IAC9F,OAAO,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAA;AAC7D,CAAC","sourcesContent":["import { Nullish } from \"builder-util-runtime\"\n\n/**\n * Resolve the unset/null/`\"latest\"` sentinel to the newest concrete version for a toolset.\n *\n * `\"latest\"` is the documented \"null\"-state for every {@link ToolsetConfig} property: an unset\n * property, `null`, `undefined`, and the literal `\"latest\"` all select the newest bundle.\n *\n * Callers must handle the {@link ToolsetCustom} (object) form before calling this — only the\n * string/null/\"latest\" union is normalized here.\n */\nexport function resolveToolsetVersion<T extends string>(value: T | \"latest\" | Nullish, latest: T): T {\n return value == null || value === \"latest\" ? latest : value\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Arch } from "builder-util";
|
|
2
1
|
import { Nullish } from "builder-util-runtime";
|
|
3
2
|
import { ToolsetConfig } from "../configuration.js";
|
|
4
3
|
import { ToolInfo } from "../util/bundledTool.js";
|
|
4
|
+
export declare const WIN_CODESIGN_LATEST = "1.3.0";
|
|
5
5
|
export declare const wincodesignChecksums: {
|
|
6
6
|
readonly "0.0.0": {};
|
|
7
7
|
readonly "1.0.0": {
|
|
@@ -60,9 +60,17 @@ export declare const wincodesignChecksums: {
|
|
|
60
60
|
};
|
|
61
61
|
};
|
|
62
62
|
export declare function getSignToolPath(winCodeSign: ToolsetConfig["winCodeSign"] | Nullish, isWin: boolean, resourcesDir: string): Promise<ToolInfo>;
|
|
63
|
-
|
|
63
|
+
/**
|
|
64
|
+
* Resolve the Windows Kits bundle paths.
|
|
65
|
+
*
|
|
66
|
+
* The `kit` subdirectory holds HOST executables (`signtool.exe` / `makeappx.exe` / `makepri.exe`), so
|
|
67
|
+
* it is always the x64 kit (x86 on 32-bit hosts) — never arm64. x64 binaries run on x64 hosts natively
|
|
68
|
+
* and on arm64 Windows via emulation, whereas an arm64 binary cannot run on an x64 host and fails with
|
|
69
|
+
* `spawn UNKNOWN`. The artifact's target arch is irrelevant here.
|
|
70
|
+
* `appxAssets` is arch-independent (the bundle root).
|
|
71
|
+
*/
|
|
72
|
+
export declare function getWindowsKitsBundle({ winCodeSign, resourcesDir }: {
|
|
64
73
|
winCodeSign: ToolsetConfig["winCodeSign"] | Nullish;
|
|
65
|
-
arch: Arch;
|
|
66
74
|
resourcesDir?: string;
|
|
67
75
|
}): Promise<{
|
|
68
76
|
kit: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"winCodeSign.d.ts","sourceRoot":"","sources":["../../src/toolsets/winCodeSign.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"winCodeSign.d.ts","sourceRoot":"","sources":["../../src/toolsets/winCodeSign.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAG9C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAkB,MAAM,wBAAwB,CAAA;AAMjE,eAAO,MAAM,mBAAmB,UAAU,CAAA;AAU1C,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DvB,CAAA;AAaV,wBAAsB,eAAe,CAAC,WAAW,EAAE,aAAa,CAAC,aAAa,CAAC,GAAG,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAOlJ;AAED;;;;;;;;GAQG;AACH,wBAAsB,oBAAoB,CAAC,EAAE,WAAW,EAAE,YAAY,EAAE,EAAE;IAAE,WAAW,EAAE,aAAa,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE;;;GAevJ;AAED,wBAAgB,SAAS,YAGxB;AA2DD,wBAAsB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAW1E;AAED,wBAAsB,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAW9E;AAED,wBAAsB,eAAe,CAAC,WAAW,EAAE,aAAa,CAAC,aAAa,CAAC,GAAG,OAAO,EAAE,YAAY,SAAK;;;GAgB3G"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InvalidConfigurationError, sanitizeDirPath } from "builder-util";
|
|
2
2
|
import * as os from "os";
|
|
3
3
|
import * as path from "path";
|
|
4
4
|
import { computeToolEnv } from "../util/bundledTool.js";
|
|
5
5
|
import { downloadBuilderToolset } from "../util/electronGet.js";
|
|
6
6
|
import { getCustomToolsetPath } from "./custom.js";
|
|
7
|
+
import { resolveToolsetVersion } from "./version.js";
|
|
8
|
+
// Newest win-codesign bundle — selected when the config is unset / null / "latest".
|
|
9
|
+
export const WIN_CODESIGN_LATEST = "1.3.0";
|
|
7
10
|
function getLegacyWinCodeSignBin() {
|
|
8
11
|
return downloadBuilderToolset({
|
|
9
12
|
releaseName: "winCodeSign-2.6.0",
|
|
@@ -80,35 +83,43 @@ function _getWindowsToolsBin(winCodeSign, file) {
|
|
|
80
83
|
}
|
|
81
84
|
export async function getSignToolPath(winCodeSign, isWin, resourcesDir) {
|
|
82
85
|
if (isWin) {
|
|
83
|
-
|
|
84
|
-
const signtoolArch = process.arch === "x64" ? Arch.x64 : process.arch === "arm64" ? Arch.arm64 : Arch.ia32;
|
|
85
|
-
return { path: await getWindowsSignToolExe({ winCodeSign, arch: signtoolArch, resourcesDir }) };
|
|
86
|
+
return { path: await getWindowsSignToolExe({ winCodeSign, resourcesDir }) };
|
|
86
87
|
}
|
|
87
88
|
else {
|
|
88
89
|
const vendor = await getOsslSigncodeBundle(winCodeSign, resourcesDir);
|
|
89
90
|
return { path: vendor.path, env: vendor.env };
|
|
90
91
|
}
|
|
91
92
|
}
|
|
92
|
-
|
|
93
|
+
/**
|
|
94
|
+
* Resolve the Windows Kits bundle paths.
|
|
95
|
+
*
|
|
96
|
+
* The `kit` subdirectory holds HOST executables (`signtool.exe` / `makeappx.exe` / `makepri.exe`), so
|
|
97
|
+
* it is always the x64 kit (x86 on 32-bit hosts) — never arm64. x64 binaries run on x64 hosts natively
|
|
98
|
+
* and on arm64 Windows via emulation, whereas an arm64 binary cannot run on an x64 host and fails with
|
|
99
|
+
* `spawn UNKNOWN`. The artifact's target arch is irrelevant here.
|
|
100
|
+
* `appxAssets` is arch-independent (the bundle root).
|
|
101
|
+
*/
|
|
102
|
+
export async function getWindowsKitsBundle({ winCodeSign, resourcesDir }) {
|
|
103
|
+
const kitArch = process.arch === "ia32" ? "x86" : "x64";
|
|
93
104
|
if (typeof winCodeSign === "object" && winCodeSign != null) {
|
|
94
105
|
const vendorPath = sanitizeDirPath(await getCustomToolsetPath(winCodeSign, resourcesDir), resourcesDir || undefined);
|
|
95
|
-
return { kit: path.join(vendorPath,
|
|
106
|
+
return { kit: path.join(vendorPath, kitArch), appxAssets: vendorPath };
|
|
96
107
|
}
|
|
97
|
-
const
|
|
98
|
-
if (
|
|
108
|
+
const version = resolveToolsetVersion(winCodeSign, WIN_CODESIGN_LATEST);
|
|
109
|
+
if (version === "0.0.0") {
|
|
99
110
|
const vendorPath = sanitizeDirPath(await getLegacyWinCodeSignBin());
|
|
100
|
-
return { kit: path.join(vendorPath, "windows-10",
|
|
111
|
+
return { kit: path.join(vendorPath, "windows-10", kitArch), appxAssets: vendorPath };
|
|
101
112
|
}
|
|
102
113
|
const file = "windows-kits-bundle-10_0_26100_0.zip";
|
|
103
|
-
const vendorPath = sanitizeDirPath(await _getWindowsToolsBin(
|
|
104
|
-
return { kit: path.join(vendorPath,
|
|
114
|
+
const vendorPath = sanitizeDirPath(await _getWindowsToolsBin(version, file));
|
|
115
|
+
return { kit: path.join(vendorPath, kitArch), appxAssets: vendorPath };
|
|
105
116
|
}
|
|
106
117
|
export function isOldWin6() {
|
|
107
118
|
const winVersion = os.release();
|
|
108
119
|
return winVersion.startsWith("6.") && !winVersion.startsWith("6.3");
|
|
109
120
|
}
|
|
110
|
-
async function getWindowsSignToolExe({ winCodeSign,
|
|
111
|
-
if (winCodeSign === "0.0.0"
|
|
121
|
+
async function getWindowsSignToolExe({ winCodeSign, resourcesDir = "" }) {
|
|
122
|
+
if (typeof winCodeSign !== "object" && resolveToolsetVersion(winCodeSign, WIN_CODESIGN_LATEST) === "0.0.0") {
|
|
112
123
|
// use modern signtool on Windows Server 2012 R2 to be able to sign AppX
|
|
113
124
|
const vendorPath = sanitizeDirPath(await getLegacyWinCodeSignBin());
|
|
114
125
|
if (isOldWin6()) {
|
|
@@ -119,18 +130,22 @@ async function getWindowsSignToolExe({ winCodeSign, arch, resourcesDir = "" }) {
|
|
|
119
130
|
}
|
|
120
131
|
}
|
|
121
132
|
// kit is already sanitized by getWindowsKitsBundle
|
|
122
|
-
const { kit } = await getWindowsKitsBundle({ winCodeSign,
|
|
133
|
+
const { kit } = await getWindowsKitsBundle({ winCodeSign, resourcesDir });
|
|
123
134
|
return path.join(kit, "signtool.exe");
|
|
124
135
|
}
|
|
125
136
|
async function getOsslSigncodeBundle(winCodeSign, resourcesDir = "") {
|
|
126
|
-
|
|
127
|
-
return { path: "osslsigncode" };
|
|
128
|
-
}
|
|
137
|
+
// A custom toolset is an explicit user override — honored on every platform, before any platform default/fallback.
|
|
129
138
|
if (typeof winCodeSign === "object" && winCodeSign != null) {
|
|
130
139
|
const vendorPath = sanitizeDirPath(await getCustomToolsetPath(winCodeSign, resourcesDir), resourcesDir || undefined);
|
|
131
140
|
return { path: path.join(vendorPath, "osslsigncode") };
|
|
132
141
|
}
|
|
133
|
-
if (
|
|
142
|
+
if (process.platform === "win32") {
|
|
143
|
+
// Unreachable in normal flow: osslsigncode is only requested when the host is not Windows (Windows signs via
|
|
144
|
+
// signtool). Kept as defense-in-depth — fail loudly instead of resolving a bare `osslsigncode` from $PATH.
|
|
145
|
+
throw new InvalidConfigurationError(`osslsigncode is not used on Windows (signing uses signtool). To override, configure a custom toolset: toolsets: { winCodeSign: { url: "file:///absolute/path/to/dir" } }`);
|
|
146
|
+
}
|
|
147
|
+
const version = resolveToolsetVersion(winCodeSign, WIN_CODESIGN_LATEST);
|
|
148
|
+
if (version === "0.0.0") {
|
|
134
149
|
const legacyBase = sanitizeDirPath(await getLegacyWinCodeSignBin());
|
|
135
150
|
const vendorBase = path.join(legacyBase, process.platform);
|
|
136
151
|
const vendorPath = process.platform === "darwin" ? path.join(vendorBase, "10.12") : vendorBase;
|
|
@@ -152,27 +167,29 @@ async function getOsslSigncodeBundle(winCodeSign, resourcesDir = "") {
|
|
|
152
167
|
}
|
|
153
168
|
return "win-codesign-darwin-x86_64.zip";
|
|
154
169
|
})();
|
|
155
|
-
const vendorPath = sanitizeDirPath(await _getWindowsToolsBin(
|
|
170
|
+
const vendorPath = sanitizeDirPath(await _getWindowsToolsBin(version, file));
|
|
156
171
|
return { path: path.join(vendorPath, "osslsigncode") };
|
|
157
172
|
}
|
|
158
173
|
export async function getAtsBundleDir(winCodeSign) {
|
|
159
|
-
const
|
|
174
|
+
const version = winCodeSign === "latest" ? WIN_CODESIGN_LATEST : winCodeSign;
|
|
175
|
+
const checksum = wincodesignChecksums[version]?.["ats-bundle-1_0_95.zip"];
|
|
160
176
|
if (!checksum) {
|
|
161
|
-
throw new Error(`winCodeSign version "${
|
|
177
|
+
throw new Error(`winCodeSign version "${version}" does not include an ATS bundle (requires >= 1.3.0)`);
|
|
162
178
|
}
|
|
163
179
|
return downloadBuilderToolset({
|
|
164
|
-
releaseName: `win-codesign@${
|
|
180
|
+
releaseName: `win-codesign@${version}`,
|
|
165
181
|
filenameWithExt: "ats-bundle-1_0_95.zip",
|
|
166
182
|
checksums: { "ats-bundle-1_0_95.zip": checksum },
|
|
167
183
|
});
|
|
168
184
|
}
|
|
169
185
|
export async function getDotnetRuntimeDir(winCodeSign) {
|
|
170
|
-
const
|
|
186
|
+
const version = winCodeSign === "latest" ? WIN_CODESIGN_LATEST : winCodeSign;
|
|
187
|
+
const checksum = wincodesignChecksums[version]?.["dotnet-runtime-win-x64-8_0_28.zip"];
|
|
171
188
|
if (!checksum) {
|
|
172
|
-
throw new Error(`winCodeSign version "${
|
|
189
|
+
throw new Error(`winCodeSign version "${version}" does not include a .NET runtime bundle (requires >= 1.3.0)`);
|
|
173
190
|
}
|
|
174
191
|
return downloadBuilderToolset({
|
|
175
|
-
releaseName: `win-codesign@${
|
|
192
|
+
releaseName: `win-codesign@${version}`,
|
|
176
193
|
filenameWithExt: "dotnet-runtime-win-x64-8_0_28.zip",
|
|
177
194
|
checksums: { "dotnet-runtime-win-x64-8_0_28.zip": checksum },
|
|
178
195
|
});
|
|
@@ -185,12 +202,13 @@ export async function getRceditBundle(winCodeSign, resourcesDir = "") {
|
|
|
185
202
|
const vendorPath = sanitizeDirPath(await getCustomToolsetPath(winCodeSign, resourcesDir), resourcesDir || undefined);
|
|
186
203
|
return { x86: path.join(vendorPath, x86), x64: path.join(vendorPath, x64) };
|
|
187
204
|
}
|
|
188
|
-
|
|
205
|
+
const version = resolveToolsetVersion(winCodeSign, WIN_CODESIGN_LATEST);
|
|
206
|
+
if (version === "0.0.0") {
|
|
189
207
|
const vendorPath = sanitizeDirPath(await getLegacyWinCodeSignBin());
|
|
190
208
|
return { x86: path.join(vendorPath, ia32), x64: path.join(vendorPath, x64) };
|
|
191
209
|
}
|
|
192
210
|
const file = "rcedit-windows-2_0_0.zip";
|
|
193
|
-
const vendorPath = sanitizeDirPath(await _getWindowsToolsBin(
|
|
211
|
+
const vendorPath = sanitizeDirPath(await _getWindowsToolsBin(version, file));
|
|
194
212
|
return { x86: path.join(vendorPath, x86), x64: path.join(vendorPath, x64) };
|
|
195
213
|
}
|
|
196
214
|
//# sourceMappingURL=winCodeSign.js.map
|