app-builder-lib 27.0.0-alpha.4 → 27.0.0-alpha.6
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/appInfo.d.ts +1 -1
- package/dist/appInfo.d.ts.map +1 -1
- package/dist/appInfo.js +3 -3
- package/dist/appInfo.js.map +1 -1
- 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 +6 -4
- 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 +84 -44
- package/dist/configuration.d.ts.map +1 -1
- package/dist/configuration.js +11 -1
- package/dist/configuration.js.map +1 -1
- package/dist/electron/ElectronFramework.d.ts +2 -1
- package/dist/electron/ElectronFramework.d.ts.map +1 -1
- package/dist/electron/ElectronFramework.js +32 -28
- package/dist/electron/ElectronFramework.js.map +1 -1
- package/dist/electron/electronArchSupport.d.ts +12 -0
- package/dist/electron/electronArchSupport.d.ts.map +1 -0
- package/dist/electron/electronArchSupport.js +58 -0
- package/dist/electron/electronArchSupport.js.map +1 -0
- 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/electron/mac/electronMac.js +12 -21
- package/dist/electron/mac/electronMac.js.map +1 -1
- package/dist/electron/mac/electronMacUtils.d.ts +24 -0
- package/dist/electron/mac/electronMacUtils.d.ts.map +1 -0
- package/dist/electron/mac/electronMacUtils.js +42 -0
- package/dist/electron/mac/electronMacUtils.js.map +1 -0
- 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/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/indexInternal.d.ts +8 -5
- package/dist/indexInternal.d.ts.map +1 -1
- package/dist/indexInternal.js +8 -4
- package/dist/indexInternal.js.map +1 -1
- package/dist/macPackager.d.ts.map +1 -1
- package/dist/macPackager.js +15 -3
- 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 +17 -1
- package/dist/node-module-collector/nodeModulesCollector.d.ts.map +1 -1
- package/dist/node-module-collector/nodeModulesCollector.js +67 -1
- 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/MsixOptions.d.ts +126 -0
- package/dist/options/MsixOptions.d.ts.map +1 -0
- package/dist/options/MsixOptions.js +2 -0
- package/dist/options/MsixOptions.js.map +1 -0
- 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/macOptions.d.ts +4 -4
- package/dist/options/macOptions.d.ts.map +1 -1
- package/dist/options/macOptions.js.map +1 -1
- package/dist/options/winOptions.d.ts +166 -36
- 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 +26 -21
- package/dist/packager.js.map +1 -1
- package/dist/platformPackager.d.ts +2 -0
- package/dist/platformPackager.d.ts.map +1 -1
- package/dist/platformPackager.js +6 -0
- 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 +20 -6
- package/dist/publish/PublishManager.js.map +1 -1
- package/dist/publish/updateInfoBuilder.d.ts.map +1 -1
- package/dist/publish/updateInfoBuilder.js +20 -22
- package/dist/publish/updateInfoBuilder.js.map +1 -1
- package/dist/targets/archive.d.ts +11 -0
- package/dist/targets/archive.d.ts.map +1 -1
- package/dist/targets/archive.js +40 -22
- package/dist/targets/archive.js.map +1 -1
- package/dist/targets/linux/FpmTarget.d.ts.map +1 -1
- package/dist/targets/linux/FpmTarget.js +3 -3
- package/dist/targets/linux/FpmTarget.js.map +1 -1
- package/dist/targets/linux/appimage/AppImageTarget.d.ts.map +1 -1
- package/dist/targets/linux/appimage/AppImageTarget.js +5 -6
- package/dist/targets/linux/appimage/AppImageTarget.js.map +1 -1
- 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 +2 -1
- package/dist/targets/linux/snap/coreLegacy.js.map +1 -1
- package/dist/targets/linux/snap/snapcraft.d.ts +190 -0
- package/dist/targets/linux/snap/snapcraft.d.ts.map +1 -0
- package/dist/targets/linux/snap/snapcraft.js +11 -0
- package/dist/targets/linux/snap/snapcraft.js.map +1 -0
- 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/mac/MacTargetHelper.d.ts +6 -0
- package/dist/targets/mac/MacTargetHelper.d.ts.map +1 -1
- package/dist/targets/mac/MacTargetHelper.js +22 -1
- package/dist/targets/mac/MacTargetHelper.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 +0 -2
- package/dist/targets/win/AppxTarget.d.ts.map +1 -1
- package/dist/targets/win/AppxTarget.js +37 -317
- package/dist/targets/win/AppxTarget.js.map +1 -1
- package/dist/targets/win/MsixTarget.d.ts +22 -0
- package/dist/targets/win/MsixTarget.d.ts.map +1 -0
- package/dist/targets/win/MsixTarget.js +214 -0
- package/dist/targets/win/MsixTarget.js.map +1 -0
- 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 +28 -46
- 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 +2 -1
- 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/targets/win/winAppUtil.d.ts +115 -0
- package/dist/targets/win/winAppUtil.d.ts.map +1 -0
- package/dist/targets/win/winAppUtil.js +407 -0
- package/dist/targets/win/winAppUtil.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 +4 -1
- 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 +20 -3
- package/dist/toolsets/winCodeSign.d.ts.map +1 -1
- package/dist/toolsets/winCodeSign.js +56 -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 +88 -22
- package/dist/util/appFileCopier.js.map +1 -1
- 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 +40 -20
- package/dist/util/electronGet.js.map +1 -1
- package/dist/util/flags.d.ts +0 -2
- package/dist/util/flags.d.ts.map +1 -1
- package/dist/util/flags.js +0 -6
- 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/packageMetadata.js +0 -10
- package/dist/util/packageMetadata.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/dist/vm/ParallelsVm.d.ts.map +1 -1
- package/dist/vm/ParallelsVm.js +18 -5
- package/dist/vm/ParallelsVm.js.map +1 -1
- package/dist/winPackager.d.ts.map +1 -1
- package/dist/winPackager.js +3 -0
- package/dist/winPackager.js.map +1 -1
- package/package.json +8 -8
- package/scheme.json +556 -133
- package/templates/appx/appxmanifest.xml +1 -1
- package/templates/msix/appxmanifest.xml +45 -0
- package/templates/nsis/installSection.nsh +14 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"winAppUtil.js","sourceRoot":"","sources":["../../../src/targets/win/winAppUtil.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,YAAY,EAAE,yBAAyB,EAAE,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAGhJ,OAAO,QAAQ,MAAM,UAAU,CAAA;AAC/B,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,QAAQ,CAAA;AAC3D,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAI5B,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAA;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAG3D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAE3E,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAA;AAE1C;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,YAAY,CAAA;AAEzC;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAwB,IAAI,GAAG,CAAC;IACnE,WAAW;IACX,sBAAsB;IACtB,YAAY;IACZ,aAAa;IACb,aAAa;IACb,iBAAiB;IACjB,YAAY;IACZ,kBAAkB;CACnB,CAAC,CAAA;AAEF;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,QAAgB,EAAE,OAAkC;IAC3F,OAA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gBAAgB,EAAE,QAAQ,CAAC,uBAAuB,CAAC,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC;YAC7E,MAAM;YACN,iBAAiB,EAAE,OAAO,CAAC,oBAAoB;SAChD,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { Arch, asArray, copyOrLinkFile, ensureNotBusy, escapeForXml, InvalidConfigurationError, log, sanitizeDirPath, walk } from \"builder-util\"\nimport type { MsixWindowsService } from \"../../options/MsixOptions.js\"\nimport { Nullish } from \"builder-util-runtime\"\nimport _fsExtra from \"fs-extra\"\nconst { emptyDir, readdir, readFile, writeFile } = _fsExtra\nimport * as path from \"path\"\nimport type { Target, TargetSpecificOptions } from \"../../core.js\"\nimport { FileAssociation } from \"../../options/FileAssociation.js\"\nimport { Protocol } from \"../../options/PlatformSpecificBuildOptions.js\"\nimport { getWindowsKitsBundle } from \"../../toolsets/winCodeSign.js\"\nimport { getTemplatePath } from \"../../util/pathManager.js\"\nimport { VmManager } from \"../../vm/vm.js\"\nimport type { WinPackager } from \"../../winPackager.js\"\nimport { createStageDir } from \"../targetUtil.js\"\nimport { CAPABILITIES, isValidCapabilityName } from \"./AppxCapabilities.js\"\n\nexport const APPX_ASSETS_DIR_NAME = \"appx\"\n\n/**\n * Escapes a string for safe use as an XML attribute value (double- or single-quoted) or element text.\n * Aliased to builder-util's {@link escapeForXml} so the Appx/MSIX manifest path shares the single\n * consolidated escaper (PR #9853) and cannot drift from it.\n */\nexport const escapeXmlAttr = escapeForXml\n\n/**\n * Manifest macros whose substituted values are raw user/config text and therefore must be\n * XML-escaped before being placed into the (Appx/MSIX) manifest. Every other macro either\n * returns a prebuilt XML fragment (capabilities, extensions, lockScreen, defaultTile,\n * splashScreen, resourceLanguages, packageIntegrity) or a validated/constant value\n * (version, applicationId, identityName, arch, logo, square*Logo) and must NOT be escaped.\n *\n * Note: `publisher` is emitted inside a single-quoted attribute (`Publisher='...'`). escapeForXml\n * escapes `& < > \" '` — apostrophes become `'`, which is valid inside the single-quoted\n * attribute, so a `'` in a certificate Subject is handled correctly.\n */\nexport const RAW_TEXT_MANIFEST_MACROS: ReadonlySet<string> = new Set([\n \"publisher\",\n \"publisherDisplayName\",\n \"executable\",\n \"displayName\",\n \"description\",\n \"backgroundColor\",\n \"minVersion\",\n \"maxVersionTested\",\n])\n\n/**\n * Substitutes `${macro}` placeholders in an Appx/MSIX manifest template. `resolve` returns the\n * RAW value for a macro; values for macros in {@link RAW_TEXT_MANIFEST_MACROS} are XML-escaped\n * here so individual call sites cannot forget to. `resolve` may throw for unknown macros.\n */\nexport function substituteManifestMacros(template: string, resolve: (macro: string) => string): string {\n return template.replace(/\\${([a-zA-Z0-9]+)}/g, (_match, macro: string): string => {\n const value = resolve(macro)\n return RAW_TEXT_MANIFEST_MACROS.has(macro) ? escapeXmlAttr(value) : value\n })\n}\n\nexport const DEFAULT_RESOURCE_LANG = \"en-US\"\n\nexport const vendorAssetsForDefaultAssets: Record<string, string> = {\n \"StoreLogo.png\": \"SampleAppx.50x50.png\",\n \"Square150x150Logo.png\": \"SampleAppx.150x150.png\",\n \"Square44x44Logo.png\": \"SampleAppx.44x44.png\",\n \"Wide310x150Logo.png\": \"SampleAppx.310x150.png\",\n}\n\nexport const restrictedApplicationIdValues = [\n \"CON\",\n \"PRN\",\n \"AUX\",\n \"NUL\",\n \"COM1\",\n \"COM2\",\n \"COM3\",\n \"COM4\",\n \"COM5\",\n \"COM6\",\n \"COM7\",\n \"COM8\",\n \"COM9\",\n \"LPT1\",\n \"LPT2\",\n \"LPT3\",\n \"LPT4\",\n \"LPT5\",\n \"LPT6\",\n \"LPT7\",\n \"LPT8\",\n \"LPT9\",\n]\n\nexport async function computeUserAssets(vm: VmManager, vendorPath: string, userAssetDir: string | null) {\n const mappings: Array<string> = []\n let userAssets: Array<string>\n const allAssets: Array<string> = []\n if (userAssetDir == null) {\n userAssets = []\n } else {\n userAssets = (await readdir(userAssetDir)).filter(it => !it.startsWith(\".\") && !it.endsWith(\".db\") && it.includes(\".\"))\n for (const name of userAssets) {\n // The makeappx mapping file is quote-delimited with no escape mechanism; reject names that would corrupt it / inject extra entries.\n assertSafeMappingPath(name, \"Asset file name\")\n mappings.push(`\"${vm.toVmFile(userAssetDir)}${vm.pathSep}${name}\" \"assets\\\\${name}\"`)\n allAssets.push(path.join(userAssetDir, name))\n }\n }\n\n for (const defaultAsset of Object.keys(vendorAssetsForDefaultAssets)) {\n if (userAssets.length === 0 || !isDefaultAssetIncluded(userAssets, defaultAsset)) {\n // codeql[js/shell-command-constructed-from-input] - vendorPath is a trusted toolset bundle dir and the asset name is a hardcoded constant; the joined path is resolved and contained under vendorPath via sanitizeDirPath, and only reaches makeappx as an execFile argv element (array args, no shell)\n const file = sanitizeDirPath(path.join(vendorPath, \"appxAssets\", vendorAssetsForDefaultAssets[defaultAsset]), vendorPath)\n mappings.push(`\"${vm.toVmFile(file)}\" \"assets\\\\${defaultAsset}\"`)\n allAssets.push(file)\n }\n }\n\n return { userAssets, mappings, allAssets }\n}\n\n/**\n * The makeappx mapping file (`/f`) is a quote-delimited, newline-separated `[Files]` list with NO escape\n * mechanism. A path component containing a double-quote or CR/LF would corrupt the format or inject an\n * extra mapping entry (remapping/shadowing files in the produced package), so such paths are rejected.\n */\nexport function assertSafeMappingPath(value: string, kind: string): void {\n if (/[\"\\r\\n]/.test(value)) {\n throw new InvalidConfigurationError(`${kind} cannot contain a double-quote or newline — the makeappx mapping file cannot represent it: ${JSON.stringify(value)}`)\n }\n}\n\n/**\n * Builds the `[Files]` mapping lines for the packaged app payload (`\"<vm source>\" \"app\\<rel>\"`), shared\n * by the AppX and MSIX targets. Each relative path is validated via {@link assertSafeMappingPath}.\n */\nexport async function buildAppFileMappings(vm: VmManager, appOutDir: string): Promise<Array<string>> {\n return Promise.all(\n (await walk(appOutDir)).map(file => {\n let relPath = file.substring(appOutDir.length + 1)\n if (path.sep !== \"\\\\\") {\n relPath = relPath.replace(/\\//g, \"\\\\\")\n }\n assertSafeMappingPath(relPath, \"Packaged file path\")\n return `\"${vm.toVmFile(file)}\" \"app\\\\${relPath}\"`\n })\n )\n}\n\nexport function validateApplicationId(result: string, contextLabel: string): void {\n const validCharactersRegex = /^([A-Za-z][A-Za-z0-9]*)(\\.[A-Za-z][A-Za-z0-9]*)*$/\n if (result.length < 1 || result.length > 64) {\n throw new InvalidConfigurationError(`${contextLabel} Application.Id must be between 1 and 64 characters in length: ${result}`)\n }\n if (!validCharactersRegex.test(result)) {\n throw new InvalidConfigurationError(\n `${contextLabel} Application.Id must contain only alpha-numeric characters separated by periods, where each segment starts with an alphabetic character: ${result}`\n )\n }\n if (restrictedApplicationIdValues.includes(result.toUpperCase())) {\n throw new InvalidConfigurationError(`${contextLabel} Application.Id cannot contain restricted values ${JSON.stringify(restrictedApplicationIdValues)}: ${result}`)\n }\n}\n\nexport function validateIdentityName(result: string, contextLabel: string): void {\n const validCharactersRegex = /^[a-zA-Z0-9.-]+$/\n if (result.length < 3 || result.length > 50) {\n throw new InvalidConfigurationError(`${contextLabel} identityName must be between 3 and 50 characters in length: ${result}`)\n }\n if (!validCharactersRegex.test(result)) {\n throw new InvalidConfigurationError(`${contextLabel} identityName must contain only alpha-numeric, period, and dash characters: ${result}`)\n }\n if (restrictedApplicationIdValues.includes(result.toUpperCase())) {\n throw new InvalidConfigurationError(`${contextLabel} identityName cannot contain restricted values ${JSON.stringify(restrictedApplicationIdValues)}: ${result}`)\n }\n}\n\nexport function resourceLanguageTag(userLanguages: Array<string> | Nullish): string {\n if (userLanguages == null || userLanguages.length === 0) {\n userLanguages = [DEFAULT_RESOURCE_LANG]\n }\n return userLanguages.map(it => `<Resource Language=\"${escapeXmlAttr(it.trim().replace(/_/g, \"-\"))}\" />`).join(\"\\n\")\n}\n\nexport function lockScreenTag(userAssets: Array<string>): string {\n if (isDefaultAssetIncluded(userAssets, \"BadgeLogo.png\")) {\n return '<uap:LockScreen Notification=\"badgeAndTileText\" BadgeLogo=\"assets\\\\BadgeLogo.png\" />'\n }\n return \"\"\n}\n\nexport function defaultTileTag(userAssets: Array<string>, showNameOnTiles: boolean): string {\n const defaultTiles: Array<string> = [\"<uap:DefaultTile\", 'Wide310x150Logo=\"assets\\\\Wide310x150Logo.png\"']\n\n if (isDefaultAssetIncluded(userAssets, \"LargeTile.png\")) {\n defaultTiles.push('Square310x310Logo=\"assets\\\\LargeTile.png\"')\n }\n if (isDefaultAssetIncluded(userAssets, \"SmallTile.png\")) {\n defaultTiles.push('Square71x71Logo=\"assets\\\\SmallTile.png\"')\n }\n\n if (showNameOnTiles) {\n defaultTiles.push(\">\")\n defaultTiles.push(\"<uap:ShowNameOnTiles>\")\n defaultTiles.push(\"<uap:ShowOn\", 'Tile=\"wide310x150Logo\"', \"/>\")\n defaultTiles.push(\"<uap:ShowOn\", 'Tile=\"square150x150Logo\"', \"/>\")\n defaultTiles.push(\"</uap:ShowNameOnTiles>\")\n defaultTiles.push(\"</uap:DefaultTile>\")\n } else {\n defaultTiles.push(\"/>\")\n }\n return defaultTiles.join(\" \")\n}\n\nexport function splashScreenTag(userAssets: Array<string>): string {\n if (isDefaultAssetIncluded(userAssets, \"SplashScreen.png\")) {\n return '<uap:SplashScreen Image=\"assets\\\\SplashScreen.png\" />'\n }\n return \"\"\n}\n\nexport function isDefaultAssetIncluded(userAssets: Array<string>, defaultAsset: string): boolean {\n const defaultAssetName = defaultAsset.substring(0, defaultAsset.indexOf(\".\"))\n return userAssets.some(it => it.includes(defaultAssetName))\n}\n\nexport function isScaledAssetsProvided(userAssets: Array<string>): boolean {\n return userAssets.some(it => it.includes(\".scale-\") || it.includes(\".targetsize-\"))\n}\n\n/**\n * Resolves the final applicationId value from config, stripping any leading numeric prefix\n * from identityName (a common user mistake), then validates it.\n */\nexport function resolvePackageApplicationId(applicationId: string | undefined, identityName: string | null | undefined, appName: string, contextLabel: string): string {\n let result: string\n const identitynumber = parseInt(identityName as string, 10) || NaN\n\n if (applicationId) {\n result = applicationId\n validateApplicationId(result, contextLabel)\n return result\n }\n\n if (!isNaN(identitynumber) && identityName !== null && identityName !== undefined) {\n if (identityName[0] === \"0\") {\n log.warn(`Remove the 0${identitynumber}`)\n result = identityName.replace(\"0\" + identitynumber.toString(), \"\")\n } else {\n log.warn(`Remove the ${identitynumber}`)\n result = identityName.replace(identitynumber.toString(), \"\")\n }\n } else {\n result = identityName || appName\n }\n\n // `result` is a derived value (from identityName or the app name). identityName allows characters\n // (e.g. a dash) that are invalid in an Application.Id, so surface an actionable error rather than\n // the raw low-level validation message when the derivation cannot produce a valid id.\n try {\n validateApplicationId(result, contextLabel)\n } catch (e) {\n throw new InvalidConfigurationError(\n `${contextLabel} could not derive a valid Application.Id (\"${result}\") from identityName/name — Application.Id allows only alpha-numeric segments separated by periods (no dashes). Set the \"applicationId\" option explicitly. Cause: ${(e as Error).message}`\n )\n }\n return result\n}\n\nexport function resolvePackageIdentityName(identityName: string | null | undefined, appName: string, contextLabel: string): string {\n const result = identityName || appName\n validateIdentityName(result, contextLabel)\n return result\n}\n\nexport function buildCapabilitiesXml(capabilityNames: Array<string> | null | undefined): string {\n const caps = asArray(capabilityNames)\n const capSet = new Set(caps)\n\n const invalid = Array.from(capSet).filter(cap => !isValidCapabilityName(cap))\n if (invalid.length > 0) {\n throw new Error(`invalid windows capabilit${invalid.length === 1 ? \"y\" : \"ies\"} specified: ${invalid.join(\", \")}`)\n }\n\n capSet.add(\"runFullTrust\")\n\n const capabilityStrings = CAPABILITIES.filter(cap => capSet.has(cap.name)).map(cap => ` ${cap.toXMLString()}`)\n return capabilityStrings.join(\"\\n\")\n}\n\nexport interface ExtensionsInput {\n protocols: Array<Protocol>\n fileAssociations: Array<FileAssociation>\n addAutoLaunchExtension?: boolean\n customExtensionsPath?: string\n appDir: string\n executable: string\n displayName: string\n dependencyNames?: Record<string, string> | null\n}\n\nexport async function buildExtensionsXml(input: ExtensionsInput): Promise<string> {\n const { protocols, fileAssociations, appDir, executable, displayName, customExtensionsPath } = input\n\n let isAddAutoLaunch = input.addAutoLaunchExtension\n if (isAddAutoLaunch === undefined) {\n isAddAutoLaunch = input.dependencyNames != null && input.dependencyNames[\"electron-winstore-auto-launch\"] != null\n }\n\n if (!isAddAutoLaunch && protocols.length === 0 && fileAssociations.length === 0 && customExtensionsPath === undefined) {\n return \"\"\n }\n\n let extensions = \"<Extensions>\"\n\n if (isAddAutoLaunch) {\n extensions += `\n <desktop:Extension Category=\"windows.startupTask\" Executable=\"${escapeXmlAttr(executable)}\" EntryPoint=\"Windows.FullTrustApplication\">\n <desktop:StartupTask TaskId=\"SlackStartup\" Enabled=\"true\" DisplayName=\"${escapeXmlAttr(displayName)}\" />\n </desktop:Extension>`\n }\n\n for (const protocol of protocols) {\n for (const scheme of asArray(protocol.schemes)) {\n extensions += `\n <uap:Extension Category=\"windows.protocol\">\n <uap:Protocol Name=\"${escapeXmlAttr(scheme)}\">\n <uap:DisplayName>${escapeXmlAttr(protocol.name)}</uap:DisplayName>\n </uap:Protocol>\n </uap:Extension>`\n }\n }\n\n for (const fileAssociation of fileAssociations) {\n for (const ext of asArray(fileAssociation.ext)) {\n const extEsc = escapeXmlAttr(ext)\n extensions += `\n <uap:Extension Category=\"windows.fileTypeAssociation\">\n <uap:FileTypeAssociation Name=\"${extEsc}\">\n <uap:SupportedFileTypes>\n <uap:FileType>.${extEsc}</uap:FileType>\n </uap:SupportedFileTypes>\n </uap:FileTypeAssociation>\n </uap:Extension>`\n }\n }\n\n if (customExtensionsPath !== undefined) {\n const extensionsPath = path.resolve(appDir, customExtensionsPath)\n extensions += await readFile(extensionsPath, \"utf8\")\n }\n\n extensions += \"</Extensions>\"\n return extensions\n}\n\nexport function buildWindowsServicesXml(services: ReadonlyArray<MsixWindowsService> | undefined, defaultExecutable: string): string {\n if (!services || services.length === 0) {\n return \"\"\n }\n return services\n .map(svc => {\n const exe = escapeXmlAttr(svc.executable || defaultExecutable)\n // desktop6:Service requires both StartupType (\"auto\" | \"manual\" | \"disabled\") and StartAccount\n // (\"localSystem\" | \"localService\" | \"networkService\"). Omitting StartAccount produces a manifest\n // makeappx rejects. See https://learn.microsoft.com/uwp/schemas/appxpackage/uapmanifestschema/element-desktop6-service\n const startupType = escapeXmlAttr(svc.startupType ?? \"manual\")\n const startAccount = escapeXmlAttr(svc.startAccount ?? \"localSystem\")\n const argsAttr = svc.arguments != null ? ` Arguments=\"${escapeXmlAttr(svc.arguments)}\"` : \"\"\n return `\n <desktop6:Extension Category=\"windows.service\" Executable=\"${exe}\" EntryPoint=\"Windows.FullTrustApplication\">\n <desktop6:Service Name=\"${escapeXmlAttr(svc.name)}\" StartupType=\"${startupType}\" StartAccount=\"${startAccount}\"${argsAttr} />\n </desktop6:Extension>`\n })\n .join(\"\")\n}\n\n/** Options shared by the AppX and MSIX targets that the build pipeline reads directly. */\nexport interface AppxPackageBuildOptions extends TargetSpecificOptions {\n readonly publisher?: string | null\n readonly makeappxArgs?: Array<string> | null\n readonly electronUpdaterAware?: boolean\n}\n\nexport interface AppxBuildContext {\n readonly arch: Arch\n readonly artifactPath: string\n readonly vendorPathKit: string\n readonly vm: VmManager\n}\n\nexport interface AppxPackageBuildConfig {\n /** `\"appx\"` | `\"msix\"` — drives artifact naming, the safe-artifact name, and the debug-log key. */\n readonly kind: \"appx\" | \"msix\"\n /** Human-facing target name for build-progress events (`\"AppX\"` | `\"MSIX\"`). */\n readonly presentableName: string\n /** Writes the target-specific `AppxManifest.xml` (AppX and MSIX use different templates/macros). */\n writeManifest(manifestFile: string, arch: Arch, publisher: string, userAssets: Array<string>): Promise<void>\n /** Optional pre-flight validation (e.g. the MSIX legacy-toolset guard); a throw aborts the build. */\n preflight?(): void | Promise<void>\n /**\n * Optional hook invoked synchronously (before the deferred pack task is queued) with the build\n * context. MSIX uses it to record the per-arch artifact + VM/kit paths so `finishBuild` can assemble\n * the `.msixbundle` / `.msixupload`.\n */\n onBuilt?(ctx: AppxBuildContext): void\n}\n\n/**\n * Shared build pipeline for the AppX and MSIX targets — both pack via the Windows Kits `makeappx.exe`\n * and differ only in the bits supplied through {@link AppxPackageBuildConfig}. It walks the app payload\n * and assets into a `makeappx` mapping file, generates `resources.pri` when scaled assets are present,\n * writes the manifest, then packs + signs the artifact on the target's build queue.\n */\nexport async function buildAppxPackage(\n target: Target,\n packager: WinPackager,\n options: AppxPackageBuildOptions,\n appOutDir: string,\n arch: Arch,\n config: AppxPackageBuildConfig\n): Promise<void> {\n await config.preflight?.()\n\n const artifactName = packager.expandArtifactBeautyNamePattern(options, config.kind, arch)\n const artifactPath = path.join(target.outDir, artifactName)\n await packager.emitArtifactBuildStarted({ targetPresentableName: config.presentableName, file: artifactPath, arch })\n\n const vendorPath = await getWindowsKitsBundle({ winCodeSign: packager.config.toolsets?.winCodeSign, resourcesDir: packager.buildResourcesDir })\n const vm = await packager.vm.value\n\n config.onBuilt?.({ arch, artifactPath, vendorPathKit: vendorPath.kit, vm })\n\n const stageDir = await createStageDir(target, packager, arch)\n\n const mappingFile = stageDir.getTempFile(\"mapping.txt\")\n const makeAppXArgs = [\"pack\", \"/o\" /* overwrite the output file if it exists */, \"/f\", vm.toVmFile(mappingFile), \"/p\", vm.toVmFile(artifactPath)]\n if (packager.compression === \"store\") {\n makeAppXArgs.push(\"/nc\")\n }\n\n const mappingList: Array<Array<string>> = []\n mappingList.push(await buildAppFileMappings(vm, appOutDir))\n\n const userAssetDir = await packager.getResource(undefined, APPX_ASSETS_DIR_NAME)\n const assetInfo = await computeUserAssets(vm, vendorPath.appxAssets, userAssetDir)\n const userAssets = assetInfo.userAssets\n\n const manifestFile = stageDir.getTempFile(\"AppxManifest.xml\")\n // https://github.com/electron-userland/electron-builder/issues/2108#issuecomment-333200711\n const publisher = await (await packager.signingManager.value).computePublisherName(target, options.publisher ?? null)\n await config.writeManifest(manifestFile, arch, publisher, userAssets)\n\n await packager.emitAppxManifestCreated(manifestFile)\n mappingList.push(assetInfo.mappings)\n mappingList.push([`\"${vm.toVmFile(manifestFile)}\" \"AppxManifest.xml\"`])\n\n if (isScaledAssetsProvided(userAssets)) {\n const outFile = vm.toVmFile(stageDir.getTempFile(\"resources.pri\"))\n const makePriExe = path.join(vendorPath.kit, \"makepri.exe\")\n const makePriPath = vm.toVmFile(makePriExe)\n\n const assetRoot = stageDir.getTempFile(\"appx/assets\")\n await emptyDir(assetRoot)\n await Promise.all(assetInfo.allAssets.map(it => copyOrLinkFile(it, path.join(assetRoot, path.basename(it)))))\n\n // Wait out any transient AV/share lock on the freshly-extracted kit binary (see ensureNotBusy).\n await ensureNotBusy(makePriExe)\n await vm.exec(makePriPath, [\n \"new\",\n \"/Overwrite\",\n \"/Manifest\",\n vm.toVmFile(manifestFile),\n \"/ProjectRoot\",\n vm.toVmFile(path.dirname(assetRoot)),\n \"/ConfigXml\",\n vm.toVmFile(path.join(getTemplatePath(\"appx\"), \"priconfig.xml\")),\n \"/OutputFile\",\n outFile,\n ])\n\n // in addition to resources.pri, resources.scale-140.pri and other such files will be generated\n for (const resourceFile of (await readdir(stageDir.dir)).filter(it => it.startsWith(\"resources.\")).sort()) {\n mappingList.push([`\"${vm.toVmFile(stageDir.getTempFile(resourceFile))}\" \"${resourceFile}\"`])\n }\n makeAppXArgs.push(\"/l\")\n }\n\n let mapping = \"[Files]\"\n for (const list of mappingList) {\n mapping += \"\\r\\n\" + list.join(\"\\r\\n\")\n }\n await writeFile(mappingFile, mapping)\n packager.debugLogger.add(`${config.kind}.mapping`, mapping)\n\n if (options.makeappxArgs != null) {\n makeAppXArgs.push(...options.makeappxArgs)\n }\n\n target.buildQueueManager.add(async () => {\n try {\n const makeAppxExe = path.join(vendorPath.kit, \"makeappx.exe\")\n // The kit binary is often freshly extracted to a cold cache; on Windows an AV scanner can briefly\n // hold a deny-write lock long enough that spawning fails with `spawn UNKNOWN`. Wait for it to clear.\n await ensureNotBusy(makeAppxExe)\n await vm.exec(vm.toVmFile(makeAppxExe), makeAppXArgs)\n await packager.signIf(artifactPath)\n } finally {\n await stageDir.cleanup()\n }\n\n await packager.emitArtifactBuildCompleted({\n file: artifactPath,\n packager,\n arch,\n safeArtifactName: packager.computeSafeArtifactName(artifactName, config.kind),\n target,\n isWriteUpdateInfo: options.electronUpdaterAware,\n })\n })\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"7zip.d.ts","sourceRoot":"","sources":["../../src/toolsets/7zip.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"7zip.d.ts","sourceRoot":"","sources":["../../src/toolsets/7zip.ts"],"names":[],"mappings":"AA+CA;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAGxD;AAED,oHAAoH;AACpH,wBAAgB,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAQ5C"}
|
package/dist/toolsets/7zip.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { chmod } from "node:fs/promises";
|
|
2
2
|
import * as path from "path";
|
|
3
3
|
import { downloadBuilderToolset } from "../util/electronGet.js";
|
|
4
|
+
// Newest 7-Zip bundle — the only version published; no legacy/null-state fallback.
|
|
5
|
+
const SEVEN_ZIP_LATEST = "1.0.0";
|
|
4
6
|
const checksums = {
|
|
5
7
|
"7zip-linux-ia32.tar.gz": "24a5d5bfe81506d0bfe21a812588119ae3deb757e8ba084b2339d8e899543686",
|
|
6
8
|
"7zip-darwin-arm64.tar.gz": "496a341abe210aae1a25bc202ee97f6de6c76a3dc80f91d96616be05502d72c1",
|
|
@@ -66,7 +68,7 @@ async function resolve() {
|
|
|
66
68
|
}
|
|
67
69
|
const filename = getFilename();
|
|
68
70
|
const toolDir = await downloadBuilderToolset({
|
|
69
|
-
releaseName: `7zip
|
|
71
|
+
releaseName: `7zip@${SEVEN_ZIP_LATEST}`,
|
|
70
72
|
filenameWithExt: filename,
|
|
71
73
|
checksums: checksums,
|
|
72
74
|
githubOrgRepo: "electron-userland/electron-builder-binaries",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"7zip.js","sourceRoot":"","sources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GAAG,OAAO,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;YACpC,aAAa,GAAG,IAAI,CAAA;YACpB,MAAM,GAAG,CAAA;QACX,CAAC,CAAC,CAAA;IACJ,CAAC;IACD,OAAO,aAAa,CAAA;AACtB,CAAC;AAED,KAAK,UAAU,OAAO;IACpB,IAAI,WAAW,IAAI,IAAI,EAAE,CAAC;QACxB,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;YACjC,MAAM,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,CAAA;QACjC,CAAC;QACD,OAAO,WAAW,CAAA;IACpB,CAAC;IAED,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAA;IAC9B,MAAM,OAAO,GAAG,MAAM,sBAAsB,CAAC;QAC3C,WAAW,EAAE,QAAQ,gBAAgB,EAAE;QACvC,eAAe,EAAE,QAAQ;QACzB,SAAS,EAAE,SAAS;QACpB,aAAa,EAAE,6CAA6C;KAC7D,CAAC,CAAA;IAEF,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;IACvF,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;QACjC,MAAM,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;IACzB,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC","sourcesContent":["import { chmod } from \"node:fs/promises\"\nimport * as path from \"path\"\nimport { downloadBuilderToolset } from \"../util/electronGet.js\"\n\n// Newest 7-Zip bundle — the only version published; no legacy/null-state fallback.\nconst SEVEN_ZIP_LATEST = \"1.0.0\"\n\nconst checksums = {\n \"7zip-linux-ia32.tar.gz\": \"24a5d5bfe81506d0bfe21a812588119ae3deb757e8ba084b2339d8e899543686\",\n \"7zip-darwin-arm64.tar.gz\": \"496a341abe210aae1a25bc202ee97f6de6c76a3dc80f91d96616be05502d72c1\",\n \"7zip-darwin-x86_64.tar.gz\": \"496a341abe210aae1a25bc202ee97f6de6c76a3dc80f91d96616be05502d72c1\",\n \"7zip-linux-arm64.tar.gz\": \"5aff5034206b78f8261249ceb922b5c7e04c9bdb733784d8f5b6df9732cf1f79\",\n \"7zip-win-arm64.tar.gz\": \"ac3f38f96ce7498096a123bb0862dd6db863a7353c9e9e1c15f73c183adf6620\",\n \"7zip-win-ia32.tar.gz\": \"ac3f38f96ce7498096a123bb0862dd6db863a7353c9e9e1c15f73c183adf6620\",\n \"7zip-win-x64.tar.gz\": \"be071f15bd6da2f78fe81c6ddef2009b0c4d8a51f36b780cb806c7e6df95e1b3\",\n \"7zip-linux-x64.tar.gz\": \"d151bb44b2a9d9bfc52813ce4cac042916394a0ab8a56bd5d221a5dc9ef8d5d7\",\n} as const\n\nfunction getFilename(): keyof typeof checksums {\n const { platform, arch } = process\n if (platform === \"darwin\") {\n return arch === \"arm64\" ? \"7zip-darwin-arm64.tar.gz\" : \"7zip-darwin-x86_64.tar.gz\"\n }\n if (platform === \"linux\") {\n if (arch === \"arm64\") {\n return \"7zip-linux-arm64.tar.gz\"\n }\n if (arch === \"ia32\") {\n return \"7zip-linux-ia32.tar.gz\"\n }\n return \"7zip-linux-x64.tar.gz\"\n }\n if (platform === \"win32\") {\n if (arch === \"arm64\") {\n return \"7zip-win-arm64.tar.gz\"\n }\n if (arch === \"ia32\") {\n return \"7zip-win-ia32.tar.gz\"\n }\n return \"7zip-win-x64.tar.gz\"\n }\n throw new Error(`Unsupported platform for 7zip toolset: ${platform}/${arch}`)\n}\n\nlet _customPath: string | null = null\nlet _resolvedPath: Promise<string> | null = null\n\n/**\n * Override the 7za binary path with a pre-resolved absolute path.\n * Called by the packager when `toolsets.sevenZip` is a `ToolsetCustom` config.\n * Resets the resolution cache so the next `getPath7za()` call uses this path.\n */\nexport function setSevenZipPath(customPath: string): void {\n _customPath = customPath\n _resolvedPath = null\n}\n\n/** Returns the path to the 7za executable, downloading it on first call. Resets on failure so callers can retry. */\nexport function getPath7za(): Promise<string> {\n if (_resolvedPath == null) {\n _resolvedPath = resolve().catch(err => {\n _resolvedPath = null\n throw err\n })\n }\n return _resolvedPath\n}\n\nasync function resolve(): Promise<string> {\n if (_customPath != null) {\n if (process.platform !== \"win32\") {\n await chmod(_customPath, 0o755)\n }\n return _customPath\n }\n\n const filename = getFilename()\n const toolDir = await downloadBuilderToolset({\n releaseName: `7zip@${SEVEN_ZIP_LATEST}`,\n filenameWithExt: filename,\n checksums: checksums,\n githubOrgRepo: \"electron-userland/electron-builder-binaries\",\n })\n\n const bin = path.join(toolDir, \"bin\", process.platform === \"win32\" ? \"7za.exe\" : \"7za\")\n if (process.platform !== \"win32\") {\n await chmod(bin, 0o755)\n }\n return bin\n}\n"]}
|
|
@@ -4,12 +4,12 @@ export declare const appimageChecksums: {
|
|
|
4
4
|
readonly "0.0.0": {
|
|
5
5
|
readonly "appimage-12.0.1.7z": "d12ff7eb8f1d1ec4652ca5237a7fbdca33acc0c758045636feca62dc6ecb8ec4";
|
|
6
6
|
};
|
|
7
|
-
readonly "1.0.2": {
|
|
8
|
-
readonly "appimage-tools-runtime-20251108.tar.gz": "a784a8c26331ec2e945c23d6bdb14af5c9df27f5939825d84b8709c61dc81eb0";
|
|
9
|
-
};
|
|
10
7
|
readonly "1.0.3": {
|
|
11
8
|
readonly "appimage-tools-runtime-20251108.tar.gz": "84021a78ee214ae6fd33a2d62a92ba25542dd10bc86bf117a9b2d0bba44e7665";
|
|
12
9
|
};
|
|
10
|
+
readonly "1.1.0": {
|
|
11
|
+
readonly "appimage-tools-runtime-20251108.tar.gz": "098182ab8d3bb93db8a23691671f665ff92316249ace850aec63b9d010ec7fe0";
|
|
12
|
+
};
|
|
13
13
|
};
|
|
14
14
|
export declare function getAppImageTools(toolset: ToolsetConfig["appimage"], targetArch: Arch, resourcesDir: string): Promise<{
|
|
15
15
|
mksquashfs: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appimage.d.ts","sourceRoot":"","sources":["../../src/toolsets/appimage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAEnC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"appimage.d.ts","sourceRoot":"","sources":["../../src/toolsets/appimage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAEnC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAOnD,eAAO,MAAM,iBAAiB;;;;;;;;;;CAUpB,CAAA;AAEV,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,aAAa,CAAC,UAAU,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM;;;;;GAyDhH"}
|
|
@@ -2,16 +2,18 @@ import { Arch } 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
|
+
// Newest AppImage bundle — selected when the config is unset / null / "latest".
|
|
6
|
+
const APPIMAGE_LATEST = "1.1.0";
|
|
5
7
|
export const appimageChecksums = {
|
|
6
8
|
"0.0.0": {
|
|
7
9
|
"appimage-12.0.1.7z": "d12ff7eb8f1d1ec4652ca5237a7fbdca33acc0c758045636feca62dc6ecb8ec4",
|
|
8
10
|
},
|
|
9
|
-
"1.0.2": {
|
|
10
|
-
"appimage-tools-runtime-20251108.tar.gz": "a784a8c26331ec2e945c23d6bdb14af5c9df27f5939825d84b8709c61dc81eb0",
|
|
11
|
-
},
|
|
12
11
|
"1.0.3": {
|
|
13
12
|
"appimage-tools-runtime-20251108.tar.gz": "84021a78ee214ae6fd33a2d62a92ba25542dd10bc86bf117a9b2d0bba44e7665",
|
|
14
13
|
},
|
|
14
|
+
"1.1.0": {
|
|
15
|
+
"appimage-tools-runtime-20251108.tar.gz": "098182ab8d3bb93db8a23691671f665ff92316249ace850aec63b9d010ec7fe0",
|
|
16
|
+
},
|
|
15
17
|
};
|
|
16
18
|
export async function getAppImageTools(toolset, targetArch, resourcesDir) {
|
|
17
19
|
const runtimeArch = targetArch === Arch.armv7l ? "arm32" : targetArch === Arch.arm64 ? "arm64" : targetArch === Arch.ia32 ? "ia32" : "x64";
|
|
@@ -38,8 +40,8 @@ export async function getAppImageTools(toolset, targetArch, resourcesDir) {
|
|
|
38
40
|
runtimeLibraries: path.resolve(artifactPath, "lib", libArch),
|
|
39
41
|
};
|
|
40
42
|
};
|
|
41
|
-
// null
|
|
42
|
-
const isFuse2 =
|
|
43
|
+
// Only the explicit legacy pin selects the FUSE2 runtime; unset / null / "latest" → newest.
|
|
44
|
+
const isFuse2 = toolset === "0.0.0";
|
|
43
45
|
if (isFuse2) {
|
|
44
46
|
const filenameWithExt = "appimage-12.0.1.7z";
|
|
45
47
|
const artifactPath = await downloadBuilderToolset({
|
|
@@ -54,7 +56,8 @@ export async function getAppImageTools(toolset, targetArch, resourcesDir) {
|
|
|
54
56
|
const vendorPath = await getCustomToolsetPath(toolset, resourcesDir);
|
|
55
57
|
return getPaths(vendorPath);
|
|
56
58
|
}
|
|
57
|
-
|
|
59
|
+
// Unset / null / "latest" → newest ("1.1.0"); only an explicit "1.0.3" pin stays on 1.0.3.
|
|
60
|
+
const effectiveVersion = toolset === "1.0.3" ? "1.0.3" : APPIMAGE_LATEST;
|
|
58
61
|
const filenameWithExt = "appimage-tools-runtime-20251108.tar.gz";
|
|
59
62
|
const artifactPath = await downloadBuilderToolset({
|
|
60
63
|
releaseName: `appimage@${effectiveVersion}`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appimage.js","sourceRoot":"","sources":["../../src/toolsets/appimage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAA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AI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;QACnD,MAAM,UAAU,GAAG,MAAM,oBAAoB,CAAC,OAAO,EAAE,YAAY,CAAC,CAAA;QACpE,OAAO,QAAQ,CAAC,UAAU,CAAC,CAAA;IAC7B,CAAC;IAED,2FAA2F;IAC3F,MAAM,gBAAgB,GAAqC,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAA;IAC1G,MAAM,eAAe,GAAG,wCAAwC,CAAA;IAChE,MAAM,YAAY,GAAG,MAAM,sBAAsB,CAAC;QAChD,WAAW,EAAE,YAAY,gBAAgB,EAAE;QAC3C,eAAe;QACf,SAAS,EAAE,EAAE,CAAC,eAAe,CAAC,EAAE,iBAAiB,CAAC,gBAAgB,CAAC,CAAC,eAAe,CAAC,EAAE;QACtF,aAAa,EAAE,6CAA6C;KAC7D,CAAC,CAAA;IACF,OAAO,QAAQ,CAAC,YAAY,CAAC,CAAA;AAC/B,CAAC","sourcesContent":["import { Arch } from \"builder-util\"\nimport * as path from \"path\"\nimport { ToolsetConfig } from \"../configuration.js\"\nimport { downloadBuilderToolset } from \"../util/electronGet.js\"\nimport { getCustomToolsetPath } from \"./custom.js\"\n\n// Newest AppImage bundle — selected when the config is unset / null / \"latest\".\nconst APPIMAGE_LATEST = \"1.1.0\"\n\nexport const appimageChecksums = {\n \"0.0.0\": {\n \"appimage-12.0.1.7z\": \"d12ff7eb8f1d1ec4652ca5237a7fbdca33acc0c758045636feca62dc6ecb8ec4\",\n },\n \"1.0.3\": {\n \"appimage-tools-runtime-20251108.tar.gz\": \"84021a78ee214ae6fd33a2d62a92ba25542dd10bc86bf117a9b2d0bba44e7665\",\n },\n \"1.1.0\": {\n \"appimage-tools-runtime-20251108.tar.gz\": \"098182ab8d3bb93db8a23691671f665ff92316249ace850aec63b9d010ec7fe0\",\n },\n} as const\n\nexport async function getAppImageTools(toolset: ToolsetConfig[\"appimage\"], targetArch: Arch, resourcesDir: string) {\n const runtimeArch = targetArch === Arch.armv7l ? \"arm32\" : targetArch === Arch.arm64 ? \"arm64\" : targetArch === Arch.ia32 ? \"ia32\" : \"x64\"\n\n // Static-runtime layout: tools at root, runtimes/ subdir, lib/{arch}/ subdir\n const getPaths = (artifactPath: string) => ({\n mksquashfs: path.resolve(artifactPath, \"mksquashfs\"),\n desktopFileValidate: path.resolve(artifactPath, \"desktop-file-validate\"),\n runtime: path.resolve(artifactPath, \"runtimes\", `runtime-${runtimeArch}`),\n runtimeLibraries: path.resolve(artifactPath, \"lib\", runtimeArch),\n })\n\n // FUSE2 layout: tools under a host-platform subdir; runtime files at root with target-arch suffix\n const getFuse2Paths = (artifactPath: string) => {\n // mksquashfs/desktop-file-validate are HOST binaries — use process.arch, not targetArch\n const hostArch = process.arch === \"arm\" ? \"arm32\" : process.arch === \"arm64\" ? \"arm64\" : process.arch === \"ia32\" ? \"ia32\" : \"x64\"\n const toolRoot = process.platform === \"linux\" ? `linux-${hostArch}` : \"darwin\"\n // Runtime files live at root; armv7l target uses \"armv7l\" filename, not the internal \"arm32\" alias\n const runtimeSuffix = targetArch === Arch.armv7l ? \"armv7l\" : runtimeArch\n // FUSE2 tree only ships lib/ia32 and lib/x64; arm targets fall back to x64 here\n const libArch = targetArch === Arch.ia32 ? \"ia32\" : \"x64\"\n return {\n mksquashfs: path.resolve(artifactPath, toolRoot, \"mksquashfs\"),\n desktopFileValidate: path.resolve(artifactPath, toolRoot, \"desktop-file-validate\"),\n runtime: path.resolve(artifactPath, `runtime-${runtimeSuffix}`),\n runtimeLibraries: path.resolve(artifactPath, \"lib\", libArch),\n }\n }\n\n // Only the explicit legacy pin selects the FUSE2 runtime; unset / null / \"latest\" → newest.\n const isFuse2 = toolset === \"0.0.0\"\n\n if (isFuse2) {\n const filenameWithExt = \"appimage-12.0.1.7z\"\n const artifactPath = await downloadBuilderToolset({\n releaseName: \"appimage-12.0.1\",\n filenameWithExt,\n checksums: { [filenameWithExt]: appimageChecksums[\"0.0.0\"][filenameWithExt] },\n githubOrgRepo: \"electron-userland/electron-builder-binaries\",\n })\n return getFuse2Paths(artifactPath)\n }\n\n if (typeof toolset === \"object\" && toolset != null) {\n const vendorPath = await getCustomToolsetPath(toolset, resourcesDir)\n return getPaths(vendorPath)\n }\n\n // Unset / null / \"latest\" → newest (\"1.1.0\"); only an explicit \"1.0.3\" pin stays on 1.0.3.\n const effectiveVersion: \"1.0.3\" | typeof APPIMAGE_LATEST = toolset === \"1.0.3\" ? \"1.0.3\" : APPIMAGE_LATEST\n const filenameWithExt = \"appimage-tools-runtime-20251108.tar.gz\"\n const artifactPath = await downloadBuilderToolset({\n releaseName: `appimage@${effectiveVersion}`,\n filenameWithExt,\n checksums: { [filenameWithExt]: appimageChecksums[effectiveVersion][filenameWithExt] },\n githubOrgRepo: \"electron-userland/electron-builder-binaries\",\n })\n return getPaths(artifactPath)\n}\n"]}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { ToolsetCustom } from "../configuration.js";
|
|
2
2
|
export declare function clearCustomToolsetCache(): void;
|
|
3
|
-
export declare function getCustomToolsetPath(custom: ToolsetCustom, resourcesDir
|
|
4
|
-
export declare function hashUrlSafe(input: string, length?: number): string;
|
|
5
|
-
export declare function extractArchive(file: string, dir: string): Promise<void>;
|
|
3
|
+
export declare function getCustomToolsetPath(custom: ToolsetCustom, resourcesDir?: string): Promise<string>;
|
|
6
4
|
//# sourceMappingURL=custom.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom.d.ts","sourceRoot":"","sources":["../../src/toolsets/custom.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"custom.d.ts","sourceRoot":"","sources":["../../src/toolsets/custom.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAuCnD,wBAAgB,uBAAuB,IAAI,IAAI,CAE9C;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,aAAa,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAQlG"}
|
package/dist/toolsets/custom.js
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createReadStream, createWriteStream } from "fs";
|
|
3
|
-
import * as fs from "fs/promises";
|
|
1
|
+
import { exists, sanitizeDirPath, validateSecuredUrl } from "builder-util";
|
|
4
2
|
import { mkdir, rmdir, stat } from "fs/promises";
|
|
5
3
|
import * as path from "path";
|
|
6
|
-
import
|
|
7
|
-
import { pipeline } from "stream/promises";
|
|
8
|
-
import * as tar from "tar";
|
|
9
|
-
import * as unzipper from "unzipper";
|
|
10
|
-
import { downloadBuilderToolset, getCacheDirectory } from "../util/electronGet.js";
|
|
11
|
-
import { getPath7za } from "./7zip.js";
|
|
4
|
+
import { cacheDirectoryOverrideAllowed, downloadBuilderToolset, extractArchive, hashUrlSafe } from "../util/electronGet.js";
|
|
12
5
|
async function validateCustomToolset(custom, resourcesDir) {
|
|
13
6
|
const url = custom.url.trim();
|
|
14
7
|
try {
|
|
@@ -23,7 +16,7 @@ async function validateCustomToolset(custom, resourcesDir) {
|
|
|
23
16
|
}
|
|
24
17
|
if (url.startsWith("file://")) {
|
|
25
18
|
const p = url.slice("file://".length);
|
|
26
|
-
const isWithinResources = path.normalize(p).startsWith(path.normalize(resourcesDir + path.sep));
|
|
19
|
+
const isWithinResources = resourcesDir ? path.normalize(p).startsWith(path.normalize(resourcesDir + path.sep)) : false;
|
|
27
20
|
const isValid = path.isAbsolute(p) || isWithinResources;
|
|
28
21
|
const type = isValid &&
|
|
29
22
|
(await exists(p)) &&
|
|
@@ -73,7 +66,7 @@ async function _resolveCustomToolsetPath(custom, resourcesDir) {
|
|
|
73
66
|
});
|
|
74
67
|
}
|
|
75
68
|
else if (type === "file") {
|
|
76
|
-
const cacheDir =
|
|
69
|
+
const cacheDir = await cacheDirectoryOverrideAllowed.value;
|
|
77
70
|
const customToolsetDir = path.join(cacheDir, "custom-toolsets");
|
|
78
71
|
await mkdir(customToolsetDir, { recursive: true });
|
|
79
72
|
// wipe first to ensure idempotent extraction if the source file changed since last extraction
|
|
@@ -86,126 +79,4 @@ async function _resolveCustomToolsetPath(custom, resourcesDir) {
|
|
|
86
79
|
}
|
|
87
80
|
throw new Error(`Unsupported custom toolset type: ${type}`);
|
|
88
81
|
}
|
|
89
|
-
export function hashUrlSafe(input, length = 6) {
|
|
90
|
-
let hash = 5381;
|
|
91
|
-
for (let i = 0; i < input.length; i++) {
|
|
92
|
-
hash = ((hash << 5) + hash) ^ input.charCodeAt(i);
|
|
93
|
-
}
|
|
94
|
-
hash >>>= 0;
|
|
95
|
-
const out = hash.toString(36);
|
|
96
|
-
return out.length >= length ? out.slice(0, length) : out.padStart(length, "0");
|
|
97
|
-
}
|
|
98
|
-
async function extractZipStreaming(file, dir) {
|
|
99
|
-
// Pass 1: read central directory once to collect Unix modes (one seek to EOF)
|
|
100
|
-
const zipDir = await unzipper.Open.file(file);
|
|
101
|
-
const entryModes = new Map();
|
|
102
|
-
for (const entry of zipDir.files) {
|
|
103
|
-
const mode = (entry.externalFileAttributes >> 16) & 0xffff;
|
|
104
|
-
if (mode > 0) {
|
|
105
|
-
entryModes.set(entry.path, mode);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
const isSymlink = (mode) => (mode & 0o170000) === 0o120000;
|
|
109
|
-
// Pass 2: stream from byte 0 — no per-entry seeks, no Docker hang
|
|
110
|
-
const entries = createReadStream(file).pipe(unzipper.Parse({ forceStream: true }));
|
|
111
|
-
for await (const entry of entries) {
|
|
112
|
-
const destPath = path.resolve(dir, entry.path);
|
|
113
|
-
if (!destPath.startsWith(dir + path.sep) && destPath !== dir) {
|
|
114
|
-
throw new Error(`Path traversal blocked: ${entry.path}`);
|
|
115
|
-
}
|
|
116
|
-
const mode = entryModes.get(entry.path) ?? 0;
|
|
117
|
-
if (mode > 0 && isSymlink(mode)) {
|
|
118
|
-
const target = (await entry.buffer()).toString();
|
|
119
|
-
if (path.isAbsolute(target)) {
|
|
120
|
-
throw new Error(`Absolute symlink target blocked: ${target}`);
|
|
121
|
-
}
|
|
122
|
-
const resolvedTarget = path.resolve(path.dirname(destPath), target);
|
|
123
|
-
if (!resolvedTarget.startsWith(dir + path.sep) && resolvedTarget !== dir) {
|
|
124
|
-
throw new Error(`Symlink target escapes extraction dir: ${target}`);
|
|
125
|
-
}
|
|
126
|
-
await fs.mkdir(path.dirname(destPath), { recursive: true });
|
|
127
|
-
await fs.symlink(target, destPath);
|
|
128
|
-
}
|
|
129
|
-
else if (entry.type === "Directory") {
|
|
130
|
-
await fs.mkdir(destPath, { recursive: true });
|
|
131
|
-
entry.autodrain();
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
await fs.mkdir(path.dirname(destPath), { recursive: true });
|
|
135
|
-
await pipeline(entry, createWriteStream(destPath));
|
|
136
|
-
if (mode > 0) {
|
|
137
|
-
await fs.chmod(destPath, mode & 0o7777);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
export async function extractArchive(file, dir) {
|
|
143
|
-
const tmpDir = `${dir}.tmp`;
|
|
144
|
-
await fs.mkdir(tmpDir, { recursive: true });
|
|
145
|
-
const release = await lockfile.lock(tmpDir, {
|
|
146
|
-
retries: { retries: 100, minTimeout: 1000, maxTimeout: 5000 },
|
|
147
|
-
stale: 120000,
|
|
148
|
-
});
|
|
149
|
-
try {
|
|
150
|
-
await fs.rm(tmpDir, { recursive: true, force: true });
|
|
151
|
-
await fs.mkdir(tmpDir, { recursive: true });
|
|
152
|
-
// Guard against transient window in @electron/get's non-atomic putFileInCache (remove → move).
|
|
153
|
-
for (let i = 0; !(await exists(file)); i++) {
|
|
154
|
-
if (i >= 4) {
|
|
155
|
-
throw Object.assign(new Error(`Source archive not found after retries: ${file}`), { code: "ENOENT", path: file });
|
|
156
|
-
}
|
|
157
|
-
log.warn({ file, attempt: i + 1 }, "source archive transiently missing, retrying");
|
|
158
|
-
await new Promise(r => setTimeout(r, 300 * (i + 1)));
|
|
159
|
-
}
|
|
160
|
-
if (file.endsWith(".tar.gz") || file.endsWith(".tgz")) {
|
|
161
|
-
await tar.extract({ file, cwd: tmpDir, strip: 1 });
|
|
162
|
-
}
|
|
163
|
-
else if (file.endsWith(".tar.xz") || file.endsWith(".txz")) {
|
|
164
|
-
const cmd7za = await getPath7za();
|
|
165
|
-
const xzOutDir = `${tmpDir}.xz`;
|
|
166
|
-
await fs.rm(xzOutDir, { recursive: true, force: true });
|
|
167
|
-
await fs.mkdir(xzOutDir, { recursive: true });
|
|
168
|
-
try {
|
|
169
|
-
await exec(cmd7za, ["x", "-bd", file, to7zaOutputSwitch(sanitizeDirPath(xzOutDir)), "-y"]);
|
|
170
|
-
const innerTar = (await fs.readdir(xzOutDir)).find(f => f.endsWith(".tar"));
|
|
171
|
-
if (innerTar == null) {
|
|
172
|
-
throw new Error(`xz decompression of ${path.basename(file)} produced no .tar archive`);
|
|
173
|
-
}
|
|
174
|
-
await tar.extract({ file: path.join(xzOutDir, innerTar), cwd: tmpDir, strip: 1 });
|
|
175
|
-
}
|
|
176
|
-
finally {
|
|
177
|
-
await fs.rm(xzOutDir, { recursive: true, force: true });
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
else if (file.endsWith(".zip")) {
|
|
181
|
-
await extractZipStreaming(file, tmpDir);
|
|
182
|
-
}
|
|
183
|
-
else if (file.endsWith(".7z")) {
|
|
184
|
-
const cmd7za = await getPath7za();
|
|
185
|
-
try {
|
|
186
|
-
await exec(cmd7za, ["x", "-bd", file, to7zaOutputSwitch(sanitizeDirPath(tmpDir)), "-y"]);
|
|
187
|
-
}
|
|
188
|
-
catch (e) {
|
|
189
|
-
const files = await fs.readdir(tmpDir);
|
|
190
|
-
if (files.length === 0) {
|
|
191
|
-
log.warn({ file, tmpDir, error: e.message }, "7z extraction produced no output");
|
|
192
|
-
throw new Error(`7z extraction failed for ${file}: ${e.message}`);
|
|
193
|
-
}
|
|
194
|
-
log.warn({ error: e.message, filesExtracted: files.length }, "7z reported error but extracted files");
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
else {
|
|
198
|
-
throw new Error(`Unsupported archive format: ${path.basename(file)}`);
|
|
199
|
-
}
|
|
200
|
-
const extractedFiles = await fs.readdir(tmpDir);
|
|
201
|
-
if (extractedFiles.length === 0) {
|
|
202
|
-
throw new Error(`Extraction of ${path.basename(file)} produced no files`);
|
|
203
|
-
}
|
|
204
|
-
await fs.rm(dir, { recursive: true, force: true });
|
|
205
|
-
await fs.rename(tmpDir, dir);
|
|
206
|
-
}
|
|
207
|
-
finally {
|
|
208
|
-
await release().catch(err => log.warn({ err }, "failed to release lockfile"));
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
82
|
//# sourceMappingURL=custom.js.map
|
|
@@ -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,wBAA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ACH,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,CAAC,+BAA+B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QACvE,CAAC;QAED,MAAM,cAAc,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;QAC/C,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAChC,MAAM,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;QAC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AAC,aAAa,CAAC,EAAE,CAAC;YAChC,MAAM,KAAK,CAAC,aAAa,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;QACjD,CAAC;QACD,MAAM,cAAc,CAAC,eAAe,CAAC,OAAO,CAAC,GAAG,EAAE,YAAY,CAAC,EAAE,aAAa,CAAC,CAAA;QAC/E,OAAO,aAAa,CAAA;IACtB,CAAC;IAED,MAAM,IAAI,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,EA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QAC3C,WAAW,EAAE,OAAO,OAAO,EAAE;QAC7B,eAAe,EAAE,QAAQ;QACzB,SAAS,EAAE,YAAY,CAAC,OAAO,CAAC;QAChC,aAAa,EAAE,6CAA6C;KAC7D,CAAC,CAAA;IACF,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;AACpC,CAAC","sourcesContent":["import { InvalidConfigurationError } from \"builder-util\"\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
|
@@ -3,6 +3,9 @@ import * as path from "path";
|
|
|
3
3
|
import { downloadBuilderToolset } from "../util/electronGet.js";
|
|
4
4
|
import { withIconsLock } from "../util/toolsetLock.js";
|
|
5
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";
|
|
6
9
|
const iconsToolsChecksums = {
|
|
7
10
|
"1.1.0": {
|
|
8
11
|
"icons-bundle.tar.gz": "2241c9501aa5ddd19317956449f50a1bc311df2c34058aae9bf8bfe62081eaec",
|
|
@@ -18,7 +21,7 @@ export async function getIconsToolsetPath(icons, resourcesDir) {
|
|
|
18
21
|
if (typeof icons === "object" && icons != null) {
|
|
19
22
|
return getCustomToolsetPath(icons, resourcesDir);
|
|
20
23
|
}
|
|
21
|
-
const version = icons
|
|
24
|
+
const version = resolveToolsetVersion(icons, ICONS_LATEST);
|
|
22
25
|
return downloadBuilderToolset({
|
|
23
26
|
releaseName: `icons@${version}`,
|
|
24
27
|
filenameWithExt: "icons-bundle.tar.gz",
|