app-builder-lib 24.0.0-alpha.1 → 24.0.0-alpha.2
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/out/ProtonFramework.js +4 -4
- package/out/ProtonFramework.js.map +1 -1
- package/out/appInfo.js +7 -7
- package/out/appInfo.js.map +1 -1
- package/out/asar/asar.d.ts +1 -0
- package/out/asar/asar.js +10 -10
- package/out/asar/asar.js.map +1 -1
- package/out/asar/asarFileChecker.js +2 -2
- package/out/asar/asarFileChecker.js.map +1 -1
- package/out/asar/asarUtil.js +13 -13
- package/out/asar/asarUtil.js.map +1 -1
- package/out/asar/integrity.js +9 -9
- package/out/asar/integrity.js.map +1 -1
- package/out/asar/unpackDetector.js +6 -6
- package/out/asar/unpackDetector.js.map +1 -1
- package/out/binDownload.js +2 -2
- package/out/binDownload.js.map +1 -1
- package/out/codeSign/codesign.js +4 -4
- package/out/codeSign/codesign.js.map +1 -1
- package/out/codeSign/macCodeSign.js +24 -24
- package/out/codeSign/macCodeSign.js.map +1 -1
- package/out/codeSign/windowsCodeSign.js +7 -7
- package/out/codeSign/windowsCodeSign.js.map +1 -1
- package/out/core.js +1 -1
- package/out/core.js.map +1 -1
- package/out/electron/ElectronFramework.js +17 -17
- package/out/electron/ElectronFramework.js.map +1 -1
- package/out/electron/electronMac.js +16 -16
- package/out/electron/electronMac.js.map +1 -1
- package/out/electron/electronVersion.js +5 -5
- package/out/electron/electronVersion.js.map +1 -1
- package/out/fileMatcher.js +10 -10
- package/out/fileMatcher.js.map +1 -1
- package/out/fileTransformer.js +5 -5
- package/out/fileTransformer.js.map +1 -1
- package/out/forge-maker.js +1 -1
- package/out/forge-maker.js.map +1 -1
- package/out/frameworks/LibUiFramework.js +10 -10
- package/out/frameworks/LibUiFramework.js.map +1 -1
- package/out/index.js +3 -3
- package/out/index.js.map +1 -1
- package/out/linuxPackager.js +2 -2
- package/out/linuxPackager.js.map +1 -1
- package/out/macPackager.js +26 -26
- package/out/macPackager.js.map +1 -1
- package/out/options/CommonWindowsInstallerConfiguration.js +3 -3
- package/out/options/CommonWindowsInstallerConfiguration.js.map +1 -1
- package/out/packager.js +34 -34
- package/out/packager.js.map +1 -1
- package/out/platformPackager.js +39 -39
- package/out/platformPackager.js.map +1 -1
- package/out/presets/rectCra.js +1 -1
- package/out/presets/rectCra.js.map +1 -1
- package/out/publish/BitbucketPublisher.js +5 -5
- package/out/publish/BitbucketPublisher.js.map +1 -1
- package/out/publish/KeygenPublisher.js +7 -7
- package/out/publish/KeygenPublisher.js.map +1 -1
- package/out/publish/PublishManager.d.ts +0 -1
- package/out/publish/PublishManager.js +24 -24
- package/out/publish/PublishManager.js.map +1 -1
- package/out/publish/SnapStorePublisher.js +1 -1
- package/out/publish/SnapStorePublisher.js.map +1 -1
- package/out/publish/s3/BaseS3Publisher.js +3 -3
- package/out/publish/s3/BaseS3Publisher.js.map +1 -1
- package/out/publish/s3/s3Publisher.js +1 -1
- package/out/publish/s3/s3Publisher.js.map +1 -1
- package/out/publish/s3/spacesPublisher.js +2 -2
- package/out/publish/s3/spacesPublisher.js.map +1 -1
- package/out/publish/updateInfoBuilder.js +9 -9
- package/out/publish/updateInfoBuilder.js.map +1 -1
- package/out/remoteBuilder/ProjectInfoManager.js +1 -1
- package/out/remoteBuilder/ProjectInfoManager.js.map +1 -1
- package/out/remoteBuilder/RemoteBuilder.js +3 -3
- package/out/remoteBuilder/RemoteBuilder.js.map +1 -1
- package/out/remoteBuilder/builder-cli.js +3 -3
- package/out/remoteBuilder/builder-cli.js.map +1 -1
- package/out/targets/AppImageTarget.js +6 -6
- package/out/targets/AppImageTarget.js.map +1 -1
- package/out/targets/AppxTarget.js +19 -19
- package/out/targets/AppxTarget.js.map +1 -1
- package/out/targets/ArchiveTarget.js +7 -7
- package/out/targets/ArchiveTarget.js.map +1 -1
- package/out/targets/FlatpakTarget.js +8 -8
- package/out/targets/FlatpakTarget.js.map +1 -1
- package/out/targets/LinuxTargetHelper.js +9 -9
- package/out/targets/LinuxTargetHelper.js.map +1 -1
- package/out/targets/MsiTarget.js +11 -11
- package/out/targets/MsiTarget.js.map +1 -1
- package/out/targets/archive.js +9 -9
- package/out/targets/archive.js.map +1 -1
- package/out/targets/differentialUpdateInfoBuilder.js +2 -2
- package/out/targets/differentialUpdateInfoBuilder.js.map +1 -1
- package/out/targets/fpm.js +17 -17
- package/out/targets/fpm.js.map +1 -1
- package/out/targets/nsis/NsisTarget.js +37 -37
- package/out/targets/nsis/NsisTarget.js.map +1 -1
- package/out/targets/nsis/WebInstallerTarget.js +2 -2
- package/out/targets/nsis/WebInstallerTarget.js.map +1 -1
- package/out/targets/nsis/nsisLang.js +5 -5
- package/out/targets/nsis/nsisLang.js.map +1 -1
- package/out/targets/nsis/nsisLicense.js +2 -2
- package/out/targets/nsis/nsisLicense.js.map +1 -1
- package/out/targets/nsis/nsisUtil.js +5 -5
- package/out/targets/nsis/nsisUtil.js.map +1 -1
- package/out/targets/pkg.js +17 -17
- package/out/targets/pkg.js.map +1 -1
- package/out/targets/snap.js +10 -10
- package/out/targets/snap.js.map +1 -1
- package/out/targets/targetFactory.js +4 -4
- package/out/targets/targetFactory.js.map +1 -1
- package/out/targets/tools.js +1 -1
- package/out/targets/tools.js.map +1 -1
- package/out/util/AppFileWalker.js +2 -2
- package/out/util/AppFileWalker.js.map +1 -1
- package/out/util/NodeModuleCopyHelper.js +3 -3
- package/out/util/NodeModuleCopyHelper.js.map +1 -1
- package/out/util/appBuilder.js +2 -2
- package/out/util/appBuilder.js.map +1 -1
- package/out/util/appFileCopier.d.ts +1 -0
- package/out/util/appFileCopier.js +9 -9
- package/out/util/appFileCopier.js.map +1 -1
- package/out/util/cacheManager.js +5 -5
- package/out/util/cacheManager.js.map +1 -1
- package/out/util/config.js +10 -10
- package/out/util/config.js.map +1 -1
- package/out/util/flags.js +2 -2
- package/out/util/flags.js.map +1 -1
- package/out/util/hash.js +2 -2
- package/out/util/hash.js.map +1 -1
- package/out/util/license.js +1 -1
- package/out/util/license.js.map +1 -1
- package/out/util/macosVersion.js +3 -3
- package/out/util/macosVersion.js.map +1 -1
- package/out/util/normalizePackageData.js +4 -4
- package/out/util/normalizePackageData.js.map +1 -1
- package/out/util/packageDependencies.js +1 -1
- package/out/util/packageDependencies.js.map +1 -1
- package/out/util/packageMetadata.js +5 -5
- package/out/util/packageMetadata.js.map +1 -1
- package/out/util/repositoryInfo.js +2 -2
- package/out/util/repositoryInfo.js.map +1 -1
- package/out/util/yarn.js +8 -6
- package/out/util/yarn.js.map +1 -1
- package/out/version.d.ts +1 -1
- package/out/version.js +1 -1
- package/out/version.js.map +1 -1
- package/out/vm/MonoVm.js +2 -2
- package/out/vm/MonoVm.js.map +1 -1
- package/out/vm/ParallelsVm.js +6 -6
- package/out/vm/ParallelsVm.js.map +1 -1
- package/out/vm/WineVm.js +1 -1
- package/out/vm/WineVm.js.map +1 -1
- package/out/vm/vm.js +2 -2
- package/out/vm/vm.js.map +1 -1
- package/out/winPackager.js +25 -25
- package/out/winPackager.js.map +1 -1
- package/out/wine.js +2 -2
- package/out/wine.js.map +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"windowsCodeSign.js","sourceRoot":"","sources":["../../src/codeSign/windowsCodeSign.ts"],"names":[],"mappings":";;;AAAA,gDAA+E;AAC/E,gDAAuC;AAEvC,mDAA4D;AAC5D,qDAA8D;AAC9D,uCAAiC;AACjC,yBAAwB;AACxB,6BAA4B;AAC5B,0DAAqD;AACrD,yCAAmD;AACnD,iCAAoC;AAGpC,SAAgB,iBAAiB;IAC/B,OAAO,oBAAM,CAAC,aAAa,CAAC,CAAA;AAC9B,CAAC;AAFD,8CAEC;AA0BM,KAAK,UAAU,IAAI,CAAC,OAA2B,EAAE,QAAqB;IAC3E,IAAI,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,qBAAqB,CAAA;IAClD,oCAAoC;IACpC,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,C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AE,cAAc,CAAC,UAAU,CAAC,EAAE,CAAA;KAC5C;SAAM,IAAI,OAAO,CAAC,QAAQ,KAAK,QAAQ,EAAE;QACxC,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;QACpE,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC;YAC5C,GAAG,EAAE,4BAAc,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC;SACrD,CAAA;KACF;SAAM;QACL,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,QAAQ,EAAE,cAAc,CAAC,EAAE,CAAA;KACzE;AACH,CAAC","sourcesContent":["import { InvalidConfigurationError, asArray, log } from \"builder-util/out/util\"\nimport { getBin } from \"../binDownload\"\nimport { WindowsConfiguration } from \"../options/winOptions\"\nimport { executeAppBuilderAsJson } from \"../util/appBuilder\"\nimport { computeToolEnv, ToolInfo } from \"../util/bundledTool\"\nimport { rename } from \"fs-extra\"\nimport * as os from \"os\"\nimport * as path from \"path\"\nimport { resolveFunction } from \"../platformPackager\"\nimport { isUseSystemSigncode } from \"../util/flags\"\nimport { VmManager } from \"../vm/vm\"\nimport { WinPackager } from \"../winPackager\"\n\nexport function getSignVendorPath() {\n return getBin(\"winCodeSign\")\n}\n\nexport type CustomWindowsSign = (configuration: CustomWindowsSignTaskConfiguration, packager?: WinPackager) => Promise<any>\n\nexport interface WindowsSignOptions {\n readonly path: string\n\n readonly name?: string | null\n readonly cscInfo?: FileCodeSigningInfo | CertificateFromStoreInfo | null\n readonly site?: string | null\n\n readonly options: WindowsConfiguration\n}\n\nexport interface WindowsSignTaskConfiguration extends WindowsSignOptions {\n // set if output path differs from input (e.g. osslsigncode cannot sign file in-place)\n resultOutputPath?: string\n\n hash: string\n isNest: boolean\n}\n\nexport interface CustomWindowsSignTaskConfiguration extends WindowsSignTaskConfiguration {\n computeSignToolArgs(isWin: boolean): Array<string>\n}\n\nexport async function sign(options: WindowsSignOptions, packager: WinPackager) {\n let hashes = options.options.signingHashAlgorithms\n // msi does not support dual-signing\n if (options.path.endsWith(\".msi\")) {\n hashes = [hashes != null && !hashes.includes(\"sha1\") ? \"sha256\" : \"sha1\"]\n } else if (options.path.endsWith(\".appx\")) {\n hashes = [\"sha256\"]\n } else if (hashes == null) {\n hashes = [\"sha1\", \"sha256\"]\n } else {\n hashes = Array.isArray(hashes) ? hashes : [hashes]\n }\n\n const executor = resolveFunction(options.options.sign, \"sign\") || doSign\n let isNest = false\n for (const hash of hashes) {\n const taskConfiguration: WindowsSignTaskConfiguration = { ...options, hash, isNest }\n await Promise.resolve(\n executor(\n {\n ...taskConfiguration,\n computeSignToolArgs: isWin => computeSignToolArgs(taskConfiguration, isWin),\n },\n packager\n )\n )\n isNest = true\n if (taskConfiguration.resultOutputPath != null) {\n await rename(taskConfiguration.resultOutputPath, options.path)\n }\n }\n}\n\nexport interface FileCodeSigningInfo {\n readonly file: string\n readonly password: string | null\n}\n\nexport async function getCertInfo(file: string, password: string): Promise<CertificateInfo> {\n let result: any = null\n const errorMessagePrefix = \"Cannot extract publisher name from code signing certificate. As workaround, set win.publisherName. Error: \"\n try {\n result = await executeAppBuilderAsJson<any>([\"certificate-info\", \"--input\", file, \"--password\", password])\n } catch (e) {\n throw new Error(`${errorMessagePrefix}${e.stack || e}`)\n }\n\n if (result.error != null) {\n // noinspection ExceptionCaughtLocallyJS\n throw new InvalidConfigurationError(`${errorMessagePrefix}${result.error}`)\n }\n return result\n}\n\nexport interface CertificateInfo {\n readonly commonName: string\n readonly bloodyMicrosoftSubjectDn: string\n}\n\nexport interface CertificateFromStoreInfo {\n thumbprint: string\n subject: string\n store: string\n isLocalMachineStore: boolean\n}\n\nexport async function getCertificateFromStoreInfo(options: WindowsConfiguration, vm: VmManager): Promise<CertificateFromStoreInfo> {\n const certificateSubjectName = options.certificateSubjectName\n const certificateSha1 = options.certificateSha1 ? options.certificateSha1.toUpperCase() : options.certificateSha1\n // ExcludeProperty doesn't work, so, we cannot exclude RawData, it is ok\n // powershell can return object if the only item\n const rawResult = await vm.exec(\"powershell.exe\", [\n \"-NoProfile\",\n \"-NonInteractive\",\n \"-Command\",\n \"Get-ChildItem -Recurse Cert: -CodeSigningCert | Select-Object -Property Subject,PSParentPath,Thumbprint | ConvertTo-Json -Compress\",\n ])\n const certList = rawResult.length === 0 ? [] : asArray<CertInfo>(JSON.parse(rawResult))\n for (const certInfo of certList) {\n if (\n (certificateSubjectName != null && !certInfo.Subject.includes(certificateSubjectName)) ||\n (certificateSha1 != null && certInfo.Thumbprint.toUpperCase() !== certificateSha1)\n ) {\n continue\n }\n\n const parentPath = certInfo.PSParentPath\n const store = parentPath.substring(parentPath.lastIndexOf(\"\\\\\") + 1)\n log.debug({ store, PSParentPath: parentPath }, \"auto-detect certificate store\")\n // https://github.com/electron-userland/electron-builder/issues/1717\n const isLocalMachineStore = parentPath.includes(\"Certificate::LocalMachine\")\n log.debug(null, \"auto-detect using of LocalMachine store\")\n return {\n thumbprint: certInfo.Thumbprint,\n subject: certInfo.Subject,\n store,\n isLocalMachineStore,\n }\n }\n\n throw new Error(`Cannot find certificate ${certificateSubjectName || certificateSha1}, all certs: ${rawResult}`)\n}\n\nexport async function doSign(configuration: CustomWindowsSignTaskConfiguration, packager: WinPackager) {\n // https://github.com/electron-userland/electron-builder/pull/1944\n const timeout = parseInt(process.env.SIGNTOOL_TIMEOUT as any, 10) || 10 * 60 * 1000\n // unify logic of signtool path location\n const toolInfo = await getToolPath()\n const tool = toolInfo.path\n // decide runtime argument by cases\n let args: Array<string>\n let env = process.env\n let vm: VmManager\n if (configuration.path.endsWith(\".appx\") || !(\"file\" in configuration.cscInfo!) /* certificateSubjectName and other such options */) {\n vm = await packager.vm.value\n args = computeSignToolArgs(configuration, true, vm)\n } else {\n vm = new VmManager()\n args = configuration.computeSignToolArgs(process.platform === \"win32\")\n if (toolInfo.env != null) {\n env = toolInfo.env\n }\n }\n\n try {\n await vm.exec(tool, args, { timeout, env })\n } catch (e) {\n if (e.message.includes(\"The file is being used by another process\") || e.message.includes(\"The specified timestamp server either could not be reached\")) {\n log.warn(`First attempt to code sign failed, another attempt will be made in 15 seconds: ${e.message}`)\n await new Promise((resolve, reject) => {\n setTimeout(() => {\n vm.exec(tool, args, { timeout, env }).then(resolve).catch(reject)\n }, 15000)\n })\n }\n throw e\n }\n}\n\ninterface CertInfo {\n Subject: string\n Thumbprint: string\n PSParentPath: string\n}\n\n// on windows be aware of http://stackoverflow.com/a/32640183/1910191\nfunction computeSignToolArgs(options: WindowsSignTaskConfiguration, isWin: boolean, vm: VmManager = new VmManager()): Array<string> {\n const inputFile = vm.toVmFile(options.path)\n const outputPath = isWin ? inputFile : getOutputPath(inputFile, options.hash)\n if (!isWin) {\n options.resultOutputPath = outputPath\n }\n\n const args = isWin ? [\"sign\"] : [\"-in\", inputFile, \"-out\", outputPath]\n\n if (process.env.ELECTRON_BUILDER_OFFLINE !== \"true\") {\n const timestampingServiceUrl = options.options.timeStampServer || \"http://timestamp.digicert.com\"\n if (isWin) {\n args.push(\n options.isNest || options.hash === \"sha256\" ? \"/tr\" : \"/t\",\n options.isNest || options.hash === \"sha256\" ? options.options.rfc3161TimeStampServer || \"http://timestamp.digicert.com\" : timestampingServiceUrl\n )\n } else {\n args.push(\"-t\", timestampingServiceUrl)\n }\n }\n\n const certificateFile = (options.cscInfo as FileCodeSigningInfo).file\n if (certificateFile == null) {\n const cscInfo = options.cscInfo as CertificateFromStoreInfo\n const subjectName = cscInfo.thumbprint\n if (!isWin) {\n throw new Error(`${subjectName == null ? \"certificateSha1\" : \"certificateSubjectName\"} supported only on Windows`)\n }\n\n args.push(\"/sha1\", cscInfo.thumbprint)\n args.push(\"/s\", cscInfo.store)\n if (cscInfo.isLocalMachineStore) {\n args.push(\"/sm\")\n }\n } else {\n const certExtension = path.extname(certificateFile)\n if (certExtension === \".p12\" || certExtension === \".pfx\") {\n args.push(isWin ? \"/f\" : \"-pkcs12\", vm.toVmFile(certificateFile))\n } else {\n throw new Error(`Please specify pkcs12 (.p12/.pfx) file, ${certificateFile} is not correct`)\n }\n }\n\n if (!isWin || options.hash !== \"sha1\") {\n args.push(isWin ? \"/fd\" : \"-h\", options.hash)\n if (isWin && process.env.ELECTRON_BUILDER_OFFLINE !== \"true\") {\n args.push(\"/td\", \"sha256\")\n }\n }\n\n if (options.name) {\n args.push(isWin ? \"/d\" : \"-n\", options.name)\n }\n\n if (options.site) {\n args.push(isWin ? \"/du\" : \"-i\", options.site)\n }\n\n // msi does not support dual-signing\n if (options.isNest) {\n args.push(isWin ? \"/as\" : \"-nest\")\n }\n\n const password = options.cscInfo == null ? null : (options.cscInfo as FileCodeSigningInfo).password\n if (password) {\n args.push(isWin ? \"/p\" : \"-pass\", password)\n }\n\n if (options.options.additionalCertificateFile) {\n args.push(isWin ? \"/ac\" : \"-ac\", vm.toVmFile(options.options.additionalCertificateFile))\n }\n\n const httpsProxyFromEnv = process.env.HTTPS_PROXY\n if (!isWin && httpsProxyFromEnv != null && httpsProxyFromEnv.length) {\n args.push(\"-p\", httpsProxyFromEnv)\n }\n\n if (isWin) {\n // https://github.com/electron-userland/electron-builder/issues/2875#issuecomment-387233610\n args.push(\"/debug\")\n // must be last argument\n args.push(inputFile)\n }\n\n return args\n}\n\nfunction getOutputPath(inputPath: string, hash: string) {\n const extension = path.extname(inputPath)\n return path.join(path.dirname(inputPath), `${path.basename(inputPath, extension)}-signed-${hash}${extension}`)\n}\n\n/** @internal */\nexport function isOldWin6() {\n const winVersion = os.release()\n return winVersion.startsWith(\"6.\") && !winVersion.startsWith(\"6.3\")\n}\n\nfunction getWinSignTool(vendorPath: string): string {\n // use modern signtool on Windows Server 2012 R2 to be able to sign AppX\n if (isOldWin6()) {\n return path.join(vendorPath, \"windows-6\", \"signtool.exe\")\n } else {\n return path.join(vendorPath, \"windows-10\", process.arch, \"signtool.exe\")\n }\n}\n\nasync function getToolPath(): Promise<ToolInfo> {\n if (isUseSystemSigncode()) {\n return { path: \"osslsigncode\" }\n }\n\n const result = process.env.SIGNTOOL_PATH\n if (result) {\n return { path: result }\n }\n\n const vendorPath = await getSignVendorPath()\n if (process.platform === \"win32\") {\n // use modern signtool on Windows Server 2012 R2 to be able to sign AppX\n return { path: getWinSignTool(vendorPath) }\n } else if (process.platform === \"darwin\") {\n const toolDirPath = path.join(vendorPath, process.platform, \"10.12\")\n return {\n path: path.join(toolDirPath, \"osslsigncode\"),\n env: computeToolEnv([path.join(toolDirPath, \"lib\")]),\n }\n } else {\n return { path: path.join(vendorPath, process.platform, \"osslsigncode\") }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"windowsCodeSign.js","sourceRoot":"","sources":["../../src/codeSign/windowsCodeSign.ts"],"names":[],"mappings":";;;AAAA,gDAA+E;AAC/E,gDAAuC;AAEvC,mDAA4D;AAC5D,qDAA8D;AAC9D,uCAAiC;AACjC,yBAAwB;AACxB,6BAA4B;AAC5B,0DAAqD;AACrD,yCAAmD;AACnD,iCAAoC;AAGpC,SAAgB,iBAAiB;IAC/B,OAAO,IAAA,oBAAM,EAAC,aAAa,CAAC,CAAA;AAC9B,CAAC;AAFD,8CAEC;AA0BM,KAAK,UAAU,IAAI,CAAC,OAA2B,EAAE,QAAqB;IAC3E,IAAI,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,qBAAqB,CAAA;IAClD,oCAAoC;IACpC,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;QACjC,MAAM,GAAG,CAAC,MAAM,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;KAC1E;SAAM,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CA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O;YACL,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC;YAC5C,GAAG,EAAE,IAAA,4BAAc,EAAC,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC;SACrD,CAAA;KACF;SAAM;QACL,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,QAAQ,EAAE,cAAc,CAAC,EAAE,CAAA;KACzE;AACH,CAAC","sourcesContent":["import { InvalidConfigurationError, asArray, log } from \"builder-util/out/util\"\nimport { getBin } from \"../binDownload\"\nimport { WindowsConfiguration } from \"../options/winOptions\"\nimport { executeAppBuilderAsJson } from \"../util/appBuilder\"\nimport { computeToolEnv, ToolInfo } from \"../util/bundledTool\"\nimport { rename } from \"fs-extra\"\nimport * as os from \"os\"\nimport * as path from \"path\"\nimport { resolveFunction } from \"../platformPackager\"\nimport { isUseSystemSigncode } from \"../util/flags\"\nimport { VmManager } from \"../vm/vm\"\nimport { WinPackager } from \"../winPackager\"\n\nexport function getSignVendorPath() {\n return getBin(\"winCodeSign\")\n}\n\nexport type CustomWindowsSign = (configuration: CustomWindowsSignTaskConfiguration, packager?: WinPackager) => Promise<any>\n\nexport interface WindowsSignOptions {\n readonly path: string\n\n readonly name?: string | null\n readonly cscInfo?: FileCodeSigningInfo | CertificateFromStoreInfo | null\n readonly site?: string | null\n\n readonly options: WindowsConfiguration\n}\n\nexport interface WindowsSignTaskConfiguration extends WindowsSignOptions {\n // set if output path differs from input (e.g. osslsigncode cannot sign file in-place)\n resultOutputPath?: string\n\n hash: string\n isNest: boolean\n}\n\nexport interface CustomWindowsSignTaskConfiguration extends WindowsSignTaskConfiguration {\n computeSignToolArgs(isWin: boolean): Array<string>\n}\n\nexport async function sign(options: WindowsSignOptions, packager: WinPackager) {\n let hashes = options.options.signingHashAlgorithms\n // msi does not support dual-signing\n if (options.path.endsWith(\".msi\")) {\n hashes = [hashes != null && !hashes.includes(\"sha1\") ? \"sha256\" : \"sha1\"]\n } else if (options.path.endsWith(\".appx\")) {\n hashes = [\"sha256\"]\n } else if (hashes == null) {\n hashes = [\"sha1\", \"sha256\"]\n } else {\n hashes = Array.isArray(hashes) ? hashes : [hashes]\n }\n\n const executor = resolveFunction(options.options.sign, \"sign\") || doSign\n let isNest = false\n for (const hash of hashes) {\n const taskConfiguration: WindowsSignTaskConfiguration = { ...options, hash, isNest }\n await Promise.resolve(\n executor(\n {\n ...taskConfiguration,\n computeSignToolArgs: isWin => computeSignToolArgs(taskConfiguration, isWin),\n },\n packager\n )\n )\n isNest = true\n if (taskConfiguration.resultOutputPath != null) {\n await rename(taskConfiguration.resultOutputPath, options.path)\n }\n }\n}\n\nexport interface FileCodeSigningInfo {\n readonly file: string\n readonly password: string | null\n}\n\nexport async function getCertInfo(file: string, password: string): Promise<CertificateInfo> {\n let result: any = null\n const errorMessagePrefix = \"Cannot extract publisher name from code signing certificate. As workaround, set win.publisherName. Error: \"\n try {\n result = await executeAppBuilderAsJson<any>([\"certificate-info\", \"--input\", file, \"--password\", password])\n } catch (e: any) {\n throw new Error(`${errorMessagePrefix}${e.stack || e}`)\n }\n\n if (result.error != null) {\n // noinspection ExceptionCaughtLocallyJS\n throw new InvalidConfigurationError(`${errorMessagePrefix}${result.error}`)\n }\n return result\n}\n\nexport interface CertificateInfo {\n readonly commonName: string\n readonly bloodyMicrosoftSubjectDn: string\n}\n\nexport interface CertificateFromStoreInfo {\n thumbprint: string\n subject: string\n store: string\n isLocalMachineStore: boolean\n}\n\nexport async function getCertificateFromStoreInfo(options: WindowsConfiguration, vm: VmManager): Promise<CertificateFromStoreInfo> {\n const certificateSubjectName = options.certificateSubjectName\n const certificateSha1 = options.certificateSha1 ? options.certificateSha1.toUpperCase() : options.certificateSha1\n // ExcludeProperty doesn't work, so, we cannot exclude RawData, it is ok\n // powershell can return object if the only item\n const rawResult = await vm.exec(\"powershell.exe\", [\n \"-NoProfile\",\n \"-NonInteractive\",\n \"-Command\",\n \"Get-ChildItem -Recurse Cert: -CodeSigningCert | Select-Object -Property Subject,PSParentPath,Thumbprint | ConvertTo-Json -Compress\",\n ])\n const certList = rawResult.length === 0 ? [] : asArray<CertInfo>(JSON.parse(rawResult))\n for (const certInfo of certList) {\n if (\n (certificateSubjectName != null && !certInfo.Subject.includes(certificateSubjectName)) ||\n (certificateSha1 != null && certInfo.Thumbprint.toUpperCase() !== certificateSha1)\n ) {\n continue\n }\n\n const parentPath = certInfo.PSParentPath\n const store = parentPath.substring(parentPath.lastIndexOf(\"\\\\\") + 1)\n log.debug({ store, PSParentPath: parentPath }, \"auto-detect certificate store\")\n // https://github.com/electron-userland/electron-builder/issues/1717\n const isLocalMachineStore = parentPath.includes(\"Certificate::LocalMachine\")\n log.debug(null, \"auto-detect using of LocalMachine store\")\n return {\n thumbprint: certInfo.Thumbprint,\n subject: certInfo.Subject,\n store,\n isLocalMachineStore,\n }\n }\n\n throw new Error(`Cannot find certificate ${certificateSubjectName || certificateSha1}, all certs: ${rawResult}`)\n}\n\nexport async function doSign(configuration: CustomWindowsSignTaskConfiguration, packager: WinPackager) {\n // https://github.com/electron-userland/electron-builder/pull/1944\n const timeout = parseInt(process.env.SIGNTOOL_TIMEOUT as any, 10) || 10 * 60 * 1000\n // unify logic of signtool path location\n const toolInfo = await getToolPath()\n const tool = toolInfo.path\n // decide runtime argument by cases\n let args: Array<string>\n let env = process.env\n let vm: VmManager\n if (configuration.path.endsWith(\".appx\") || !(\"file\" in configuration.cscInfo!) /* certificateSubjectName and other such options */) {\n vm = await packager.vm.value\n args = computeSignToolArgs(configuration, true, vm)\n } else {\n vm = new VmManager()\n args = configuration.computeSignToolArgs(process.platform === \"win32\")\n if (toolInfo.env != null) {\n env = toolInfo.env\n }\n }\n\n try {\n await vm.exec(tool, args, { timeout, env })\n } catch (e: any) {\n if (e.message.includes(\"The file is being used by another process\") || e.message.includes(\"The specified timestamp server either could not be reached\")) {\n log.warn(`First attempt to code sign failed, another attempt will be made in 15 seconds: ${e.message}`)\n await new Promise((resolve, reject) => {\n setTimeout(() => {\n vm.exec(tool, args, { timeout, env }).then(resolve).catch(reject)\n }, 15000)\n })\n }\n throw e\n }\n}\n\ninterface CertInfo {\n Subject: string\n Thumbprint: string\n PSParentPath: string\n}\n\n// on windows be aware of http://stackoverflow.com/a/32640183/1910191\nfunction computeSignToolArgs(options: WindowsSignTaskConfiguration, isWin: boolean, vm: VmManager = new VmManager()): Array<string> {\n const inputFile = vm.toVmFile(options.path)\n const outputPath = isWin ? inputFile : getOutputPath(inputFile, options.hash)\n if (!isWin) {\n options.resultOutputPath = outputPath\n }\n\n const args = isWin ? [\"sign\"] : [\"-in\", inputFile, \"-out\", outputPath]\n\n if (process.env.ELECTRON_BUILDER_OFFLINE !== \"true\") {\n const timestampingServiceUrl = options.options.timeStampServer || \"http://timestamp.digicert.com\"\n if (isWin) {\n args.push(\n options.isNest || options.hash === \"sha256\" ? \"/tr\" : \"/t\",\n options.isNest || options.hash === \"sha256\" ? options.options.rfc3161TimeStampServer || \"http://timestamp.digicert.com\" : timestampingServiceUrl\n )\n } else {\n args.push(\"-t\", timestampingServiceUrl)\n }\n }\n\n const certificateFile = (options.cscInfo as FileCodeSigningInfo).file\n if (certificateFile == null) {\n const cscInfo = options.cscInfo as CertificateFromStoreInfo\n const subjectName = cscInfo.thumbprint\n if (!isWin) {\n throw new Error(`${subjectName == null ? \"certificateSha1\" : \"certificateSubjectName\"} supported only on Windows`)\n }\n\n args.push(\"/sha1\", cscInfo.thumbprint)\n args.push(\"/s\", cscInfo.store)\n if (cscInfo.isLocalMachineStore) {\n args.push(\"/sm\")\n }\n } else {\n const certExtension = path.extname(certificateFile)\n if (certExtension === \".p12\" || certExtension === \".pfx\") {\n args.push(isWin ? \"/f\" : \"-pkcs12\", vm.toVmFile(certificateFile))\n } else {\n throw new Error(`Please specify pkcs12 (.p12/.pfx) file, ${certificateFile} is not correct`)\n }\n }\n\n if (!isWin || options.hash !== \"sha1\") {\n args.push(isWin ? \"/fd\" : \"-h\", options.hash)\n if (isWin && process.env.ELECTRON_BUILDER_OFFLINE !== \"true\") {\n args.push(\"/td\", \"sha256\")\n }\n }\n\n if (options.name) {\n args.push(isWin ? \"/d\" : \"-n\", options.name)\n }\n\n if (options.site) {\n args.push(isWin ? \"/du\" : \"-i\", options.site)\n }\n\n // msi does not support dual-signing\n if (options.isNest) {\n args.push(isWin ? \"/as\" : \"-nest\")\n }\n\n const password = options.cscInfo == null ? null : (options.cscInfo as FileCodeSigningInfo).password\n if (password) {\n args.push(isWin ? \"/p\" : \"-pass\", password)\n }\n\n if (options.options.additionalCertificateFile) {\n args.push(isWin ? \"/ac\" : \"-ac\", vm.toVmFile(options.options.additionalCertificateFile))\n }\n\n const httpsProxyFromEnv = process.env.HTTPS_PROXY\n if (!isWin && httpsProxyFromEnv != null && httpsProxyFromEnv.length) {\n args.push(\"-p\", httpsProxyFromEnv)\n }\n\n if (isWin) {\n // https://github.com/electron-userland/electron-builder/issues/2875#issuecomment-387233610\n args.push(\"/debug\")\n // must be last argument\n args.push(inputFile)\n }\n\n return args\n}\n\nfunction getOutputPath(inputPath: string, hash: string) {\n const extension = path.extname(inputPath)\n return path.join(path.dirname(inputPath), `${path.basename(inputPath, extension)}-signed-${hash}${extension}`)\n}\n\n/** @internal */\nexport function isOldWin6() {\n const winVersion = os.release()\n return winVersion.startsWith(\"6.\") && !winVersion.startsWith(\"6.3\")\n}\n\nfunction getWinSignTool(vendorPath: string): string {\n // use modern signtool on Windows Server 2012 R2 to be able to sign AppX\n if (isOldWin6()) {\n return path.join(vendorPath, \"windows-6\", \"signtool.exe\")\n } else {\n return path.join(vendorPath, \"windows-10\", process.arch, \"signtool.exe\")\n }\n}\n\nasync function getToolPath(): Promise<ToolInfo> {\n if (isUseSystemSigncode()) {\n return { path: \"osslsigncode\" }\n }\n\n const result = process.env.SIGNTOOL_PATH\n if (result) {\n return { path: result }\n }\n\n const vendorPath = await getSignVendorPath()\n if (process.platform === \"win32\") {\n // use modern signtool on Windows Server 2012 R2 to be able to sign AppX\n return { path: getWinSignTool(vendorPath) }\n } else if (process.platform === \"darwin\") {\n const toolDirPath = path.join(vendorPath, process.platform, \"10.12\")\n return {\n path: path.join(toolDirPath, \"osslsigncode\"),\n env: computeToolEnv([path.join(toolDirPath, \"lib\")]),\n }\n } else {\n return { path: path.join(vendorPath, process.platform, \"osslsigncode\") }\n }\n}\n"]}
|
package/out/core.js
CHANGED
|
@@ -16,7 +16,7 @@ class Platform {
|
|
|
16
16
|
return new Map([[this, new Map()]]);
|
|
17
17
|
}
|
|
18
18
|
const archToType = new Map();
|
|
19
|
-
for (const arch of archs == null || archs.length === 0 ? [builder_util_1.archFromString(process.arch)] : archs) {
|
|
19
|
+
for (const arch of archs == null || archs.length === 0 ? [(0, builder_util_1.archFromString)(process.arch)] : archs) {
|
|
20
20
|
archToType.set(arch, type == null ? [] : Array.isArray(type) ? type : [type]);
|
|
21
21
|
}
|
|
22
22
|
return new Map([[this, archToType]]);
|
package/out/core.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":";;;AAAA,+CAA6D;AAoB7D,MAAa,QAAQ;IAKnB,YAAmB,IAAY,EAAS,qBAA6B,EAAS,QAAyB;QAApF,SAAI,GAAJ,IAAI,CAAQ;QAAS,0BAAqB,GAArB,qBAAqB,CAAQ;QAAS,aAAQ,GAAR,QAAQ,CAAiB;IAAG,CAAC;IAE3G,QAAQ;QACN,OAAO,IAAI,CAAC,IAAI,CAAA;IAClB,CAAC;IAED,YAAY,CAAC,IAAoC,EAAE,GAAG,KAAkB;QACtE,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,EAAE;YACzD,OAAO,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,GAAG,EAAE,CAAC,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QAChB,SAAS;IACX,CAAC;IAID,WAAW;QACT,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;IAC1B,CAAC;CACF;AAfD,wBAeC;AAWY,QAAA,cAAc,GAAG,SAAS,CAAA;AAC1B,QAAA,UAAU,GAAG,KAAK,CAAA","sourcesContent":["import { Arch, archFromString, ArchType } from \"builder-util\"\nimport { AllPublishOptions } from \"builder-util-runtime\"\n\n// https://github.com/YousefED/typescript-json-schema/issues/80\nexport type Publish = AllPublishOptions | Array<AllPublishOptions> | null\n\nexport type TargetConfigType = Array<string | TargetConfiguration> | string | TargetConfiguration | null\n\nexport interface TargetConfiguration {\n /**\n * The target name. e.g. `snap`.\n */\n readonly target: string\n\n /**\n * The arch or list of archs.\n */\n readonly arch?: Array<ArchType> | ArchType\n}\n\nexport class Platform {\n static MAC = new Platform(\"mac\", \"mac\", \"darwin\")\n static LINUX = new Platform(\"linux\", \"linux\", \"linux\")\n static WINDOWS = new Platform(\"windows\", \"win\", \"win32\")\n\n constructor(public name: string, public buildConfigurationKey: string, public nodeName: NodeJS.Platform) {}\n\n toString() {\n return this.name\n }\n\n createTarget(type?: string | Array<string> | null, ...archs: Array<Arch>): Map<Platform, Map<Arch, Array<string>>> {\n if (type == null && (archs == null || archs.length === 0)) {\n return new Map([[this, new Map()]])\n }\n\n const archToType = new Map()\n\n for (const arch of archs == null || archs.length === 0 ? [archFromString(process.arch)] : archs) {\n archToType.set(arch, type == null ? [] : Array.isArray(type) ? type : [type])\n }\n return new Map([[this, archToType]])\n }\n\n static current(): Platform {\n return Platform.fromString(process.platform)\n }\n\n static fromString(name: string): Platform {\n name = name.toLowerCase()\n switch (name) {\n case Platform.MAC.nodeName:\n case Platform.MAC.name:\n return Platform.MAC\n\n case Platform.WINDOWS.nodeName:\n case Platform.WINDOWS.name:\n case Platform.WINDOWS.buildConfigurationKey:\n return Platform.WINDOWS\n\n case Platform.LINUX.nodeName:\n return Platform.LINUX\n\n default:\n throw new Error(`Unknown platform: ${name}`)\n }\n }\n}\n\nexport abstract class Target {\n abstract readonly outDir: string\n abstract readonly options: TargetSpecificOptions | null | undefined\n\n protected constructor(readonly name: string, readonly isAsyncSupported: boolean = true) {}\n\n async checkOptions(): Promise<any> {\n // ignore\n }\n\n abstract build(appOutDir: string, arch: Arch): Promise<any>\n\n finishBuild(): Promise<any> {\n return Promise.resolve()\n }\n}\n\nexport interface TargetSpecificOptions {\n /**\n The [artifact file name template](/configuration/configuration#artifact-file-name-template).\n */\n readonly artifactName?: string | null\n\n publish?: Publish\n}\n\nexport const DEFAULT_TARGET = \"default\"\nexport const DIR_TARGET = \"dir\"\n\nexport type CompressionLevel = \"store\" | \"normal\" | \"maximum\"\n\nexport interface BeforeBuildContext {\n readonly appDir: string\n readonly electronVersion: string\n readonly platform: Platform\n readonly arch: string\n}\n\nexport interface SourceRepositoryInfo {\n type?: string\n domain?: string\n user: string\n project: string\n}\n"]}
|
|
@@ -34,26 +34,26 @@ async function beforeCopyExtraFiles(options) {
|
|
|
34
34
|
const appOutDir = options.appOutDir;
|
|
35
35
|
const electronBranding = createBrandingOpts(packager.config);
|
|
36
36
|
if (packager.platform === index_1.Platform.LINUX) {
|
|
37
|
-
if (!platformPackager_1.isSafeToUnpackElectronOnRemoteBuildServer(packager)) {
|
|
37
|
+
if (!(0, platformPackager_1.isSafeToUnpackElectronOnRemoteBuildServer)(packager)) {
|
|
38
38
|
const linuxPackager = packager;
|
|
39
39
|
const executable = path.join(appOutDir, linuxPackager.executableName);
|
|
40
|
-
await fs_extra_1.rename(path.join(appOutDir, electronBranding.projectName), executable);
|
|
40
|
+
await (0, fs_extra_1.rename)(path.join(appOutDir, electronBranding.projectName), executable);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
else if (packager.platform === index_1.Platform.WINDOWS) {
|
|
44
44
|
const executable = path.join(appOutDir, `${packager.appInfo.productFilename}.exe`);
|
|
45
|
-
await fs_extra_1.rename(path.join(appOutDir, `${electronBranding.projectName}.exe`), executable);
|
|
45
|
+
await (0, fs_extra_1.rename)(path.join(appOutDir, `${electronBranding.projectName}.exe`), executable);
|
|
46
46
|
}
|
|
47
47
|
else {
|
|
48
|
-
await electronMac_1.createMacApp(packager, appOutDir, options.asarIntegrity, options.platformName === "mas");
|
|
49
|
-
const wantedLanguages = builder_util_1.asArray(packager.platformSpecificBuildOptions.electronLanguages);
|
|
48
|
+
await (0, electronMac_1.createMacApp)(packager, appOutDir, options.asarIntegrity, options.platformName === "mas");
|
|
49
|
+
const wantedLanguages = (0, builder_util_1.asArray)(packager.platformSpecificBuildOptions.electronLanguages);
|
|
50
50
|
if (wantedLanguages.length === 0) {
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
53
|
// noinspection SpellCheckingInspection
|
|
54
54
|
const langFileExt = ".lproj";
|
|
55
55
|
const resourcesDir = packager.getResourcesDir(appOutDir);
|
|
56
|
-
await bluebird_lst_1.default.map(fs_extra_1.readdir(resourcesDir), file => {
|
|
56
|
+
await bluebird_lst_1.default.map((0, fs_extra_1.readdir)(resourcesDir), file => {
|
|
57
57
|
if (!file.endsWith(langFileExt)) {
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
@@ -81,7 +81,7 @@ class ElectronFramework {
|
|
|
81
81
|
}
|
|
82
82
|
getDefaultIcon(platform) {
|
|
83
83
|
if (platform === index_1.Platform.LINUX) {
|
|
84
|
-
return path.join(pathManager_1.getTemplatePath("icons"), "electron-linux");
|
|
84
|
+
return path.join((0, pathManager_1.getTemplatePath)("icons"), "electron-linux");
|
|
85
85
|
}
|
|
86
86
|
else {
|
|
87
87
|
// default icon is embedded into app skeleton
|
|
@@ -100,13 +100,13 @@ async function createElectronFrameworkSupport(configuration, packager) {
|
|
|
100
100
|
if (version == null) {
|
|
101
101
|
// for prepacked app asar no dev deps in the app.asar
|
|
102
102
|
if (packager.isPrepackedAppAsar) {
|
|
103
|
-
version = await electronVersion_1.getElectronVersionFromInstalled(packager.projectDir);
|
|
103
|
+
version = await (0, electronVersion_1.getElectronVersionFromInstalled)(packager.projectDir);
|
|
104
104
|
if (version == null) {
|
|
105
105
|
throw new Error(`Cannot compute electron version for prepacked asar`);
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
else {
|
|
109
|
-
version = await electronVersion_1.computeElectronVersion(packager.projectDir, new lazy_val_1.Lazy(() => Promise.resolve(packager.metadata)));
|
|
109
|
+
version = await (0, electronVersion_1.computeElectronVersion)(packager.projectDir, new lazy_val_1.Lazy(() => Promise.resolve(packager.metadata)));
|
|
110
110
|
}
|
|
111
111
|
configuration.electronVersion = version;
|
|
112
112
|
}
|
|
@@ -121,7 +121,7 @@ async function unpack(prepareOptions, options, distMacOsAppName) {
|
|
|
121
121
|
if (dist != null) {
|
|
122
122
|
const zipFile = `electron-v${options.version}-${platformName}-${options.arch}.zip`;
|
|
123
123
|
const resolvedDist = path.isAbsolute(dist) ? dist : path.resolve(packager.projectDir, dist);
|
|
124
|
-
if ((await fs_1.statOrNull(path.join(resolvedDist, zipFile))) != null) {
|
|
124
|
+
if ((await (0, fs_1.statOrNull)(path.join(resolvedDist, zipFile))) != null) {
|
|
125
125
|
builder_util_1.log.info({ resolvedDist, zipFile }, "Resolved electronDist");
|
|
126
126
|
options.cache = resolvedDist;
|
|
127
127
|
dist = null;
|
|
@@ -129,18 +129,18 @@ async function unpack(prepareOptions, options, distMacOsAppName) {
|
|
|
129
129
|
}
|
|
130
130
|
let isFullCleanup = false;
|
|
131
131
|
if (dist == null) {
|
|
132
|
-
if (platformPackager_1.isSafeToUnpackElectronOnRemoteBuildServer(packager)) {
|
|
132
|
+
if ((0, platformPackager_1.isSafeToUnpackElectronOnRemoteBuildServer)(packager)) {
|
|
133
133
|
return;
|
|
134
134
|
}
|
|
135
|
-
await builder_util_1.executeAppBuilder(["unpack-electron", "--configuration", JSON.stringify([options]), "--output", appOutDir, "--distMacOsAppName", distMacOsAppName]);
|
|
135
|
+
await (0, builder_util_1.executeAppBuilder)(["unpack-electron", "--configuration", JSON.stringify([options]), "--output", appOutDir, "--distMacOsAppName", distMacOsAppName]);
|
|
136
136
|
}
|
|
137
137
|
else {
|
|
138
138
|
isFullCleanup = true;
|
|
139
139
|
const source = packager.getElectronSrcDir(dist);
|
|
140
140
|
const destination = packager.getElectronDestinationDir(appOutDir);
|
|
141
141
|
builder_util_1.log.info({ source, destination }, "copying Electron");
|
|
142
|
-
await fs_extra_1.emptyDir(appOutDir);
|
|
143
|
-
await fs_1.copyDir(source, destination, {
|
|
142
|
+
await (0, fs_extra_1.emptyDir)(appOutDir);
|
|
143
|
+
await (0, fs_1.copyDir)(source, destination, {
|
|
144
144
|
isUseHardLink: fs_1.DO_NOT_USE_HARD_LINKS,
|
|
145
145
|
});
|
|
146
146
|
}
|
|
@@ -151,11 +151,11 @@ function cleanupAfterUnpack(prepareOptions, distMacOsAppName, isFullCleanup) {
|
|
|
151
151
|
const isMac = prepareOptions.packager.platform === index_1.Platform.MAC;
|
|
152
152
|
const resourcesPath = isMac ? path.join(out, distMacOsAppName, "Contents", "Resources") : path.join(out, "resources");
|
|
153
153
|
return Promise.all([
|
|
154
|
-
isFullCleanup ? fs_1.unlinkIfExists(path.join(resourcesPath, "default_app.asar")) : Promise.resolve(),
|
|
155
|
-
isFullCleanup ? fs_1.unlinkIfExists(path.join(out, "version")) : Promise.resolve(),
|
|
154
|
+
isFullCleanup ? (0, fs_1.unlinkIfExists)(path.join(resourcesPath, "default_app.asar")) : Promise.resolve(),
|
|
155
|
+
isFullCleanup ? (0, fs_1.unlinkIfExists)(path.join(out, "version")) : Promise.resolve(),
|
|
156
156
|
isMac
|
|
157
157
|
? Promise.resolve()
|
|
158
|
-
: fs_extra_1.rename(path.join(out, "LICENSE"), path.join(out, "LICENSE.electron.txt")).catch(() => {
|
|
158
|
+
: (0, fs_extra_1.rename)(path.join(out, "LICENSE"), path.join(out, "LICENSE.electron.txt")).catch(() => {
|
|
159
159
|
/* ignore */
|
|
160
160
|
}),
|
|
161
161
|
]);
|
|
@@ -1 +1 @@
|
|
|
1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,QAAQ,CAAC,QAAQ,KAAK,gBAAQ,CAAC,GAAG,CAAA;IAC/D,MAAM,aAAa,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,gBAAgB,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,WAAW,CAAC,CAAA;IAErH,OAAO,OAAO,CAAC,GAAG,CAAC;QACjB,aAAa,CAAC,CAAC,CAAC,mBAAc,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE;QAChG,aAAa,CAAC,CAAC,CAAC,mBAAc,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE;QAC7E,KAAK;YACH,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE;YACnB,CAAC,CAAC,iBAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,sBAAsB,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE;gBACnF,YAAY;YACd,CAAC,CAAC;KACP,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import BluebirdPromise from \"bluebird-lst\"\nimport { asArray, executeAppBuilder, log } from \"builder-util\"\nimport { CONCURRENCY, copyDir, DO_NOT_USE_HARD_LINKS, statOrNull, unlinkIfExists } from \"builder-util/out/fs\"\nimport { emptyDir, readdir, rename } from \"fs-extra\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { Configuration } from \"../configuration\"\nimport { BeforeCopyExtraFilesOptions, Framework, PrepareApplicationStageDirectoryOptions } from \"../Framework\"\nimport { Packager, Platform } from \"../index\"\nimport { LinuxPackager } from \"../linuxPackager\"\nimport MacPackager from \"../macPackager\"\nimport { isSafeToUnpackElectronOnRemoteBuildServer } from \"../platformPackager\"\nimport { getTemplatePath } from \"../util/pathManager\"\nimport { createMacApp } from \"./electronMac\"\nimport { computeElectronVersion, getElectronVersionFromInstalled } from \"./electronVersion\"\nimport * as fs from \"fs/promises\"\n\nexport type ElectronPlatformName = \"darwin\" | \"linux\" | \"win32\" | \"mas\"\n\n/**\n * Electron distributables branding options.\n * @see [Electron BRANDING.json](https://github.com/electron/electron/blob/master/shell/app/BRANDING.json).\n */\nexport interface ElectronBrandingOptions {\n projectName?: string\n productName?: string\n}\n\nexport function createBrandingOpts(opts: Configuration): Required<ElectronBrandingOptions> {\n return {\n projectName: opts.electronBranding?.projectName || \"electron\",\n productName: opts.electronBranding?.productName || \"Electron\",\n }\n}\n\nexport interface ElectronDownloadOptions {\n // https://github.com/electron-userland/electron-builder/issues/3077\n // must be optional\n version?: string\n\n /**\n * The [cache location](https://github.com/electron-userland/electron-download#cache-location).\n */\n cache?: string | null\n\n /**\n * The mirror.\n */\n mirror?: string | null\n\n /** @private */\n customDir?: string | null\n /** @private */\n customFilename?: string | null\n\n strictSSL?: boolean\n isVerifyChecksum?: boolean\n\n platform?: ElectronPlatformName\n arch?: string\n}\n\nfunction createDownloadOpts(opts: Configuration, platform: ElectronPlatformName, arch: string, electronVersion: string): ElectronDownloadOptions {\n return {\n platform,\n arch,\n version: electronVersion,\n ...opts.electronDownload,\n }\n}\n\nasync function beforeCopyExtraFiles(options: BeforeCopyExtraFilesOptions) {\n const packager = options.packager\n const appOutDir = options.appOutDir\n const electronBranding = createBrandingOpts(packager.config)\n if (packager.platform === Platform.LINUX) {\n if (!isSafeToUnpackElectronOnRemoteBuildServer(packager)) {\n const linuxPackager = packager as LinuxPackager\n const executable = path.join(appOutDir, linuxPackager.executableName)\n await rename(path.join(appOutDir, electronBranding.projectName), executable)\n }\n } else if (packager.platform === Platform.WINDOWS) {\n const executable = path.join(appOutDir, `${packager.appInfo.productFilename}.exe`)\n await rename(path.join(appOutDir, `${electronBranding.projectName}.exe`), executable)\n } else {\n await createMacApp(packager as MacPackager, appOutDir, options.asarIntegrity, (options.platformName as ElectronPlatformName) === \"mas\")\n\n const wantedLanguages = asArray(packager.platformSpecificBuildOptions.electronLanguages)\n if (wantedLanguages.length === 0) {\n return\n }\n\n // noinspection SpellCheckingInspection\n const langFileExt = \".lproj\"\n const resourcesDir = packager.getResourcesDir(appOutDir)\n await BluebirdPromise.map(\n readdir(resourcesDir),\n file => {\n if (!file.endsWith(langFileExt)) {\n return\n }\n\n const language = file.substring(0, file.length - langFileExt.length)\n if (!wantedLanguages.includes(language)) {\n return fs.rm(path.join(resourcesDir, file), { recursive: true, force: true })\n }\n return\n },\n CONCURRENCY\n )\n }\n}\n\nclass ElectronFramework implements Framework {\n // noinspection JSUnusedGlobalSymbols\n readonly macOsDefaultTargets = [\"zip\", \"dmg\"]\n // noinspection JSUnusedGlobalSymbols\n readonly defaultAppIdPrefix = \"com.electron.\"\n // noinspection JSUnusedGlobalSymbols\n readonly isCopyElevateHelper = true\n // noinspection JSUnusedGlobalSymbols\n readonly isNpmRebuildRequired = true\n\n constructor(readonly name: string, readonly version: string, readonly distMacOsAppName: string) {}\n\n getDefaultIcon(platform: Platform) {\n if (platform === Platform.LINUX) {\n return path.join(getTemplatePath(\"icons\"), \"electron-linux\")\n } else {\n // default icon is embedded into app skeleton\n return null\n }\n }\n\n prepareApplicationStageDirectory(options: PrepareApplicationStageDirectoryOptions) {\n return unpack(options, createDownloadOpts(options.packager.config, options.platformName, options.arch, this.version), this.distMacOsAppName)\n }\n\n beforeCopyExtraFiles(options: BeforeCopyExtraFilesOptions) {\n return beforeCopyExtraFiles(options)\n }\n}\n\nexport async function createElectronFrameworkSupport(configuration: Configuration, packager: Packager): Promise<Framework> {\n let version = configuration.electronVersion\n if (version == null) {\n // for prepacked app asar no dev deps in the app.asar\n if (packager.isPrepackedAppAsar) {\n version = await getElectronVersionFromInstalled(packager.projectDir)\n if (version == null) {\n throw new Error(`Cannot compute electron version for prepacked asar`)\n }\n } else {\n version = await computeElectronVersion(packager.projectDir, new Lazy(() => Promise.resolve(packager.metadata)))\n }\n configuration.electronVersion = version\n }\n\n const branding = createBrandingOpts(configuration)\n return new ElectronFramework(branding.projectName, version, `${branding.productName}.app`)\n}\n\nasync function unpack(prepareOptions: PrepareApplicationStageDirectoryOptions, options: ElectronDownloadOptions, distMacOsAppName: string) {\n const { packager, appOutDir, platformName } = prepareOptions\n\n const electronDist = packager.config.electronDist\n let dist: string | undefined | null = typeof electronDist === \"function\" ? electronDist(prepareOptions) : electronDist\n if (dist != null) {\n const zipFile = `electron-v${options.version}-${platformName}-${options.arch}.zip`\n const resolvedDist = path.isAbsolute(dist) ? dist : path.resolve(packager.projectDir, dist)\n if ((await statOrNull(path.join(resolvedDist, zipFile))) != null) {\n log.info({ resolvedDist, zipFile }, \"Resolved electronDist\")\n options.cache = resolvedDist\n dist = null\n }\n }\n\n let isFullCleanup = false\n if (dist == null) {\n if (isSafeToUnpackElectronOnRemoteBuildServer(packager)) {\n return\n }\n await executeAppBuilder([\"unpack-electron\", \"--configuration\", JSON.stringify([options]), \"--output\", appOutDir, \"--distMacOsAppName\", distMacOsAppName])\n } else {\n isFullCleanup = true\n const source = packager.getElectronSrcDir(dist)\n const destination = packager.getElectronDestinationDir(appOutDir)\n log.info({ source, destination }, \"copying Electron\")\n await emptyDir(appOutDir)\n await copyDir(source, destination, {\n isUseHardLink: DO_NOT_USE_HARD_LINKS,\n })\n }\n\n await cleanupAfterUnpack(prepareOptions, distMacOsAppName, isFullCleanup)\n}\n\nfunction cleanupAfterUnpack(prepareOptions: PrepareApplicationStageDirectoryOptions, distMacOsAppName: string, isFullCleanup: boolean) {\n const out = prepareOptions.appOutDir\n const isMac = prepareOptions.packager.platform === Platform.MAC\n const resourcesPath = isMac ? path.join(out, distMacOsAppName, \"Contents\", \"Resources\") : path.join(out, \"resources\")\n\n return Promise.all([\n isFullCleanup ? unlinkIfExists(path.join(resourcesPath, \"default_app.asar\")) : Promise.resolve(),\n isFullCleanup ? unlinkIfExists(path.join(out, \"version\")) : Promise.resolve(),\n isMac\n ? Promise.resolve()\n : rename(path.join(out, \"LICENSE\"), path.join(out, \"LICENSE.electron.txt\")).catch(() => {\n /* ignore */\n }),\n ])\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ElectronFramework.js","sourceRoot":"","sources":["../../src/electron/ElectronFramework.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAC1C,+CAA8D;AAC9D,4CAA6G;AAC7G,uCAAoD;AACpD,uCAA+B;AAC/B,6BAA4B;AAG5B,oCAA6C;AAG7C,0DAA+E;AAC/E,qDAAqD;AACrD,+CAA4C;AAC5C,uDAA2F;AAC3F,kCAAiC;AAajC,SAAgB,kBAAkB,CAAC,IAAmB;;IACpD,OAAO;QACL,WAAW,EAAE,CAAA,MAAA,IAAI,CAAC,gBAAgB,0CAAE,WAAW,KAAI,UAAU;QAC7D,WAAW,EAAE,CAAA,MAAA,IAAI,CAAC,gBAAgB,0CAAE,WAAW,KAAI,UAAU;KAC9D,CAAA;AACH,CAAC;AALD,gDAKC;AA6BD,SAAS,kBAAkB,CAAC,IAAmB,EAAE,QAA8B,EAAE,IAAY,EAAE,eAAuB;IACpH,OAAO;QACL,QAAQ;QACR,IAAI;QACJ,OAAO,EAAE,eAAe;QACxB,GAAG,IAAI,CAAC,gBAAgB;KACzB,CAAA;AACH,CAAC;AAED,KAAK,UAAU,oBAAoB,CAAC,OAAoC;IACtE,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAA;IACjC,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAA;IACnC,MAAM,gBAAgB,GAAG,kBAAkB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;IAC5D,IAAI,QAAQ,CAAC,QAAQ,KAAK,gBAAQ,CAAC,KAAK,EAAE;QACxC,IAAI,CAAC,IAAA,4DAAyC,EAAC,QAAQ,CAAC,EAAE;YACxD,MAAM,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ENCY, copyDir, DO_NOT_USE_HARD_LINKS, statOrNull, unlinkIfExists } from \"builder-util/out/fs\"\nimport { emptyDir, readdir, rename } from \"fs-extra\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { Configuration } from \"../configuration\"\nimport { BeforeCopyExtraFilesOptions, Framework, PrepareApplicationStageDirectoryOptions } from \"../Framework\"\nimport { Packager, Platform } from \"../index\"\nimport { LinuxPackager } from \"../linuxPackager\"\nimport MacPackager from \"../macPackager\"\nimport { isSafeToUnpackElectronOnRemoteBuildServer } from \"../platformPackager\"\nimport { getTemplatePath } from \"../util/pathManager\"\nimport { createMacApp } from \"./electronMac\"\nimport { computeElectronVersion, getElectronVersionFromInstalled } from \"./electronVersion\"\nimport * as fs from \"fs/promises\"\n\nexport type ElectronPlatformName = \"darwin\" | \"linux\" | \"win32\" | \"mas\"\n\n/**\n * Electron distributables branding options.\n * @see [Electron BRANDING.json](https://github.com/electron/electron/blob/master/shell/app/BRANDING.json).\n */\nexport interface ElectronBrandingOptions {\n projectName?: string\n productName?: string\n}\n\nexport function createBrandingOpts(opts: Configuration): Required<ElectronBrandingOptions> {\n return {\n projectName: opts.electronBranding?.projectName || \"electron\",\n productName: opts.electronBranding?.productName || \"Electron\",\n }\n}\n\nexport interface ElectronDownloadOptions {\n // https://github.com/electron-userland/electron-builder/issues/3077\n // must be optional\n version?: string\n\n /**\n * The [cache location](https://github.com/electron-userland/electron-download#cache-location).\n */\n cache?: string | null\n\n /**\n * The mirror.\n */\n mirror?: string | null\n\n /** @private */\n customDir?: string | null\n /** @private */\n customFilename?: string | null\n\n strictSSL?: boolean\n isVerifyChecksum?: boolean\n\n platform?: ElectronPlatformName\n arch?: string\n}\n\nfunction createDownloadOpts(opts: Configuration, platform: ElectronPlatformName, arch: string, electronVersion: string): ElectronDownloadOptions {\n return {\n platform,\n arch,\n version: electronVersion,\n ...opts.electronDownload,\n }\n}\n\nasync function beforeCopyExtraFiles(options: BeforeCopyExtraFilesOptions) {\n const packager = options.packager\n const appOutDir = options.appOutDir\n const electronBranding = createBrandingOpts(packager.config)\n if (packager.platform === Platform.LINUX) {\n if (!isSafeToUnpackElectronOnRemoteBuildServer(packager)) {\n const linuxPackager = packager as LinuxPackager\n const executable = path.join(appOutDir, linuxPackager.executableName)\n await rename(path.join(appOutDir, electronBranding.projectName), executable)\n }\n } else if (packager.platform === Platform.WINDOWS) {\n const executable = path.join(appOutDir, `${packager.appInfo.productFilename}.exe`)\n await rename(path.join(appOutDir, `${electronBranding.projectName}.exe`), executable)\n } else {\n await createMacApp(packager as MacPackager, appOutDir, options.asarIntegrity, (options.platformName as ElectronPlatformName) === \"mas\")\n\n const wantedLanguages = asArray(packager.platformSpecificBuildOptions.electronLanguages)\n if (wantedLanguages.length === 0) {\n return\n }\n\n // noinspection SpellCheckingInspection\n const langFileExt = \".lproj\"\n const resourcesDir = packager.getResourcesDir(appOutDir)\n await BluebirdPromise.map(\n readdir(resourcesDir),\n file => {\n if (!file.endsWith(langFileExt)) {\n return\n }\n\n const language = file.substring(0, file.length - langFileExt.length)\n if (!wantedLanguages.includes(language)) {\n return fs.rm(path.join(resourcesDir, file), { recursive: true, force: true })\n }\n return\n },\n CONCURRENCY\n )\n }\n}\n\nclass ElectronFramework implements Framework {\n // noinspection JSUnusedGlobalSymbols\n readonly macOsDefaultTargets = [\"zip\", \"dmg\"]\n // noinspection JSUnusedGlobalSymbols\n readonly defaultAppIdPrefix = \"com.electron.\"\n // noinspection JSUnusedGlobalSymbols\n readonly isCopyElevateHelper = true\n // noinspection JSUnusedGlobalSymbols\n readonly isNpmRebuildRequired = true\n\n constructor(readonly name: string, readonly version: string, readonly distMacOsAppName: string) {}\n\n getDefaultIcon(platform: Platform) {\n if (platform === Platform.LINUX) {\n return path.join(getTemplatePath(\"icons\"), \"electron-linux\")\n } else {\n // default icon is embedded into app skeleton\n return null\n }\n }\n\n prepareApplicationStageDirectory(options: PrepareApplicationStageDirectoryOptions) {\n return unpack(options, createDownloadOpts(options.packager.config, options.platformName, options.arch, this.version), this.distMacOsAppName)\n }\n\n beforeCopyExtraFiles(options: BeforeCopyExtraFilesOptions) {\n return beforeCopyExtraFiles(options)\n }\n}\n\nexport async function createElectronFrameworkSupport(configuration: Configuration, packager: Packager): Promise<Framework> {\n let version = configuration.electronVersion\n if (version == null) {\n // for prepacked app asar no dev deps in the app.asar\n if (packager.isPrepackedAppAsar) {\n version = await getElectronVersionFromInstalled(packager.projectDir)\n if (version == null) {\n throw new Error(`Cannot compute electron version for prepacked asar`)\n }\n } else {\n version = await computeElectronVersion(packager.projectDir, new Lazy(() => Promise.resolve(packager.metadata)))\n }\n configuration.electronVersion = version\n }\n\n const branding = createBrandingOpts(configuration)\n return new ElectronFramework(branding.projectName, version, `${branding.productName}.app`)\n}\n\nasync function unpack(prepareOptions: PrepareApplicationStageDirectoryOptions, options: ElectronDownloadOptions, distMacOsAppName: string) {\n const { packager, appOutDir, platformName } = prepareOptions\n\n const electronDist = packager.config.electronDist\n let dist: string | undefined | null = typeof electronDist === \"function\" ? electronDist(prepareOptions) : electronDist\n if (dist != null) {\n const zipFile = `electron-v${options.version}-${platformName}-${options.arch}.zip`\n const resolvedDist = path.isAbsolute(dist) ? dist : path.resolve(packager.projectDir, dist)\n if ((await statOrNull(path.join(resolvedDist, zipFile))) != null) {\n log.info({ resolvedDist, zipFile }, \"Resolved electronDist\")\n options.cache = resolvedDist\n dist = null\n }\n }\n\n let isFullCleanup = false\n if (dist == null) {\n if (isSafeToUnpackElectronOnRemoteBuildServer(packager)) {\n return\n }\n await executeAppBuilder([\"unpack-electron\", \"--configuration\", JSON.stringify([options]), \"--output\", appOutDir, \"--distMacOsAppName\", distMacOsAppName])\n } else {\n isFullCleanup = true\n const source = packager.getElectronSrcDir(dist)\n const destination = packager.getElectronDestinationDir(appOutDir)\n log.info({ source, destination }, \"copying Electron\")\n await emptyDir(appOutDir)\n await copyDir(source, destination, {\n isUseHardLink: DO_NOT_USE_HARD_LINKS,\n })\n }\n\n await cleanupAfterUnpack(prepareOptions, distMacOsAppName, isFullCleanup)\n}\n\nfunction cleanupAfterUnpack(prepareOptions: PrepareApplicationStageDirectoryOptions, distMacOsAppName: string, isFullCleanup: boolean) {\n const out = prepareOptions.appOutDir\n const isMac = prepareOptions.packager.platform === Platform.MAC\n const resourcesPath = isMac ? path.join(out, distMacOsAppName, \"Contents\", \"Resources\") : path.join(out, \"resources\")\n\n return Promise.all([\n isFullCleanup ? unlinkIfExists(path.join(resourcesPath, \"default_app.asar\")) : Promise.resolve(),\n isFullCleanup ? unlinkIfExists(path.join(out, \"version\")) : Promise.resolve(),\n isMac\n ? Promise.resolve()\n : rename(path.join(out, \"LICENSE\"), path.join(out, \"LICENSE.electron.txt\")).catch(() => {\n /* ignore */\n }),\n ])\n}\n"]}
|
|
@@ -11,7 +11,7 @@ const platformPackager_1 = require("../platformPackager");
|
|
|
11
11
|
const appBuilder_1 = require("../util/appBuilder");
|
|
12
12
|
const ElectronFramework_1 = require("./ElectronFramework");
|
|
13
13
|
function doRename(basePath, oldName, newName) {
|
|
14
|
-
return promises_1.rename(path.join(basePath, oldName), path.join(basePath, newName));
|
|
14
|
+
return (0, promises_1.rename)(path.join(basePath, oldName), path.join(basePath, newName));
|
|
15
15
|
}
|
|
16
16
|
function moveHelpers(helperSuffixes, frameworksPath, appName, prefix) {
|
|
17
17
|
return bluebird_lst_1.default.map(helperSuffixes, suffix => {
|
|
@@ -42,7 +42,7 @@ function getAvailableHelperSuffixes(helperEHPlist, helperNPPlist, helperRenderer
|
|
|
42
42
|
async function createMacApp(packager, appOutDir, asarIntegrity, isMas) {
|
|
43
43
|
const appInfo = packager.appInfo;
|
|
44
44
|
const appFilename = appInfo.productFilename;
|
|
45
|
-
const electronBranding = ElectronFramework_1.createBrandingOpts(packager.config);
|
|
45
|
+
const electronBranding = (0, ElectronFramework_1.createBrandingOpts)(packager.config);
|
|
46
46
|
const contentsPath = path.join(appOutDir, packager.info.framework.distMacOsAppName, "Contents");
|
|
47
47
|
const frameworksPath = path.join(contentsPath, "Frameworks");
|
|
48
48
|
const loginItemPath = path.join(contentsPath, "Library", "LoginItems");
|
|
@@ -54,7 +54,7 @@ async function createMacApp(packager, appOutDir, asarIntegrity, isMas) {
|
|
|
54
54
|
const helperPluginPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper (Plugin).app`, "Contents", "Info.plist");
|
|
55
55
|
const helperGPUPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper (GPU).app`, "Contents", "Info.plist");
|
|
56
56
|
const helperLoginPlistFilename = path.join(loginItemPath, `${electronBranding.productName} Login Helper.app`, "Contents", "Info.plist");
|
|
57
|
-
const plistContent = await appBuilder_1.executeAppBuilderAsJson([
|
|
57
|
+
const plistContent = await (0, appBuilder_1.executeAppBuilderAsJson)([
|
|
58
58
|
"decode-plist",
|
|
59
59
|
"-f",
|
|
60
60
|
appPlistFilename,
|
|
@@ -99,7 +99,7 @@ async function createMacApp(packager, appOutDir, asarIntegrity, isMas) {
|
|
|
99
99
|
if (oldHelperBundleId != null) {
|
|
100
100
|
builder_util_1.log.warn("build.helper-bundle-id is deprecated, please set as build.mac.helperBundleId");
|
|
101
101
|
}
|
|
102
|
-
const helperBundleIdentifier = appInfo_1.filterCFBundleIdentifier(packager.platformSpecificBuildOptions.helperBundleId || oldHelperBundleId || `${appInfo.macBundleIdentifier}.helper`);
|
|
102
|
+
const helperBundleIdentifier = (0, appInfo_1.filterCFBundleIdentifier)(packager.platformSpecificBuildOptions.helperBundleId || oldHelperBundleId || `${appInfo.macBundleIdentifier}.helper`);
|
|
103
103
|
await packager.applyCommonInfo(appPlist, contentsPath);
|
|
104
104
|
// required for electron-updater proxy
|
|
105
105
|
if (!isMas) {
|
|
@@ -121,8 +121,8 @@ async function createMacApp(packager, appOutDir, asarIntegrity, isMas) {
|
|
|
121
121
|
helper.CFBundleExecutable = `${appFilename} Helper ${postfix}`;
|
|
122
122
|
helper.CFBundleDisplayName = `${appInfo.productName} Helper ${postfix}`;
|
|
123
123
|
helper.CFBundleIdentifier = userProvidedBundleIdentifier
|
|
124
|
-
? appInfo_1.filterCFBundleIdentifier(userProvidedBundleIdentifier)
|
|
125
|
-
: appInfo_1.filterCFBundleIdentifier(`${helperBundleIdentifier}.${postfix}`);
|
|
124
|
+
? (0, appInfo_1.filterCFBundleIdentifier)(userProvidedBundleIdentifier)
|
|
125
|
+
: (0, appInfo_1.filterCFBundleIdentifier)(`${helperBundleIdentifier}.${postfix}`);
|
|
126
126
|
helper.CFBundleVersion = appPlist.CFBundleVersion;
|
|
127
127
|
}
|
|
128
128
|
if (helperRendererPlist != null) {
|
|
@@ -147,10 +147,10 @@ async function createMacApp(packager, appOutDir, asarIntegrity, isMas) {
|
|
|
147
147
|
helperLoginPlist.CFBundleIdentifier = `${appInfo.macBundleIdentifier}.loginhelper`;
|
|
148
148
|
helperLoginPlist.CFBundleVersion = appPlist.CFBundleVersion;
|
|
149
149
|
}
|
|
150
|
-
const protocols = builder_util_1.asArray(buildMetadata.protocols).concat(builder_util_1.asArray(packager.platformSpecificBuildOptions.protocols));
|
|
150
|
+
const protocols = (0, builder_util_1.asArray)(buildMetadata.protocols).concat((0, builder_util_1.asArray)(packager.platformSpecificBuildOptions.protocols));
|
|
151
151
|
if (protocols.length > 0) {
|
|
152
152
|
appPlist.CFBundleURLTypes = protocols.map(protocol => {
|
|
153
|
-
const schemes = builder_util_1.asArray(protocol.schemes);
|
|
153
|
+
const schemes = (0, builder_util_1.asArray)(protocol.schemes);
|
|
154
154
|
if (schemes.length === 0) {
|
|
155
155
|
throw new builder_util_1.InvalidConfigurationError(`Protocol "${protocol.name}": must be at least one scheme specified`);
|
|
156
156
|
}
|
|
@@ -164,12 +164,12 @@ async function createMacApp(packager, appOutDir, asarIntegrity, isMas) {
|
|
|
164
164
|
const fileAssociations = packager.fileAssociations;
|
|
165
165
|
if (fileAssociations.length > 0) {
|
|
166
166
|
appPlist.CFBundleDocumentTypes = await bluebird_lst_1.default.map(fileAssociations, async (fileAssociation) => {
|
|
167
|
-
const extensions = builder_util_1.asArray(fileAssociation.ext).map(platformPackager_1.normalizeExt);
|
|
168
|
-
const customIcon = await packager.getResource(builder_util_1.getPlatformIconFileName(fileAssociation.icon, true), `${extensions[0]}.icns`);
|
|
167
|
+
const extensions = (0, builder_util_1.asArray)(fileAssociation.ext).map(platformPackager_1.normalizeExt);
|
|
168
|
+
const customIcon = await packager.getResource((0, builder_util_1.getPlatformIconFileName)(fileAssociation.icon, true), `${extensions[0]}.icns`);
|
|
169
169
|
let iconFile = appPlist.CFBundleIconFile;
|
|
170
170
|
if (customIcon != null) {
|
|
171
171
|
iconFile = path.basename(customIcon);
|
|
172
|
-
await fs_1.copyOrLinkFile(customIcon, path.join(path.join(contentsPath, "Resources"), iconFile));
|
|
172
|
+
await (0, fs_1.copyOrLinkFile)(customIcon, path.join(path.join(contentsPath, "Resources"), iconFile));
|
|
173
173
|
}
|
|
174
174
|
const result = {
|
|
175
175
|
CFBundleTypeExtensions: extensions,
|
|
@@ -210,10 +210,10 @@ async function createMacApp(packager, appOutDir, asarIntegrity, isMas) {
|
|
|
210
210
|
plistDataToWrite[helperLoginPlistFilename] = helperLoginPlist;
|
|
211
211
|
}
|
|
212
212
|
await Promise.all([
|
|
213
|
-
appBuilder_1.executeAppBuilderAndWriteJson(["encode-plist"], plistDataToWrite),
|
|
213
|
+
(0, appBuilder_1.executeAppBuilderAndWriteJson)(["encode-plist"], plistDataToWrite),
|
|
214
214
|
doRename(path.join(contentsPath, "MacOS"), electronBranding.productName, appPlist.CFBundleExecutable),
|
|
215
|
-
fs_1.unlinkIfExists(path.join(appOutDir, "LICENSE")),
|
|
216
|
-
fs_1.unlinkIfExists(path.join(appOutDir, "LICENSES.chromium.html")),
|
|
215
|
+
(0, fs_1.unlinkIfExists)(path.join(appOutDir, "LICENSE")),
|
|
216
|
+
(0, fs_1.unlinkIfExists)(path.join(appOutDir, "LICENSES.chromium.html")),
|
|
217
217
|
]);
|
|
218
218
|
await moveHelpers(getAvailableHelperSuffixes(helperEHPlist, helperNPPlist, helperRendererPlist, helperPluginPlist, helperGPUPlist), frameworksPath, appFilename, electronBranding.productName);
|
|
219
219
|
if (helperLoginPlist != null) {
|
|
@@ -223,10 +223,10 @@ async function createMacApp(packager, appOutDir, asarIntegrity, isMas) {
|
|
|
223
223
|
await doRename(executableBasePath, `${prefix}${suffix}`, appFilename + suffix).then(() => doRename(loginItemPath, `${prefix}${suffix}.app`, `${appFilename}${suffix}.app`));
|
|
224
224
|
}
|
|
225
225
|
const appPath = path.join(appOutDir, `${appFilename}.app`);
|
|
226
|
-
await promises_1.rename(path.dirname(contentsPath), appPath);
|
|
226
|
+
await (0, promises_1.rename)(path.dirname(contentsPath), appPath);
|
|
227
227
|
// https://github.com/electron-userland/electron-builder/issues/840
|
|
228
228
|
const now = Date.now() / 1000;
|
|
229
|
-
await promises_1.utimes(appPath, now, now);
|
|
229
|
+
await (0, promises_1.utimes)(appPath, now, now);
|
|
230
230
|
}
|
|
231
231
|
exports.createMacApp = createMacApp;
|
|
232
232
|
function configureLocalhostAts(appPlist) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"electronMac.js","sourceRoot":"","sources":["../../src/electron/electronMac.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAC1C,+CAA+F;AAC/F,4CAAoE;AACpE,0CAA4C;AAC5C,6BAA4B;AAC5B,wCAAqD;AAGrD,0DAAkD;AAClD,mDAA2F;AAC3F,2DAAwD;AAExD,SAAS,QAAQ,CAAC,QAAgB,EAAE,OAAe,EAAE,OAAe;IAClE,OAAO,iBAAM,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAA;AAC3E,CAAC;AAED,SAAS,WAAW,CAAC,cAA6B,EAAE,cAAsB,EAAE,OAAe,EAAE,MAAc;IACzG,OAAO,sBAAe,CAAC,GAAG,CAAC,cAAc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AG,CAAC,CAAA;AACjC,CAAC;AA1ND,oCA0NC;AAED,SAAS,qBAAqB,CAAC,QAAa;IAC1C,yEAAyE;IACzE,IAAI,GAAG,GAAG,QAAQ,CAAC,sBAAsB,CAAA;IACzC,IAAI,GAAG,IAAI,IAAI,EAAE;QACf,GAAG,GAAG,EAAE,CAAA;QACR,QAAQ,CAAC,sBAAsB,GAAG,GAAG,CAAA;KACtC;IAED,GAAG,CAAC,uBAAuB,GAAG,IAAI,CAAA;IAClC,2FAA2F;IAC3F,GAAG,CAAC,sBAAsB,GAAG,IAAI,CAAA;IAEjC,IAAI,gBAAgB,GAAG,GAAG,CAAC,kBAAkB,CAAA;IAC7C,IAAI,gBAAgB,IAAI,IAAI,EAAE;QAC5B,gBAAgB,GAAG,EAAE,CAAA;QACrB,GAAG,CAAC,kBAAkB,GAAG,gBAAgB,CAAA;KAC1C;IAED,IAAI,gBAAgB,CAAC,SAAS,IAAI,IAAI,EAAE;QACtC,MAAM,SAAS,GAAG;YAChB,4CAA4C,EAAE,KAAK;YACnD,oBAAoB,EAAE,KAAK;YAC3B,2CAA2C,EAAE,IAAI;YACjD,qCAAqC,EAAE,KAAK;YAC5C,0CAA0C,EAAE,KAAK;SAClD,CAAA;QACD,gBAAgB,CAAC,SAAS,GAAG,SAAS,CAAA;QACtC,gBAAgB,CAAC,WAAW,CAAC,GAAG,SAAS,CAAA;KAC1C;AACH,CAAC","sourcesContent":["import BluebirdPromise from \"bluebird-lst\"\nimport { asArray, getPlatformIconFileName, InvalidConfigurationError, log } from \"builder-util\"\nimport { copyOrLinkFile, unlinkIfExists } from \"builder-util/out/fs\"\nimport { rename, utimes } from \"fs/promises\"\nimport * as path from \"path\"\nimport { filterCFBundleIdentifier } from \"../appInfo\"\nimport { AsarIntegrity } from \"../asar/integrity\"\nimport MacPackager from \"../macPackager\"\nimport { normalizeExt } from \"../platformPackager\"\nimport { executeAppBuilderAndWriteJson, executeAppBuilderAsJson } from \"../util/appBuilder\"\nimport { createBrandingOpts } from \"./ElectronFramework\"\n\nfunction doRename(basePath: string, oldName: string, newName: string) {\n return rename(path.join(basePath, oldName), path.join(basePath, newName))\n}\n\nfunction moveHelpers(helperSuffixes: Array<string>, frameworksPath: string, appName: string, prefix: string): Promise<any> {\n return BluebirdPromise.map(helperSuffixes, suffix => {\n const executableBasePath = path.join(frameworksPath, `${prefix}${suffix}.app`, \"Contents\", \"MacOS\")\n return doRename(executableBasePath, `${prefix}${suffix}`, appName + suffix).then(() => doRename(frameworksPath, `${prefix}${suffix}.app`, `${appName}${suffix}.app`))\n })\n}\n\nfunction getAvailableHelperSuffixes(\n helperEHPlist: string | null,\n helperNPPlist: string | null,\n helperRendererPlist: string | null,\n helperPluginPlist: string | null,\n helperGPUPlist: string | null\n) {\n const result = [\" Helper\"]\n if (helperEHPlist != null) {\n result.push(\" Helper EH\")\n }\n if (helperNPPlist != null) {\n result.push(\" Helper NP\")\n }\n if (helperRendererPlist != null) {\n result.push(\" Helper (Renderer)\")\n }\n if (helperPluginPlist != null) {\n result.push(\" Helper (Plugin)\")\n }\n if (helperGPUPlist != null) {\n result.push(\" Helper (GPU)\")\n }\n return result\n}\n\n/** @internal */\nexport async function createMacApp(packager: MacPackager, appOutDir: string, asarIntegrity: AsarIntegrity | null, isMas: boolean) {\n const appInfo = packager.appInfo\n const appFilename = appInfo.productFilename\n const electronBranding = createBrandingOpts(packager.config)\n\n const contentsPath = path.join(appOutDir, packager.info.framework.distMacOsAppName, \"Contents\")\n const frameworksPath = path.join(contentsPath, \"Frameworks\")\n const loginItemPath = path.join(contentsPath, \"Library\", \"LoginItems\")\n\n const appPlistFilename = path.join(contentsPath, \"Info.plist\")\n const helperPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper.app`, \"Contents\", \"Info.plist\")\n const helperEHPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper EH.app`, \"Contents\", \"Info.plist\")\n const helperNPPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper NP.app`, \"Contents\", \"Info.plist\")\n const helperRendererPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper (Renderer).app`, \"Contents\", \"Info.plist\")\n const helperPluginPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper (Plugin).app`, \"Contents\", \"Info.plist\")\n const helperGPUPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper (GPU).app`, \"Contents\", \"Info.plist\")\n const helperLoginPlistFilename = path.join(loginItemPath, `${electronBranding.productName} Login Helper.app`, \"Contents\", \"Info.plist\")\n\n const plistContent: Array<any> = await executeAppBuilderAsJson([\n \"decode-plist\",\n \"-f\",\n appPlistFilename,\n \"-f\",\n helperPlistFilename,\n \"-f\",\n helperEHPlistFilename,\n \"-f\",\n helperNPPlistFilename,\n \"-f\",\n helperRendererPlistFilename,\n \"-f\",\n helperPluginPlistFilename,\n \"-f\",\n helperGPUPlistFilename,\n \"-f\",\n helperLoginPlistFilename,\n ])\n\n if (plistContent[0] == null) {\n throw new Error(\"corrupted Electron dist\")\n }\n\n const appPlist = plistContent[0]!\n const helperPlist = plistContent[1]!\n const helperEHPlist = plistContent[2]\n const helperNPPlist = plistContent[3]\n const helperRendererPlist = plistContent[4]\n const helperPluginPlist = plistContent[5]\n const helperGPUPlist = plistContent[6]\n const helperLoginPlist = plistContent[7]\n\n // if an extend-info file was supplied, copy its contents in first\n if (plistContent[8] != null) {\n Object.assign(appPlist, plistContent[8])\n }\n\n const buildMetadata = packager.config\n\n /**\n * Configure bundleIdentifier for the generic Electron Helper process\n *\n * This was the only Helper in Electron 5 and before. Allow users to configure\n * the bundleIdentifier for continuity.\n */\n\n const oldHelperBundleId = (buildMetadata as any)[\"helper-bundle-id\"]\n if (oldHelperBundleId != null) {\n log.warn(\"build.helper-bundle-id is deprecated, please set as build.mac.helperBundleId\")\n }\n const helperBundleIdentifier = filterCFBundleIdentifier(packager.platformSpecificBuildOptions.helperBundleId || oldHelperBundleId || `${appInfo.macBundleIdentifier}.helper`)\n\n await packager.applyCommonInfo(appPlist, contentsPath)\n\n // required for electron-updater proxy\n if (!isMas) {\n configureLocalhostAts(appPlist)\n }\n\n helperPlist.CFBundleExecutable = `${appFilename} Helper`\n helperPlist.CFBundleDisplayName = `${appInfo.productName} Helper`\n helperPlist.CFBundleIdentifier = helperBundleIdentifier\n helperPlist.CFBundleVersion = appPlist.CFBundleVersion\n\n /**\n * Configure bundleIdentifier for Electron 5+ Helper processes\n *\n * In Electron 6, parts of the generic Electron Helper process were split into\n * individual helper processes. Allow users to configure the bundleIdentifiers\n * for continuity, specifically because macOS keychain access relies on\n * bundleIdentifiers not changing (i.e. across versions of Electron).\n */\n\n function configureHelper(helper: any, postfix: string, userProvidedBundleIdentifier?: string | null) {\n helper.CFBundleExecutable = `${appFilename} Helper ${postfix}`\n helper.CFBundleDisplayName = `${appInfo.productName} Helper ${postfix}`\n helper.CFBundleIdentifier = userProvidedBundleIdentifier\n ? filterCFBundleIdentifier(userProvidedBundleIdentifier)\n : filterCFBundleIdentifier(`${helperBundleIdentifier}.${postfix}`)\n helper.CFBundleVersion = appPlist.CFBundleVersion\n }\n\n if (helperRendererPlist != null) {\n configureHelper(helperRendererPlist, \"(Renderer)\", packager.platformSpecificBuildOptions.helperRendererBundleId)\n }\n if (helperPluginPlist != null) {\n configureHelper(helperPluginPlist, \"(Plugin)\", packager.platformSpecificBuildOptions.helperPluginBundleId)\n }\n if (helperGPUPlist != null) {\n configureHelper(helperGPUPlist, \"(GPU)\", packager.platformSpecificBuildOptions.helperGPUBundleId)\n }\n if (helperEHPlist != null) {\n configureHelper(helperEHPlist, \"EH\", packager.platformSpecificBuildOptions.helperEHBundleId)\n }\n if (helperNPPlist != null) {\n configureHelper(helperNPPlist, \"NP\", packager.platformSpecificBuildOptions.helperNPBundleId)\n }\n if (helperLoginPlist != null) {\n helperLoginPlist.CFBundleExecutable = `${appFilename} Login Helper`\n helperLoginPlist.CFBundleDisplayName = `${appInfo.productName} Login Helper`\n // noinspection SpellCheckingInspection\n helperLoginPlist.CFBundleIdentifier = `${appInfo.macBundleIdentifier}.loginhelper`\n helperLoginPlist.CFBundleVersion = appPlist.CFBundleVersion\n }\n\n const protocols = asArray(buildMetadata.protocols).concat(asArray(packager.platformSpecificBuildOptions.protocols))\n if (protocols.length > 0) {\n appPlist.CFBundleURLTypes = protocols.map(protocol => {\n const schemes = asArray(protocol.schemes)\n if (schemes.length === 0) {\n throw new InvalidConfigurationError(`Protocol \"${protocol.name}\": must be at least one scheme specified`)\n }\n return {\n CFBundleURLName: protocol.name,\n CFBundleTypeRole: protocol.role || \"Editor\",\n CFBundleURLSchemes: schemes.slice(),\n }\n })\n }\n\n const fileAssociations = packager.fileAssociations\n if (fileAssociations.length > 0) {\n appPlist.CFBundleDocumentTypes = await BluebirdPromise.map(fileAssociations, async fileAssociation => {\n const extensions = asArray(fileAssociation.ext).map(normalizeExt)\n const customIcon = await packager.getResource(getPlatformIconFileName(fileAssociation.icon, true), `${extensions[0]}.icns`)\n let iconFile = appPlist.CFBundleIconFile\n if (customIcon != null) {\n iconFile = path.basename(customIcon)\n await copyOrLinkFile(customIcon, path.join(path.join(contentsPath, \"Resources\"), iconFile))\n }\n\n const result = {\n CFBundleTypeExtensions: extensions,\n CFBundleTypeName: fileAssociation.name || extensions[0],\n CFBundleTypeRole: fileAssociation.role || \"Editor\",\n LSHandlerRank: fileAssociation.rank || \"Default\",\n CFBundleTypeIconFile: iconFile,\n } as any\n\n if (fileAssociation.isPackage) {\n result.LSTypeIsPackage = true\n }\n return result\n })\n }\n\n if (asarIntegrity != null) {\n appPlist.ElectronAsarIntegrity = asarIntegrity\n }\n\n const plistDataToWrite: any = {\n [appPlistFilename]: appPlist,\n [helperPlistFilename]: helperPlist,\n }\n if (helperEHPlist != null) {\n plistDataToWrite[helperEHPlistFilename] = helperEHPlist\n }\n if (helperNPPlist != null) {\n plistDataToWrite[helperNPPlistFilename] = helperNPPlist\n }\n if (helperRendererPlist != null) {\n plistDataToWrite[helperRendererPlistFilename] = helperRendererPlist\n }\n if (helperPluginPlist != null) {\n plistDataToWrite[helperPluginPlistFilename] = helperPluginPlist\n }\n if (helperGPUPlist != null) {\n plistDataToWrite[helperGPUPlistFilename] = helperGPUPlist\n }\n if (helperLoginPlist != null) {\n plistDataToWrite[helperLoginPlistFilename] = helperLoginPlist\n }\n\n await Promise.all([\n executeAppBuilderAndWriteJson([\"encode-plist\"], plistDataToWrite),\n doRename(path.join(contentsPath, \"MacOS\"), electronBranding.productName, appPlist.CFBundleExecutable),\n unlinkIfExists(path.join(appOutDir, \"LICENSE\")),\n unlinkIfExists(path.join(appOutDir, \"LICENSES.chromium.html\")),\n ])\n\n await moveHelpers(\n getAvailableHelperSuffixes(helperEHPlist, helperNPPlist, helperRendererPlist, helperPluginPlist, helperGPUPlist),\n frameworksPath,\n appFilename,\n electronBranding.productName\n )\n\n if (helperLoginPlist != null) {\n const prefix = electronBranding.productName\n const suffix = \" Login Helper\"\n const executableBasePath = path.join(loginItemPath, `${prefix}${suffix}.app`, \"Contents\", \"MacOS\")\n await doRename(executableBasePath, `${prefix}${suffix}`, appFilename + suffix).then(() => doRename(loginItemPath, `${prefix}${suffix}.app`, `${appFilename}${suffix}.app`))\n }\n\n const appPath = path.join(appOutDir, `${appFilename}.app`)\n await rename(path.dirname(contentsPath), appPath)\n // https://github.com/electron-userland/electron-builder/issues/840\n const now = Date.now() / 1000\n await utimes(appPath, now, now)\n}\n\nfunction configureLocalhostAts(appPlist: any) {\n // https://bencoding.com/2015/07/20/app-transport-security-and-localhost/\n let ats = appPlist.NSAppTransportSecurity\n if (ats == null) {\n ats = {}\n appPlist.NSAppTransportSecurity = ats\n }\n\n ats.NSAllowsLocalNetworking = true\n // https://github.com/electron-userland/electron-builder/issues/3377#issuecomment-446035814\n ats.NSAllowsArbitraryLoads = true\n\n let exceptionDomains = ats.NSExceptionDomains\n if (exceptionDomains == null) {\n exceptionDomains = {}\n ats.NSExceptionDomains = exceptionDomains\n }\n\n if (exceptionDomains.localhost == null) {\n const allowHttp = {\n NSTemporaryExceptionAllowsInsecureHTTPSLoads: false,\n NSIncludesSubdomains: false,\n NSTemporaryExceptionAllowsInsecureHTTPLoads: true,\n NSTemporaryExceptionMinimumTLSVersion: \"1.0\",\n NSTemporaryExceptionRequiresForwardSecrecy: false,\n }\n exceptionDomains.localhost = allowHttp\n exceptionDomains[\"127.0.0.1\"] = allowHttp\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"electronMac.js","sourceRoot":"","sources":["../../src/electron/electronMac.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAC1C,+CAA+F;AAC/F,4CAAoE;AACpE,0CAA4C;AAC5C,6BAA4B;AAC5B,wCAAqD;AAGrD,0DAAkD;AAClD,mDAA2F;AAC3F,2DAAwD;AAExD,SAAS,QAAQ,CAAC,QAAgB,EAAE,OAAe,EAAE,OAAe;IAClE,OAAO,IAAA,iBAAM,EAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAA;AAC3E,CAAC;AAED,SAAS,WAAW,CAAC,cAA6B,EAAE,cAAsB,EAAE,OAAe,EAAE,MAAc;IACzG,OAAO,sBAAe,CAAC,GAAG,CAAC,cAAc,EAAE,MAAM,CAAC,EAAE;QAClD,MAAM,kBAAkB,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,GAAG,MAAM,GAAG,MAAM,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;QACnG,OAAO,QAAQ,CAAC,kBAAkB,EAAE,GAAG,MAAM,GAAG,MAAM,EAAE,EAAE,OAAO,GAAG,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,cAAc,EAAE,GAAG,MAAM,GAAG,MAAM,MAAM,EAAE,GAAG,OAAO,GAAG,MAAM,MAAM,CAAC,CAAC,CAAA;IACvK,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,SAAS,0B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I,CAAA;IAEjC,IAAI,gBAAgB,GAAG,GAAG,CAAC,kBAAkB,CAAA;IAC7C,IAAI,gBAAgB,IAAI,IAAI,EAAE;QAC5B,gBAAgB,GAAG,EAAE,CAAA;QACrB,GAAG,CAAC,kBAAkB,GAAG,gBAAgB,CAAA;KAC1C;IAED,IAAI,gBAAgB,CAAC,SAAS,IAAI,IAAI,EAAE;QACtC,MAAM,SAAS,GAAG;YAChB,4CAA4C,EAAE,KAAK;YACnD,oBAAoB,EAAE,KAAK;YAC3B,2CAA2C,EAAE,IAAI;YACjD,qCAAqC,EAAE,KAAK;YAC5C,0CAA0C,EAAE,KAAK;SAClD,CAAA;QACD,gBAAgB,CAAC,SAAS,GAAG,SAAS,CAAA;QACtC,gBAAgB,CAAC,WAAW,CAAC,GAAG,SAAS,CAAA;KAC1C;AACH,CAAC","sourcesContent":["import BluebirdPromise from \"bluebird-lst\"\nimport { asArray, getPlatformIconFileName, InvalidConfigurationError, log } from \"builder-util\"\nimport { copyOrLinkFile, unlinkIfExists } from \"builder-util/out/fs\"\nimport { rename, utimes } from \"fs/promises\"\nimport * as path from \"path\"\nimport { filterCFBundleIdentifier } from \"../appInfo\"\nimport { AsarIntegrity } from \"../asar/integrity\"\nimport MacPackager from \"../macPackager\"\nimport { normalizeExt } from \"../platformPackager\"\nimport { executeAppBuilderAndWriteJson, executeAppBuilderAsJson } from \"../util/appBuilder\"\nimport { createBrandingOpts } from \"./ElectronFramework\"\n\nfunction doRename(basePath: string, oldName: string, newName: string) {\n return rename(path.join(basePath, oldName), path.join(basePath, newName))\n}\n\nfunction moveHelpers(helperSuffixes: Array<string>, frameworksPath: string, appName: string, prefix: string): Promise<any> {\n return BluebirdPromise.map(helperSuffixes, suffix => {\n const executableBasePath = path.join(frameworksPath, `${prefix}${suffix}.app`, \"Contents\", \"MacOS\")\n return doRename(executableBasePath, `${prefix}${suffix}`, appName + suffix).then(() => doRename(frameworksPath, `${prefix}${suffix}.app`, `${appName}${suffix}.app`))\n })\n}\n\nfunction getAvailableHelperSuffixes(\n helperEHPlist: string | null,\n helperNPPlist: string | null,\n helperRendererPlist: string | null,\n helperPluginPlist: string | null,\n helperGPUPlist: string | null\n) {\n const result = [\" Helper\"]\n if (helperEHPlist != null) {\n result.push(\" Helper EH\")\n }\n if (helperNPPlist != null) {\n result.push(\" Helper NP\")\n }\n if (helperRendererPlist != null) {\n result.push(\" Helper (Renderer)\")\n }\n if (helperPluginPlist != null) {\n result.push(\" Helper (Plugin)\")\n }\n if (helperGPUPlist != null) {\n result.push(\" Helper (GPU)\")\n }\n return result\n}\n\n/** @internal */\nexport async function createMacApp(packager: MacPackager, appOutDir: string, asarIntegrity: AsarIntegrity | null, isMas: boolean) {\n const appInfo = packager.appInfo\n const appFilename = appInfo.productFilename\n const electronBranding = createBrandingOpts(packager.config)\n\n const contentsPath = path.join(appOutDir, packager.info.framework.distMacOsAppName, \"Contents\")\n const frameworksPath = path.join(contentsPath, \"Frameworks\")\n const loginItemPath = path.join(contentsPath, \"Library\", \"LoginItems\")\n\n const appPlistFilename = path.join(contentsPath, \"Info.plist\")\n const helperPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper.app`, \"Contents\", \"Info.plist\")\n const helperEHPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper EH.app`, \"Contents\", \"Info.plist\")\n const helperNPPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper NP.app`, \"Contents\", \"Info.plist\")\n const helperRendererPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper (Renderer).app`, \"Contents\", \"Info.plist\")\n const helperPluginPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper (Plugin).app`, \"Contents\", \"Info.plist\")\n const helperGPUPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper (GPU).app`, \"Contents\", \"Info.plist\")\n const helperLoginPlistFilename = path.join(loginItemPath, `${electronBranding.productName} Login Helper.app`, \"Contents\", \"Info.plist\")\n\n const plistContent: Array<any> = await executeAppBuilderAsJson([\n \"decode-plist\",\n \"-f\",\n appPlistFilename,\n \"-f\",\n helperPlistFilename,\n \"-f\",\n helperEHPlistFilename,\n \"-f\",\n helperNPPlistFilename,\n \"-f\",\n helperRendererPlistFilename,\n \"-f\",\n helperPluginPlistFilename,\n \"-f\",\n helperGPUPlistFilename,\n \"-f\",\n helperLoginPlistFilename,\n ])\n\n if (plistContent[0] == null) {\n throw new Error(\"corrupted Electron dist\")\n }\n\n const appPlist = plistContent[0]!\n const helperPlist = plistContent[1]!\n const helperEHPlist = plistContent[2]\n const helperNPPlist = plistContent[3]\n const helperRendererPlist = plistContent[4]\n const helperPluginPlist = plistContent[5]\n const helperGPUPlist = plistContent[6]\n const helperLoginPlist = plistContent[7]\n\n // if an extend-info file was supplied, copy its contents in first\n if (plistContent[8] != null) {\n Object.assign(appPlist, plistContent[8])\n }\n\n const buildMetadata = packager.config\n\n /**\n * Configure bundleIdentifier for the generic Electron Helper process\n *\n * This was the only Helper in Electron 5 and before. Allow users to configure\n * the bundleIdentifier for continuity.\n */\n\n const oldHelperBundleId = (buildMetadata as any)[\"helper-bundle-id\"]\n if (oldHelperBundleId != null) {\n log.warn(\"build.helper-bundle-id is deprecated, please set as build.mac.helperBundleId\")\n }\n const helperBundleIdentifier = filterCFBundleIdentifier(packager.platformSpecificBuildOptions.helperBundleId || oldHelperBundleId || `${appInfo.macBundleIdentifier}.helper`)\n\n await packager.applyCommonInfo(appPlist, contentsPath)\n\n // required for electron-updater proxy\n if (!isMas) {\n configureLocalhostAts(appPlist)\n }\n\n helperPlist.CFBundleExecutable = `${appFilename} Helper`\n helperPlist.CFBundleDisplayName = `${appInfo.productName} Helper`\n helperPlist.CFBundleIdentifier = helperBundleIdentifier\n helperPlist.CFBundleVersion = appPlist.CFBundleVersion\n\n /**\n * Configure bundleIdentifier for Electron 5+ Helper processes\n *\n * In Electron 6, parts of the generic Electron Helper process were split into\n * individual helper processes. Allow users to configure the bundleIdentifiers\n * for continuity, specifically because macOS keychain access relies on\n * bundleIdentifiers not changing (i.e. across versions of Electron).\n */\n\n function configureHelper(helper: any, postfix: string, userProvidedBundleIdentifier?: string | null) {\n helper.CFBundleExecutable = `${appFilename} Helper ${postfix}`\n helper.CFBundleDisplayName = `${appInfo.productName} Helper ${postfix}`\n helper.CFBundleIdentifier = userProvidedBundleIdentifier\n ? filterCFBundleIdentifier(userProvidedBundleIdentifier)\n : filterCFBundleIdentifier(`${helperBundleIdentifier}.${postfix}`)\n helper.CFBundleVersion = appPlist.CFBundleVersion\n }\n\n if (helperRendererPlist != null) {\n configureHelper(helperRendererPlist, \"(Renderer)\", packager.platformSpecificBuildOptions.helperRendererBundleId)\n }\n if (helperPluginPlist != null) {\n configureHelper(helperPluginPlist, \"(Plugin)\", packager.platformSpecificBuildOptions.helperPluginBundleId)\n }\n if (helperGPUPlist != null) {\n configureHelper(helperGPUPlist, \"(GPU)\", packager.platformSpecificBuildOptions.helperGPUBundleId)\n }\n if (helperEHPlist != null) {\n configureHelper(helperEHPlist, \"EH\", packager.platformSpecificBuildOptions.helperEHBundleId)\n }\n if (helperNPPlist != null) {\n configureHelper(helperNPPlist, \"NP\", packager.platformSpecificBuildOptions.helperNPBundleId)\n }\n if (helperLoginPlist != null) {\n helperLoginPlist.CFBundleExecutable = `${appFilename} Login Helper`\n helperLoginPlist.CFBundleDisplayName = `${appInfo.productName} Login Helper`\n // noinspection SpellCheckingInspection\n helperLoginPlist.CFBundleIdentifier = `${appInfo.macBundleIdentifier}.loginhelper`\n helperLoginPlist.CFBundleVersion = appPlist.CFBundleVersion\n }\n\n const protocols = asArray(buildMetadata.protocols).concat(asArray(packager.platformSpecificBuildOptions.protocols))\n if (protocols.length > 0) {\n appPlist.CFBundleURLTypes = protocols.map(protocol => {\n const schemes = asArray(protocol.schemes)\n if (schemes.length === 0) {\n throw new InvalidConfigurationError(`Protocol \"${protocol.name}\": must be at least one scheme specified`)\n }\n return {\n CFBundleURLName: protocol.name,\n CFBundleTypeRole: protocol.role || \"Editor\",\n CFBundleURLSchemes: schemes.slice(),\n }\n })\n }\n\n const fileAssociations = packager.fileAssociations\n if (fileAssociations.length > 0) {\n appPlist.CFBundleDocumentTypes = await BluebirdPromise.map(fileAssociations, async fileAssociation => {\n const extensions = asArray(fileAssociation.ext).map(normalizeExt)\n const customIcon = await packager.getResource(getPlatformIconFileName(fileAssociation.icon, true), `${extensions[0]}.icns`)\n let iconFile = appPlist.CFBundleIconFile\n if (customIcon != null) {\n iconFile = path.basename(customIcon)\n await copyOrLinkFile(customIcon, path.join(path.join(contentsPath, \"Resources\"), iconFile))\n }\n\n const result = {\n CFBundleTypeExtensions: extensions,\n CFBundleTypeName: fileAssociation.name || extensions[0],\n CFBundleTypeRole: fileAssociation.role || \"Editor\",\n LSHandlerRank: fileAssociation.rank || \"Default\",\n CFBundleTypeIconFile: iconFile,\n } as any\n\n if (fileAssociation.isPackage) {\n result.LSTypeIsPackage = true\n }\n return result\n })\n }\n\n if (asarIntegrity != null) {\n appPlist.ElectronAsarIntegrity = asarIntegrity\n }\n\n const plistDataToWrite: any = {\n [appPlistFilename]: appPlist,\n [helperPlistFilename]: helperPlist,\n }\n if (helperEHPlist != null) {\n plistDataToWrite[helperEHPlistFilename] = helperEHPlist\n }\n if (helperNPPlist != null) {\n plistDataToWrite[helperNPPlistFilename] = helperNPPlist\n }\n if (helperRendererPlist != null) {\n plistDataToWrite[helperRendererPlistFilename] = helperRendererPlist\n }\n if (helperPluginPlist != null) {\n plistDataToWrite[helperPluginPlistFilename] = helperPluginPlist\n }\n if (helperGPUPlist != null) {\n plistDataToWrite[helperGPUPlistFilename] = helperGPUPlist\n }\n if (helperLoginPlist != null) {\n plistDataToWrite[helperLoginPlistFilename] = helperLoginPlist\n }\n\n await Promise.all([\n executeAppBuilderAndWriteJson([\"encode-plist\"], plistDataToWrite),\n doRename(path.join(contentsPath, \"MacOS\"), electronBranding.productName, appPlist.CFBundleExecutable),\n unlinkIfExists(path.join(appOutDir, \"LICENSE\")),\n unlinkIfExists(path.join(appOutDir, \"LICENSES.chromium.html\")),\n ])\n\n await moveHelpers(\n getAvailableHelperSuffixes(helperEHPlist, helperNPPlist, helperRendererPlist, helperPluginPlist, helperGPUPlist),\n frameworksPath,\n appFilename,\n electronBranding.productName\n )\n\n if (helperLoginPlist != null) {\n const prefix = electronBranding.productName\n const suffix = \" Login Helper\"\n const executableBasePath = path.join(loginItemPath, `${prefix}${suffix}.app`, \"Contents\", \"MacOS\")\n await doRename(executableBasePath, `${prefix}${suffix}`, appFilename + suffix).then(() => doRename(loginItemPath, `${prefix}${suffix}.app`, `${appFilename}${suffix}.app`))\n }\n\n const appPath = path.join(appOutDir, `${appFilename}.app`)\n await rename(path.dirname(contentsPath), appPath)\n // https://github.com/electron-userland/electron-builder/issues/840\n const now = Date.now() / 1000\n await utimes(appPath, now, now)\n}\n\nfunction configureLocalhostAts(appPlist: any) {\n // https://bencoding.com/2015/07/20/app-transport-security-and-localhost/\n let ats = appPlist.NSAppTransportSecurity\n if (ats == null) {\n ats = {}\n appPlist.NSAppTransportSecurity = ats\n }\n\n ats.NSAllowsLocalNetworking = true\n // https://github.com/electron-userland/electron-builder/issues/3377#issuecomment-446035814\n ats.NSAllowsArbitraryLoads = true\n\n let exceptionDomains = ats.NSExceptionDomains\n if (exceptionDomains == null) {\n exceptionDomains = {}\n ats.NSExceptionDomains = exceptionDomains\n }\n\n if (exceptionDomains.localhost == null) {\n const allowHttp = {\n NSTemporaryExceptionAllowsInsecureHTTPSLoads: false,\n NSIncludesSubdomains: false,\n NSTemporaryExceptionAllowsInsecureHTTPLoads: true,\n NSTemporaryExceptionMinimumTLSVersion: \"1.0\",\n NSTemporaryExceptionRequiresForwardSecrecy: false,\n }\n exceptionDomains.localhost = allowHttp\n exceptionDomains[\"127.0.0.1\"] = allowHttp\n }\n}\n"]}
|
|
@@ -11,9 +11,9 @@ const read_config_file_1 = require("read-config-file");
|
|
|
11
11
|
const semver = require("semver");
|
|
12
12
|
const config_1 = require("../util/config");
|
|
13
13
|
const electronPackages = ["electron", "electron-prebuilt", "electron-prebuilt-compile", "electron-nightly"];
|
|
14
|
-
async function getElectronVersion(projectDir, config, projectMetadata = new lazy_val_1.Lazy(() => read_config_file_1.orNullIfFileNotExist(fs_extra_1.readJson(path.join(projectDir, "package.json"))))) {
|
|
14
|
+
async function getElectronVersion(projectDir, config, projectMetadata = new lazy_val_1.Lazy(() => (0, read_config_file_1.orNullIfFileNotExist)((0, fs_extra_1.readJson)(path.join(projectDir, "package.json"))))) {
|
|
15
15
|
if (config == null) {
|
|
16
|
-
config = await config_1.getConfig(projectDir, null, null);
|
|
16
|
+
config = await (0, config_1.getConfig)(projectDir, null, null);
|
|
17
17
|
}
|
|
18
18
|
if (config.electronVersion != null) {
|
|
19
19
|
return config.electronVersion;
|
|
@@ -24,7 +24,7 @@ exports.getElectronVersion = getElectronVersion;
|
|
|
24
24
|
async function getElectronVersionFromInstalled(projectDir) {
|
|
25
25
|
for (const name of electronPackages) {
|
|
26
26
|
try {
|
|
27
|
-
return (await fs_extra_1.readJson(path.join(projectDir, "node_modules", name, "package.json"))).version;
|
|
27
|
+
return (await (0, fs_extra_1.readJson)(path.join(projectDir, "node_modules", name, "package.json"))).version;
|
|
28
28
|
}
|
|
29
29
|
catch (e) {
|
|
30
30
|
if (e.code !== "ENOENT") {
|
|
@@ -38,7 +38,7 @@ exports.getElectronVersionFromInstalled = getElectronVersionFromInstalled;
|
|
|
38
38
|
async function getElectronPackage(projectDir) {
|
|
39
39
|
for (const name of electronPackages) {
|
|
40
40
|
try {
|
|
41
|
-
return await fs_extra_1.readJson(path.join(projectDir, "node_modules", name, "package.json"));
|
|
41
|
+
return await (0, fs_extra_1.readJson)(path.join(projectDir, "node_modules", name, "package.json"));
|
|
42
42
|
}
|
|
43
43
|
catch (e) {
|
|
44
44
|
if (e.code !== "ENOENT") {
|
|
@@ -65,7 +65,7 @@ async function computeElectronVersion(projectDir, projectMetadata) {
|
|
|
65
65
|
accept: "application/xml, application/atom+xml, text/xml, */*",
|
|
66
66
|
},
|
|
67
67
|
});
|
|
68
|
-
const feed = builder_util_runtime_1.parseXml(feedXml);
|
|
68
|
+
const feed = (0, builder_util_runtime_1.parseXml)(feedXml);
|
|
69
69
|
const latestRelease = feed.element("entry", false, `No published versions on GitHub`);
|
|
70
70
|
const v = /\/tag\/v?([^/]+)$/.exec(latestRelease.element("link").attribute("href"))[1];
|
|
71
71
|
return v.startsWith("v") ? v.substring(1) : v;
|