app-builder-lib 26.0.7 → 26.0.9

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.
Files changed (62) hide show
  1. package/out/configuration.d.ts +8 -8
  2. package/out/configuration.js.map +1 -1
  3. package/out/index.js +5 -2
  4. package/out/index.js.map +1 -1
  5. package/out/macPackager.js +2 -2
  6. package/out/macPackager.js.map +1 -1
  7. package/out/node-module-collector/index.d.ts +3 -0
  8. package/out/node-module-collector/index.js +13 -2
  9. package/out/node-module-collector/index.js.map +1 -1
  10. package/out/node-module-collector/nodeModulesCollector.d.ts +20 -11
  11. package/out/node-module-collector/nodeModulesCollector.js +113 -86
  12. package/out/node-module-collector/nodeModulesCollector.js.map +1 -1
  13. package/out/node-module-collector/npmNodeModulesCollector.d.ts +13 -5
  14. package/out/node-module-collector/npmNodeModulesCollector.js +47 -18
  15. package/out/node-module-collector/npmNodeModulesCollector.js.map +1 -1
  16. package/out/node-module-collector/pnpmNodeModulesCollector.d.ts +14 -5
  17. package/out/node-module-collector/pnpmNodeModulesCollector.js +53 -15
  18. package/out/node-module-collector/pnpmNodeModulesCollector.js.map +1 -1
  19. package/out/node-module-collector/types.d.ts +17 -19
  20. package/out/node-module-collector/types.js.map +1 -1
  21. package/out/node-module-collector/yarnNodeModulesCollector.d.ts +5 -0
  22. package/out/node-module-collector/yarnNodeModulesCollector.js +5 -0
  23. package/out/node-module-collector/yarnNodeModulesCollector.js.map +1 -1
  24. package/out/packager.d.ts +32 -12
  25. package/out/packager.js +51 -55
  26. package/out/packager.js.map +1 -1
  27. package/out/platformPackager.js +23 -33
  28. package/out/platformPackager.js.map +1 -1
  29. package/out/publish/PublishManager.d.ts +2 -2
  30. package/out/publish/PublishManager.js +23 -23
  31. package/out/publish/PublishManager.js.map +1 -1
  32. package/out/publish/updateInfoBuilder.js +2 -2
  33. package/out/publish/updateInfoBuilder.js.map +1 -1
  34. package/out/targets/AppImageTarget.js +2 -2
  35. package/out/targets/AppImageTarget.js.map +1 -1
  36. package/out/targets/AppxTarget.js +3 -3
  37. package/out/targets/AppxTarget.js.map +1 -1
  38. package/out/targets/ArchiveTarget.js +2 -2
  39. package/out/targets/ArchiveTarget.js.map +1 -1
  40. package/out/targets/FlatpakTarget.js +2 -2
  41. package/out/targets/FlatpakTarget.js.map +1 -1
  42. package/out/targets/FpmTarget.js +2 -2
  43. package/out/targets/FpmTarget.js.map +1 -1
  44. package/out/targets/MsiTarget.js +3 -3
  45. package/out/targets/MsiTarget.js.map +1 -1
  46. package/out/targets/differentialUpdateInfoBuilder.js +1 -1
  47. package/out/targets/differentialUpdateInfoBuilder.js.map +1 -1
  48. package/out/targets/nsis/NsisTarget.js +2 -2
  49. package/out/targets/nsis/NsisTarget.js.map +1 -1
  50. package/out/targets/pkg.js +1 -1
  51. package/out/targets/pkg.js.map +1 -1
  52. package/out/targets/snap.js +7 -9
  53. package/out/targets/snap.js.map +1 -1
  54. package/out/util/asyncEventEmitter.d.ts +33 -0
  55. package/out/util/asyncEventEmitter.js +63 -0
  56. package/out/util/asyncEventEmitter.js.map +1 -0
  57. package/out/util/resolve.js +1 -0
  58. package/out/util/resolve.js.map +1 -1
  59. package/out/version.d.ts +1 -1
  60. package/out/version.js +1 -1
  61. package/out/version.js.map +1 -1
  62. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"file":"ArchiveTarget.js","sourceRoot":"","sources":["../../src/targets/ArchiveTarget.ts"],"names":[],"mappings":";;;AAAA,+CAA0D;AAC1D,6BAA4B;AAC5B,kCAAiE;AACjE,gDAA2D;AAE3D,uCAAwC;AACxC,mFAAgF;AAEhF,MAAa,aAAc,SAAQ,aAAM;IAGvC,YACE,IAAY,EACH,MAAc,EACN,QAA+B,EAC/B,oBAAoB,KAAK;QAE1C,KAAK,CAAC,IAAI,CAAC,CAAA;QAJF,WAAM,GAAN,MAAM,CAAQ;QACN,aAAQ,GAAR,QAAQ,CAAuB;QAC/B,sBAAiB,GAAjB,iBAAiB,C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I,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAA;gBAC/E,CAAC;qBAAM,CAAC;oBACN,UAAU,GAAG,MAAM,IAAA,8CAAc,EAAC,YAAY,CAAC,CAAA;gBACjD,CAAC;YACH,CAAC;QACH,CAAC;QAED,MAAM,QAAQ,CAAC,IAAI,CAAC,0BAA0B,CAAC;YAC7C,UAAU;YACV,IAAI,EAAE,YAAY;YAClB,uDAAuD;YACvD,gBAAgB,EAAE,QAAQ,CAAC,uBAAuB,CAChD,YAAY,EACZ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,QAAQ,CAAC,4BAA4B,CAAC,WAAW,EACjD,cAAc,CAAC,OAAO,CAAC,gBAAgB,EAAE,SAAS,CAAC,CACpD;YACD,MAAM,EAAE,IAAI;YACZ,IAAI;YACJ,QAAQ;YACR,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;SAC1C,CAAC,CAAA;IACJ,CAAC;CACF;AA1FD,sCA0FC","sourcesContent":["import { Arch, defaultArchFromString } from \"builder-util\"\nimport * as path from \"path\"\nimport { Platform, Target, TargetSpecificOptions } from \"../core\"\nimport { copyFiles, getFileMatchers } from \"../fileMatcher\"\nimport { PlatformPackager } from \"../platformPackager\"\nimport { archive, tar } from \"./archive\"\nimport { appendBlockmap, createBlockmap } from \"./differentialUpdateInfoBuilder\"\n\nexport class ArchiveTarget extends Target {\n readonly options: TargetSpecificOptions = (this.packager.config as any)[this.name]\n\n constructor(\n name: string,\n readonly outDir: string,\n private readonly packager: PlatformPackager<any>,\n private readonly isWriteUpdateInfo = false\n ) {\n super(name)\n }\n\n async build(appOutDir: string, arch: Arch): Promise<any> {\n const packager = this.packager\n const isMac = packager.platform === Platform.MAC\n const format = this.name\n\n let defaultPattern: string\n const defaultArch: Arch = defaultArchFromString(packager.platformSpecificBuildOptions.defaultArch)\n if (packager.platform === Platform.LINUX) {\n // tslint:disable-next-line:no-invalid-template-strings\n defaultPattern = \"${name}-${version}\" + (arch === defaultArch ? \"\" : \"-${arch}\") + \".${ext}\"\n } else {\n // tslint:disable-next-line:no-invalid-template-strings\n defaultPattern = \"${productName}-${version}\" + (arch === defaultArch ? \"\" : \"-${arch}\") + \"-${os}.${ext}\"\n }\n\n const artifactName = packager.expandArtifactNamePattern(this.options, format, arch, defaultPattern, false)\n const artifactPath = path.join(this.outDir, artifactName)\n\n await packager.info.callArtifactBuildStarted({\n targetPresentableName: `${isMac ? \"macOS \" : \"\"}${format}`,\n file: artifactPath,\n arch,\n })\n let updateInfo: any = null\n if (format.startsWith(\"tar.\")) {\n await tar(packager.compression, format, artifactPath, appOutDir, isMac, packager.info.tempDirManager)\n } else {\n let withoutDir = !isMac\n let dirToArchive = appOutDir\n if (isMac) {\n dirToArchive = path.dirname(appOutDir)\n const fileMatchers = getFileMatchers(\n packager.config,\n \"extraDistFiles\",\n dirToArchive,\n packager.createGetFileMatchersOptions(this.outDir, arch, packager.platformSpecificBuildOptions)\n )\n if (fileMatchers == null) {\n dirToArchive = appOutDir\n } else {\n await copyFiles(fileMatchers, null, true)\n withoutDir = true\n }\n }\n\n const archiveOptions = {\n compression: packager.compression,\n withoutDir,\n }\n await archive(format, artifactPath, dirToArchive, archiveOptions)\n\n if (this.isWriteUpdateInfo && format === \"zip\") {\n if (isMac) {\n updateInfo = await createBlockmap(artifactPath, this, packager, artifactName)\n } else {\n updateInfo = await appendBlockmap(artifactPath)\n }\n }\n }\n\n await packager.info.callArtifactBuildCompleted({\n updateInfo,\n file: artifactPath,\n // tslint:disable-next-line:no-invalid-template-strings\n safeArtifactName: packager.computeSafeArtifactName(\n artifactName,\n format,\n arch,\n false,\n packager.platformSpecificBuildOptions.defaultArch,\n defaultPattern.replace(\"${productName}\", \"${name}\")\n ),\n target: this,\n arch,\n packager,\n isWriteUpdateInfo: this.isWriteUpdateInfo,\n })\n }\n}\n"]}
1
+ {"version":3,"file":"ArchiveTarget.js","sourceRoot":"","sources":["../../src/targets/ArchiveTarget.ts"],"names":[],"mappings":";;;AAAA,+CAA0D;AA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,WAAW,EAAE,QAAQ,CAAC,WAAW;gBACjC,UAAU;aACX,CAAA;YACD,MAAM,IAAA,iBAAO,EAAC,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,CAAC,CAAA;YAEjE,IAAI,IAAI,CAAC,iBAAiB,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;gBAC/C,IAAI,KAAK,EAAE,CAAC;oBACV,UAAU,GAAG,MAAM,IAAA,8CAAc,EAAC,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAA;gBAC/E,CAAC;qBAAM,CAAC;oBACN,UAAU,GAAG,MAAM,IAAA,8CAAc,EAAC,YAAY,CAAC,CAAA;gBACjD,CAAC;YACH,CAAC;QACH,CAAC;QAED,MAAM,QAAQ,CAAC,IAAI,CAAC,0BAA0B,CAAC;YAC7C,UAAU;YACV,IAAI,EAAE,YAAY;YAClB,uDAAuD;YACvD,gBAAgB,EAAE,QAAQ,CAAC,uBAAuB,CAChD,YAAY,EACZ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,QAAQ,CAAC,4BAA4B,CAAC,WAAW,EACjD,cAAc,CAAC,OAAO,CAAC,gBAAgB,EAAE,SAAS,CAAC,CACpD;YACD,MAAM,EAAE,IAAI;YACZ,IAAI;YACJ,QAAQ;YACR,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;SAC1C,CAAC,CAAA;IACJ,CAAC;CACF;AA1FD,sCA0FC","sourcesContent":["import { Arch, defaultArchFromString } from \"builder-util\"\nimport * as path from \"path\"\nimport { Platform, Target, TargetSpecificOptions } from \"../core\"\nimport { copyFiles, getFileMatchers } from \"../fileMatcher\"\nimport { PlatformPackager } from \"../platformPackager\"\nimport { archive, tar } from \"./archive\"\nimport { appendBlockmap, createBlockmap } from \"./differentialUpdateInfoBuilder\"\n\nexport class ArchiveTarget extends Target {\n readonly options: TargetSpecificOptions = (this.packager.config as any)[this.name]\n\n constructor(\n name: string,\n readonly outDir: string,\n private readonly packager: PlatformPackager<any>,\n private readonly isWriteUpdateInfo = false\n ) {\n super(name)\n }\n\n async build(appOutDir: string, arch: Arch): Promise<any> {\n const packager = this.packager\n const isMac = packager.platform === Platform.MAC\n const format = this.name\n\n let defaultPattern: string\n const defaultArch: Arch = defaultArchFromString(packager.platformSpecificBuildOptions.defaultArch)\n if (packager.platform === Platform.LINUX) {\n // tslint:disable-next-line:no-invalid-template-strings\n defaultPattern = \"${name}-${version}\" + (arch === defaultArch ? \"\" : \"-${arch}\") + \".${ext}\"\n } else {\n // tslint:disable-next-line:no-invalid-template-strings\n defaultPattern = \"${productName}-${version}\" + (arch === defaultArch ? \"\" : \"-${arch}\") + \"-${os}.${ext}\"\n }\n\n const artifactName = packager.expandArtifactNamePattern(this.options, format, arch, defaultPattern, false)\n const artifactPath = path.join(this.outDir, artifactName)\n\n await packager.info.emitArtifactBuildStarted({\n targetPresentableName: `${isMac ? \"macOS \" : \"\"}${format}`,\n file: artifactPath,\n arch,\n })\n let updateInfo: any = null\n if (format.startsWith(\"tar.\")) {\n await tar(packager.compression, format, artifactPath, appOutDir, isMac, packager.info.tempDirManager)\n } else {\n let withoutDir = !isMac\n let dirToArchive = appOutDir\n if (isMac) {\n dirToArchive = path.dirname(appOutDir)\n const fileMatchers = getFileMatchers(\n packager.config,\n \"extraDistFiles\",\n dirToArchive,\n packager.createGetFileMatchersOptions(this.outDir, arch, packager.platformSpecificBuildOptions)\n )\n if (fileMatchers == null) {\n dirToArchive = appOutDir\n } else {\n await copyFiles(fileMatchers, null, true)\n withoutDir = true\n }\n }\n\n const archiveOptions = {\n compression: packager.compression,\n withoutDir,\n }\n await archive(format, artifactPath, dirToArchive, archiveOptions)\n\n if (this.isWriteUpdateInfo && format === \"zip\") {\n if (isMac) {\n updateInfo = await createBlockmap(artifactPath, this, packager, artifactName)\n } else {\n updateInfo = await appendBlockmap(artifactPath)\n }\n }\n }\n\n await packager.info.emitArtifactBuildCompleted({\n updateInfo,\n file: artifactPath,\n // tslint:disable-next-line:no-invalid-template-strings\n safeArtifactName: packager.computeSafeArtifactName(\n artifactName,\n format,\n arch,\n false,\n packager.platformSpecificBuildOptions.defaultArch,\n defaultPattern.replace(\"${productName}\", \"${name}\")\n ),\n target: this,\n arch,\n packager,\n isWriteUpdateInfo: this.isWriteUpdateInfo,\n })\n }\n}\n"]}
@@ -25,7 +25,7 @@ class FlatpakTarget extends core_1.Target {
25
25
  const { packager, options } = this;
26
26
  const artifactName = packager.expandArtifactNamePattern(options, "flatpak", arch, undefined, false);
27
27
  const artifactPath = path.join(this.outDir, artifactName);
28
- await packager.info.callArtifactBuildStarted({
28
+ await packager.info.emitArtifactBuildStarted({
29
29
  targetPresentableName: "flatpak",
30
30
  file: artifactPath,
31
31
  arch,
@@ -34,7 +34,7 @@ class FlatpakTarget extends core_1.Target {
34
34
  const { manifest, buildOptions } = this.getFlatpakBuilderOptions(appOutDir, stageDir.dir, artifactName, arch);
35
35
  await (0, flatpak_bundler_1.bundle)(manifest, buildOptions);
36
36
  await stageDir.cleanup();
37
- await packager.info.callArtifactBuildCompleted({
37
+ await packager.info.emitArtifactBuildCompleted({
38
38
  file: artifactPath,
39
39
  safeArtifactName: packager.computeSafeArtifactName(artifactName, "flatpak", arch, false),
40
40
  target: this,
@@ -1 +1 @@
1
- {"version":3,"file":"FlatpakTarget.js","sourceRoot":"","sources":["../../src/targets/FlatpakTarget.ts"],"names":[],"mappings":";;AAAA,6DAA8G;AAC9G,+CAAgE;AAChE,uCAA4C;AAC5C,6BAA4B;AAC5B,kCAAgC;AAGhC,6CAA4D;AAE5D,6CAAuD;AAEvD,MAAqB,aAAc,SAAQ,aAAM;IAM/C,YACE,IAAY,EACK,QAAuB,EAChC,MAAyB,EACxB,MAAc;QAEvB,KAAK,CAAC,IAAI,CAAC,CAAA;QAJM,aAAQ,GAAR,QAAQ,CAAe;QAChC,WAAM,GAAN,MAAM,CAAmB;QACxB,WAAM,GAAN,MAAM,CAAQ;QAThB,YAAO,GAAmB;YACjC,GAAG,IAA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QACG,CAAC,CAAC;;;;iBAIW,cAAc;CAC9B,CAAA;AACD,CAAC;AAED,SAAS,0BAA0B,CAAC,UAAkB;IACpD,sGAAsG;IACtG,6FAA6F;IAC7F,OAAO,UAAU,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAA;AACrE,CAAC","sourcesContent":["import { bundle as bundleFlatpak, FlatpakBundlerBuildOptions, FlatpakManifest } from \"@malept/flatpak-bundler\"\nimport { Arch, copyFile, toLinuxArchString } from \"builder-util\"\nimport { chmod, outputFile } from \"fs-extra\"\nimport * as path from \"path\"\nimport { Target } from \"../core\"\nimport { LinuxPackager } from \"../linuxPackager\"\nimport { FlatpakOptions } from \"../options/linuxOptions\"\nimport { getNotLocalizedLicenseFile } from \"../util/license\"\nimport { LinuxTargetHelper } from \"./LinuxTargetHelper\"\nimport { createStageDir, StageDir } from \"./targetUtil\"\n\nexport default class FlatpakTarget extends Target {\n readonly options: FlatpakOptions = {\n ...this.packager.platformSpecificBuildOptions,\n ...(this.packager.config as any)[this.name],\n }\n\n constructor(\n name: string,\n private readonly packager: LinuxPackager,\n private helper: LinuxTargetHelper,\n readonly outDir: string\n ) {\n super(name)\n }\n\n get appId(): string {\n return filterFlatpakAppIdentifier(this.packager.appInfo.id)\n }\n\n async build(appOutDir: string, arch: Arch): Promise<any> {\n const { packager, options } = this\n const artifactName = packager.expandArtifactNamePattern(options, \"flatpak\", arch, undefined, false)\n const artifactPath = path.join(this.outDir, artifactName)\n await packager.info.callArtifactBuildStarted({\n targetPresentableName: \"flatpak\",\n file: artifactPath,\n arch,\n })\n\n const stageDir = await this.prepareStageDir(arch)\n\n const { manifest, buildOptions } = this.getFlatpakBuilderOptions(appOutDir, stageDir.dir, artifactName, arch)\n await bundleFlatpak(manifest, buildOptions)\n\n await stageDir.cleanup()\n\n await packager.info.callArtifactBuildCompleted({\n file: artifactPath,\n safeArtifactName: packager.computeSafeArtifactName(artifactName, \"flatpak\", arch, false),\n target: this,\n arch,\n packager,\n isWriteUpdateInfo: false,\n })\n }\n\n private async prepareStageDir(arch: Arch): Promise<StageDir> {\n const stageDir = await createStageDir(this, this.packager, arch)\n\n await Promise.all([this.createSandboxBinWrapper(stageDir), this.createDesktopFile(stageDir), this.copyLicenseFile(stageDir), this.copyIcons(stageDir)])\n\n return stageDir\n }\n\n private async createSandboxBinWrapper(stageDir: StageDir) {\n const useWaylandFlags = !!this.options.useWaylandFlags\n const electronWrapperPath = stageDir.getTempFile(path.join(\"bin\", \"electron-wrapper\"))\n await outputFile(electronWrapperPath, getElectronWrapperScript(this.packager.executableName, useWaylandFlags))\n await chmod(electronWrapperPath, 0o755)\n }\n\n private async createDesktopFile(stageDir: StageDir) {\n const appIdentifier = this.appId\n const desktopFile = stageDir.getTempFile(path.join(\"share\", \"applications\", `${appIdentifier}.desktop`))\n await this.helper.writeDesktopEntry(this.options, \"electron-wrapper %U\", desktopFile, { Icon: appIdentifier })\n }\n\n private async copyLicenseFile(stageDir: StageDir) {\n const licenseSrc = await getNotLocalizedLicenseFile(this.options.license, this.packager, [\"txt\", \"html\"])\n if (licenseSrc) {\n const licenseDst = stageDir.getTempFile(path.join(\"share\", \"doc\", this.appId, \"copyright\"))\n await copyFile(licenseSrc, licenseDst)\n }\n }\n\n private async copyIcons(stageDir: StageDir) {\n const icons = await this.helper.icons\n const copyIcons = icons.map(async icon => {\n if (icon.size > 512) {\n // Flatpak does not allow icons larger than 512 pixels\n return Promise.resolve()\n }\n const extWithDot = path.extname(icon.file)\n const sizeName = extWithDot === \".svg\" ? \"scalable\" : `${icon.size}x${icon.size}`\n const iconDst = stageDir.getTempFile(path.join(\"share\", \"icons\", \"hicolor\", sizeName, \"apps\", `${this.appId}${extWithDot}`))\n\n return copyFile(icon.file, iconDst)\n })\n\n await Promise.all(copyIcons)\n }\n\n private getFlatpakBuilderOptions(appOutDir: string, stageDir: string, artifactName: string, arch: Arch): { manifest: FlatpakManifest; buildOptions: FlatpakBundlerBuildOptions } {\n const appIdentifier = this.appId\n const { executableName } = this.packager\n const flatpakArch = toLinuxArchString(arch, \"flatpak\")\n\n const manifest: FlatpakManifest = {\n id: appIdentifier,\n command: \"electron-wrapper\",\n runtime: this.options.runtime || flatpakBuilderDefaults.runtime,\n runtimeVersion: this.options.runtimeVersion || flatpakBuilderDefaults.runtimeVersion,\n sdk: this.options.sdk || flatpakBuilderDefaults.sdk,\n base: this.options.base || flatpakBuilderDefaults.base,\n baseVersion: this.options.baseVersion || flatpakBuilderDefaults.baseVersion,\n finishArgs: this.options.finishArgs || flatpakBuilderDefaults.finishArgs,\n branch: this.options.branch,\n modules: this.options.modules,\n }\n\n const buildOptions: FlatpakBundlerBuildOptions = {\n baseFlatpakref: `app/${manifest.base}/${flatpakArch}/${manifest.baseVersion}`,\n runtimeFlatpakref: `runtime/${manifest.runtime}/${flatpakArch}/${manifest.runtimeVersion}`,\n sdkFlatpakref: `runtime/${manifest.sdk}/${flatpakArch}/${manifest.runtimeVersion}`,\n arch: flatpakArch as any,\n bundlePath: path.join(this.outDir, artifactName),\n files: [[stageDir, \"/\"], [appOutDir, path.join(\"/lib\", appIdentifier)], ...(this.options.files || [])],\n symlinks: [[path.join(\"/lib\", appIdentifier, executableName), path.join(\"/bin\", executableName)], ...(this.options.symlinks || [])],\n }\n\n return { manifest, buildOptions }\n }\n}\n\nconst flatpakBuilderDefaults: Omit<FlatpakManifest, \"id\" | \"command\"> = {\n runtime: \"org.freedesktop.Platform\",\n runtimeVersion: \"20.08\",\n sdk: \"org.freedesktop.Sdk\",\n base: \"org.electronjs.Electron2.BaseApp\",\n baseVersion: \"20.08\",\n finishArgs: [\n // Wayland/X11 Rendering\n \"--socket=wayland\",\n \"--socket=x11\",\n \"--share=ipc\",\n // Open GL\n \"--device=dri\",\n // Audio output\n \"--socket=pulseaudio\",\n // Read/write home directory access\n \"--filesystem=home\",\n // Allow communication with network\n \"--share=network\",\n // System notifications with libnotify\n \"--talk-name=org.freedesktop.Notifications\",\n ],\n}\n\nfunction getElectronWrapperScript(executableName: string, useWaylandFlags: boolean): string {\n return useWaylandFlags\n ? `#!/bin/sh\n\nexport TMPDIR=\"$XDG_RUNTIME_DIR/app/$FLATPAK_ID\"\n\nif [ \"\\${XDG_SESSION_TYPE}\" == \"wayland\" ]; then\n zypak-wrapper \"${executableName}\" --enable-features=UseOzonePlatform --ozone-platform=wayland \"$@\"\nelse\n zypak-wrapper \"${executableName}\" \"$@\"\nfi\n`\n : `#!/bin/sh\n\nexport TMPDIR=\"$XDG_RUNTIME_DIR/app/$FLATPAK_ID\"\n\nzypak-wrapper \"${executableName}\" \"$@\"\n`\n}\n\nfunction filterFlatpakAppIdentifier(identifier: string) {\n // Remove special characters and allow only alphanumeric (A-Z,a-z,0-9), underscore (_), and period (.)\n // Flatpak documentation: https://docs.flatpak.org/en/latest/conventions.html#application-ids\n return identifier.replace(/-/g, \"_\").replace(/[^a-zA-Z0-9._]/g, \"\")\n}\n"]}
1
+ {"version":3,"file":"FlatpakTarget.js","sourceRoot":"","sources":["../../src/targets/FlatpakTarget.ts"],"names":[],"mappings":";;AAAA,6DAA8G;AAC9G,+CAAgE;AAChE,uCAA4C;AAC5C,6BAA4B;AAC5B,kCAAgC;AAGhC,6CAA4D;AAE5D,6CAAuD;AAEvD,MAAqB,aAAc,SAAQ,aAAM;IAM/C,YACE,IAAY,EACK,QAAuB,EAChC,MAAyB,EACxB,MAAc;QAEvB,KAAK,CAAC,IAAI,CAAC,CAAA;QAJM,aAAQ,GAAR,QAAQ,CAAe;QAChC,WAAM,GAAN,MAAM,CAAmB;QACxB,WAAM,GAAN,MAAM,CAAQ;QAThB,YAAO,GAAmB;YACjC,GAAG,IAAI,CAAC,QAAQ,CAAC,4BAA4B;YAC7C,GAAI,IAAI,CAAC,QAAQ,CAAC,MAAc,CAAC,IAAI,CAAC,IAAI,CAAC;SAC5C,CAAA;IASD,CAAC;IAED,IAAI,KAAK;QACP,OAAO,0BAA0B,CAAC,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AG,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAA;AACrE,CAAC","sourcesContent":["import { bundle as bundleFlatpak, FlatpakBundlerBuildOptions, FlatpakManifest } from \"@malept/flatpak-bundler\"\nimport { Arch, copyFile, toLinuxArchString } from \"builder-util\"\nimport { chmod, outputFile } from \"fs-extra\"\nimport * as path from \"path\"\nimport { Target } from \"../core\"\nimport { LinuxPackager } from \"../linuxPackager\"\nimport { FlatpakOptions } from \"../options/linuxOptions\"\nimport { getNotLocalizedLicenseFile } from \"../util/license\"\nimport { LinuxTargetHelper } from \"./LinuxTargetHelper\"\nimport { createStageDir, StageDir } from \"./targetUtil\"\n\nexport default class FlatpakTarget extends Target {\n readonly options: FlatpakOptions = {\n ...this.packager.platformSpecificBuildOptions,\n ...(this.packager.config as any)[this.name],\n }\n\n constructor(\n name: string,\n private readonly packager: LinuxPackager,\n private helper: LinuxTargetHelper,\n readonly outDir: string\n ) {\n super(name)\n }\n\n get appId(): string {\n return filterFlatpakAppIdentifier(this.packager.appInfo.id)\n }\n\n async build(appOutDir: string, arch: Arch): Promise<any> {\n const { packager, options } = this\n const artifactName = packager.expandArtifactNamePattern(options, \"flatpak\", arch, undefined, false)\n const artifactPath = path.join(this.outDir, artifactName)\n await packager.info.emitArtifactBuildStarted({\n targetPresentableName: \"flatpak\",\n file: artifactPath,\n arch,\n })\n\n const stageDir = await this.prepareStageDir(arch)\n\n const { manifest, buildOptions } = this.getFlatpakBuilderOptions(appOutDir, stageDir.dir, artifactName, arch)\n await bundleFlatpak(manifest, buildOptions)\n\n await stageDir.cleanup()\n\n await packager.info.emitArtifactBuildCompleted({\n file: artifactPath,\n safeArtifactName: packager.computeSafeArtifactName(artifactName, \"flatpak\", arch, false),\n target: this,\n arch,\n packager,\n isWriteUpdateInfo: false,\n })\n }\n\n private async prepareStageDir(arch: Arch): Promise<StageDir> {\n const stageDir = await createStageDir(this, this.packager, arch)\n\n await Promise.all([this.createSandboxBinWrapper(stageDir), this.createDesktopFile(stageDir), this.copyLicenseFile(stageDir), this.copyIcons(stageDir)])\n\n return stageDir\n }\n\n private async createSandboxBinWrapper(stageDir: StageDir) {\n const useWaylandFlags = !!this.options.useWaylandFlags\n const electronWrapperPath = stageDir.getTempFile(path.join(\"bin\", \"electron-wrapper\"))\n await outputFile(electronWrapperPath, getElectronWrapperScript(this.packager.executableName, useWaylandFlags))\n await chmod(electronWrapperPath, 0o755)\n }\n\n private async createDesktopFile(stageDir: StageDir) {\n const appIdentifier = this.appId\n const desktopFile = stageDir.getTempFile(path.join(\"share\", \"applications\", `${appIdentifier}.desktop`))\n await this.helper.writeDesktopEntry(this.options, \"electron-wrapper %U\", desktopFile, { Icon: appIdentifier })\n }\n\n private async copyLicenseFile(stageDir: StageDir) {\n const licenseSrc = await getNotLocalizedLicenseFile(this.options.license, this.packager, [\"txt\", \"html\"])\n if (licenseSrc) {\n const licenseDst = stageDir.getTempFile(path.join(\"share\", \"doc\", this.appId, \"copyright\"))\n await copyFile(licenseSrc, licenseDst)\n }\n }\n\n private async copyIcons(stageDir: StageDir) {\n const icons = await this.helper.icons\n const copyIcons = icons.map(async icon => {\n if (icon.size > 512) {\n // Flatpak does not allow icons larger than 512 pixels\n return Promise.resolve()\n }\n const extWithDot = path.extname(icon.file)\n const sizeName = extWithDot === \".svg\" ? \"scalable\" : `${icon.size}x${icon.size}`\n const iconDst = stageDir.getTempFile(path.join(\"share\", \"icons\", \"hicolor\", sizeName, \"apps\", `${this.appId}${extWithDot}`))\n\n return copyFile(icon.file, iconDst)\n })\n\n await Promise.all(copyIcons)\n }\n\n private getFlatpakBuilderOptions(appOutDir: string, stageDir: string, artifactName: string, arch: Arch): { manifest: FlatpakManifest; buildOptions: FlatpakBundlerBuildOptions } {\n const appIdentifier = this.appId\n const { executableName } = this.packager\n const flatpakArch = toLinuxArchString(arch, \"flatpak\")\n\n const manifest: FlatpakManifest = {\n id: appIdentifier,\n command: \"electron-wrapper\",\n runtime: this.options.runtime || flatpakBuilderDefaults.runtime,\n runtimeVersion: this.options.runtimeVersion || flatpakBuilderDefaults.runtimeVersion,\n sdk: this.options.sdk || flatpakBuilderDefaults.sdk,\n base: this.options.base || flatpakBuilderDefaults.base,\n baseVersion: this.options.baseVersion || flatpakBuilderDefaults.baseVersion,\n finishArgs: this.options.finishArgs || flatpakBuilderDefaults.finishArgs,\n branch: this.options.branch,\n modules: this.options.modules,\n }\n\n const buildOptions: FlatpakBundlerBuildOptions = {\n baseFlatpakref: `app/${manifest.base}/${flatpakArch}/${manifest.baseVersion}`,\n runtimeFlatpakref: `runtime/${manifest.runtime}/${flatpakArch}/${manifest.runtimeVersion}`,\n sdkFlatpakref: `runtime/${manifest.sdk}/${flatpakArch}/${manifest.runtimeVersion}`,\n arch: flatpakArch as any,\n bundlePath: path.join(this.outDir, artifactName),\n files: [[stageDir, \"/\"], [appOutDir, path.join(\"/lib\", appIdentifier)], ...(this.options.files || [])],\n symlinks: [[path.join(\"/lib\", appIdentifier, executableName), path.join(\"/bin\", executableName)], ...(this.options.symlinks || [])],\n }\n\n return { manifest, buildOptions }\n }\n}\n\nconst flatpakBuilderDefaults: Omit<FlatpakManifest, \"id\" | \"command\"> = {\n runtime: \"org.freedesktop.Platform\",\n runtimeVersion: \"20.08\",\n sdk: \"org.freedesktop.Sdk\",\n base: \"org.electronjs.Electron2.BaseApp\",\n baseVersion: \"20.08\",\n finishArgs: [\n // Wayland/X11 Rendering\n \"--socket=wayland\",\n \"--socket=x11\",\n \"--share=ipc\",\n // Open GL\n \"--device=dri\",\n // Audio output\n \"--socket=pulseaudio\",\n // Read/write home directory access\n \"--filesystem=home\",\n // Allow communication with network\n \"--share=network\",\n // System notifications with libnotify\n \"--talk-name=org.freedesktop.Notifications\",\n ],\n}\n\nfunction getElectronWrapperScript(executableName: string, useWaylandFlags: boolean): string {\n return useWaylandFlags\n ? `#!/bin/sh\n\nexport TMPDIR=\"$XDG_RUNTIME_DIR/app/$FLATPAK_ID\"\n\nif [ \"\\${XDG_SESSION_TYPE}\" == \"wayland\" ]; then\n zypak-wrapper \"${executableName}\" --enable-features=UseOzonePlatform --ozone-platform=wayland \"$@\"\nelse\n zypak-wrapper \"${executableName}\" \"$@\"\nfi\n`\n : `#!/bin/sh\n\nexport TMPDIR=\"$XDG_RUNTIME_DIR/app/$FLATPAK_ID\"\n\nzypak-wrapper \"${executableName}\" \"$@\"\n`\n}\n\nfunction filterFlatpakAppIdentifier(identifier: string) {\n // Remove special characters and allow only alphanumeric (A-Z,a-z,0-9), underscore (_), and period (.)\n // Flatpak documentation: https://docs.flatpak.org/en/latest/conventions.html#application-ids\n return identifier.replace(/-/g, \"_\").replace(/[^a-zA-Z0-9._]/g, \"\")\n}\n"]}
@@ -95,7 +95,7 @@ class FpmTarget extends core_1.Target {
95
95
  const packager = this.packager;
96
96
  const artifactName = packager.expandArtifactNamePattern(this.options, target, arch, nameFormat, !isUseArchIfX64);
97
97
  const artifactPath = path.join(this.outDir, artifactName);
98
- await packager.info.callArtifactBuildStarted({
98
+ await packager.info.emitArtifactBuildStarted({
99
99
  targetPresentableName: target,
100
100
  file: artifactPath,
101
101
  arch,
@@ -237,7 +237,7 @@ class FpmTarget extends core_1.Target {
237
237
  },
238
238
  };
239
239
  }
240
- await packager.info.callArtifactBuildCompleted(info);
240
+ await packager.info.emitArtifactBuildCompleted(info);
241
241
  }
242
242
  supportsAutoUpdate(target) {
243
243
  return ["deb", "rpm", "pacman"].includes(target);
@@ -1 +1 @@
1
- {"version":3,"file":"FpmTarget.js","sourceRoot":"","sources":["../../src/targets/FpmTarget.ts"],"names":[],"mappings":";;AAAA,+CAAgK;AAEhK,uCAAqD;AACrD,0CAA6C;AAC7C,6BAA4B;AAC5B,wCAAoC;AACpC,kCAAgC;AAChC,kDAAiD;AAIjD,8DAA4E;AAC5E,mDAAiD;AACjD,qDAAgD;AAChD,uCAAuC;AACvC,uDAAoD;AACpD,qDAAqD;AACrD,2DAAsE;AACtE,mCAA2C;AAe3C,MAAqB,SAAU,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, serializeToYaml, TmpDir, toLinuxArchString, unlinkIfExists, use } from \"builder-util\"\nimport { Nullish } from \"builder-util-runtime\"\nimport { copyFile, outputFile, stat } from \"fs-extra\"\nimport { mkdir, readFile } from \"fs/promises\"\nimport * as path from \"path\"\nimport { smarten } from \"../appInfo\"\nimport { Target } from \"../core\"\nimport * as errorMessages from \"../errorMessages\"\nimport { LinuxPackager } from \"../linuxPackager\"\nimport { DebOptions, LinuxTargetSpecificOptions } from \"../options/linuxOptions\"\nimport { ArtifactCreated } from \"../packagerApi\"\nimport { getAppUpdatePublishConfiguration } from \"../publish/PublishManager\"\nimport { objectToArgs } from \"../util/appBuilder\"\nimport { computeEnv } from \"../util/bundledTool\"\nimport { hashFile } from \"../util/hash\"\nimport { isMacOsSierra } from \"../util/macosVersion\"\nimport { getTemplatePath } from \"../util/pathManager\"\nimport { installPrefix, LinuxTargetHelper } from \"./LinuxTargetHelper\"\nimport { getLinuxToolsPath } from \"./tools\"\n\ninterface FpmOptions {\n name: string\n maintainer: string | undefined\n vendor: string\n url: string\n}\n\ninterface ScriptFiles {\n afterRemove: string\n afterInstall: string\n appArmor: string\n}\n\nexport default class FpmTarget extends Target {\n readonly options: LinuxTargetSpecificOptions = { ...this.packager.platformSpecificBuildOptions, ...(this.packager.config as any)[this.name] }\n\n private readonly scriptFiles: Promise<ScriptFiles>\n\n constructor(\n name: string,\n private readonly packager: LinuxPackager,\n private readonly helper: LinuxTargetHelper,\n readonly outDir: string\n ) {\n super(name, false)\n\n this.scriptFiles = this.createScripts()\n }\n\n private async createScripts(): Promise<ScriptFiles> {\n const defaultTemplatesDir = getTemplatePath(\"linux\")\n\n const packager = this.packager\n const templateOptions = {\n // old API compatibility\n executable: packager.executableName,\n sanitizedProductName: packager.appInfo.sanitizedProductName,\n productFilename: packager.appInfo.productFilename,\n ...packager.platformSpecificBuildOptions,\n }\n\n function getResource(value: string | Nullish, defaultFile: string) {\n if (value == null) {\n return path.join(defaultTemplatesDir, defaultFile)\n }\n return path.resolve(packager.projectDir, value)\n }\n\n return {\n afterInstall: await writeConfigFile(packager.info.tempDirManager, getResource(this.options.afterInstall, \"after-install.tpl\"), templateOptions),\n afterRemove: await writeConfigFile(packager.info.tempDirManager, getResource(this.options.afterRemove, \"after-remove.tpl\"), templateOptions),\n appArmor: await writeConfigFile(packager.info.tempDirManager, getResource(this.options.appArmorProfile, \"apparmor-profile.tpl\"), templateOptions),\n }\n }\n\n checkOptions(): Promise<any> {\n return this.computeFpmMetaInfoOptions()\n }\n\n private async computeFpmMetaInfoOptions(): Promise<FpmOptions> {\n const packager = this.packager\n const projectUrl = await packager.appInfo.computePackageUrl()\n const errors: Array<string> = []\n if (projectUrl == null) {\n errors.push(\"Please specify project homepage, see https://www.electron.build/configuration#metadata\")\n }\n\n const options = this.options\n let author = options.maintainer\n if (author == null) {\n const a = packager.info.metadata.author\n if (a == null || a.email == null) {\n errors.push(errorMessages.authorEmailIsMissed)\n } else {\n author = `${a.name} <${a.email}>`\n }\n }\n\n if (errors.length > 0) {\n throw new Error(errors.join(\"\\n\\n\"))\n }\n\n return {\n name: options.packageName ?? this.packager.appInfo.linuxPackageName,\n maintainer: author!,\n url: projectUrl!,\n vendor: options.vendor || author!,\n }\n }\n\n async build(appOutDir: string, arch: Arch): Promise<any> {\n const target = this.name\n\n // tslint:disable:no-invalid-template-strings\n let nameFormat = \"${name}-${version}-${arch}.${ext}\"\n let isUseArchIfX64 = false\n if (target === \"deb\") {\n nameFormat = \"${name}_${version}_${arch}.${ext}\"\n isUseArchIfX64 = true\n } else if (target === \"rpm\") {\n nameFormat = \"${name}-${version}.${arch}.${ext}\"\n isUseArchIfX64 = true\n }\n\n const packager = this.packager\n const artifactName = packager.expandArtifactNamePattern(this.options, target, arch, nameFormat, !isUseArchIfX64)\n const artifactPath = path.join(this.outDir, artifactName)\n\n await packager.info.callArtifactBuildStarted({\n targetPresentableName: target,\n file: artifactPath,\n arch,\n })\n\n await unlinkIfExists(artifactPath)\n if (packager.packagerOptions.prepackaged != null) {\n await mkdir(this.outDir, { recursive: true })\n }\n const linuxDistType = packager.packagerOptions.prepackaged || path.join(this.outDir, `linux${getArchSuffix(arch)}-unpacked`)\n const resourceDir = packager.getResourcesDir(linuxDistType)\n\n const publishConfig = this.supportsAutoUpdate(target)\n ? await getAppUpdatePublishConfiguration(packager, arch, false /* in any case validation will be done on publish */)\n : null\n if (publishConfig != null) {\n log.info({ resourceDir: log.filePath(resourceDir) }, `adding autoupdate files for: ${target}. (Beta feature)`)\n await outputFile(path.join(resourceDir, \"app-update.yml\"), serializeToYaml(publishConfig))\n // Extra file needed for auto-updater to detect installation method\n await outputFile(path.join(resourceDir, \"package-type\"), target)\n }\n\n const scripts = await this.scriptFiles\n\n // Install AppArmor support for ubuntu 24+\n // https://github.com/electron-userland/electron-builder/issues/8635\n await copyFile(scripts.appArmor, path.join(resourceDir, \"apparmor-profile\"))\n\n const appInfo = packager.appInfo\n const options = this.options\n const synopsis = options.synopsis\n const args = [\n \"--architecture\",\n toLinuxArchString(arch, target),\n \"--after-install\",\n scripts.afterInstall,\n \"--after-remove\",\n scripts.afterRemove,\n \"--description\",\n smarten(target === \"rpm\" ? this.helper.getDescription(options) : `${synopsis || \"\"}\\n ${this.helper.getDescription(options)}`),\n \"--version\",\n this.helper.getSanitizedVersion(target),\n \"--package\",\n artifactPath,\n ]\n\n objectToArgs(args, (await this.computeFpmMetaInfoOptions()) as any)\n\n const packageCategory = options.packageCategory\n if (packageCategory != null) {\n args.push(\"--category\", packageCategory)\n }\n\n if (target === \"deb\") {\n args.push(\"--deb-priority\", (options as DebOptions).priority ?? \"optional\")\n } else if (target === \"rpm\") {\n if (synopsis != null) {\n args.push(\"--rpm-summary\", smarten(synopsis))\n }\n }\n\n const fpmConfiguration: FpmConfiguration = {\n args,\n target,\n }\n\n if (options.compression != null) {\n fpmConfiguration.compression = options.compression\n }\n\n // noinspection JSDeprecatedSymbols\n const depends = options.depends\n if (depends != null) {\n if (Array.isArray(depends)) {\n fpmConfiguration.customDepends = depends\n } else {\n // noinspection SuspiciousTypeOfGuard\n if (typeof depends === \"string\") {\n fpmConfiguration.customDepends = [depends as string]\n } else {\n throw new Error(`depends must be Array or String, but specified as: ${depends}`)\n }\n }\n } else {\n fpmConfiguration.customDepends = this.getDefaultDepends(target)\n }\n\n if (target === \"deb\") {\n const recommends = (options as DebOptions).recommends\n if (recommends) {\n fpmConfiguration.customRecommends = asArray(recommends)\n } else {\n fpmConfiguration.customRecommends = this.getDefaultRecommends(target)\n }\n }\n\n use(packager.info.metadata.license, it => args.push(\"--license\", it))\n use(appInfo.buildNumber, it =>\n args.push(\n \"--iteration\",\n // dashes are not supported for iteration in older versions of fpm\n // https://github.com/jordansissel/fpm/issues/1833\n it.split(\"-\").join(\"_\")\n )\n )\n\n use(options.fpm, it => args.push(...it))\n\n args.push(`${appOutDir}/=${installPrefix}/${appInfo.sanitizedProductName}`)\n for (const icon of await this.helper.icons) {\n const extWithDot = path.extname(icon.file)\n const sizeName = extWithDot === \".svg\" ? \"scalable\" : `${icon.size}x${icon.size}`\n args.push(`${icon.file}=/usr/share/icons/hicolor/${sizeName}/apps/${packager.executableName}${extWithDot}`)\n }\n\n const mimeTypeFilePath = await this.helper.mimeTypeFiles\n if (mimeTypeFilePath != null) {\n args.push(`${mimeTypeFilePath}=/usr/share/mime/packages/${packager.executableName}.xml`)\n }\n\n const desktopFilePath = await this.helper.writeDesktopEntry(this.options)\n args.push(`${desktopFilePath}=/usr/share/applications/${packager.executableName}.desktop`)\n\n if (packager.packagerOptions.effectiveOptionComputed != null && (await packager.packagerOptions.effectiveOptionComputed([args, desktopFilePath]))) {\n return\n }\n\n const env = {\n ...process.env,\n SZA_PATH: await getPath7za(),\n SZA_COMPRESSION_LEVEL: packager.compression === \"store\" ? \"0\" : \"9\",\n }\n\n // rpmbuild wants directory rpm with some default config files. Even if we can use dylibbundler, path to such config files are not changed (we need to replace in the binary)\n // so, for now, brew install rpm is still required.\n if (target !== \"rpm\" && (await isMacOsSierra())) {\n const linuxToolsPath = await getLinuxToolsPath()\n Object.assign(env, {\n PATH: computeEnv(process.env.PATH, [path.join(linuxToolsPath, \"bin\")]),\n DYLD_LIBRARY_PATH: computeEnv(process.env.DYLD_LIBRARY_PATH, [path.join(linuxToolsPath, \"lib\")]),\n })\n }\n\n await executeAppBuilder([\"fpm\", \"--configuration\", JSON.stringify(fpmConfiguration)], undefined, { env })\n\n let info: ArtifactCreated = {\n file: artifactPath,\n target: this,\n arch,\n packager,\n }\n if (publishConfig != null) {\n info = {\n ...info,\n safeArtifactName: packager.computeSafeArtifactName(artifactName, target, arch, !isUseArchIfX64),\n isWriteUpdateInfo: true,\n updateInfo: {\n sha512: await hashFile(artifactPath),\n size: (await stat(artifactPath)).size,\n },\n }\n }\n await packager.info.callArtifactBuildCompleted(info)\n }\n\n private supportsAutoUpdate(target: string) {\n return [\"deb\", \"rpm\", \"pacman\"].includes(target)\n }\n\n private getDefaultDepends(target: string): string[] {\n switch (target) {\n case \"deb\":\n return [\"libgtk-3-0\", \"libnotify4\", \"libnss3\", \"libxss1\", \"libxtst6\", \"xdg-utils\", \"libatspi2.0-0\", \"libuuid1\", \"libsecret-1-0\"]\n\n case \"rpm\":\n return [\n \"gtk3\" /* for electron 2+ (electron 1 uses gtk2, but this old version is not supported anymore) */,\n \"libnotify\",\n \"nss\",\n \"libXScrnSaver\",\n \"(libXtst or libXtst6)\",\n \"xdg-utils\",\n \"at-spi2-core\" /* since 5.0.0 */,\n \"(libuuid or libuuid1)\" /* since 4.0.0 */,\n ]\n\n case \"pacman\":\n return [\"c-ares\", \"ffmpeg\", \"gtk3\", \"http-parser\", \"libevent\", \"libvpx\", \"libxslt\", \"libxss\", \"minizip\", \"nss\", \"re2\", \"snappy\", \"libnotify\", \"libappindicator-gtk3\"]\n\n default:\n return []\n }\n }\n\n private getDefaultRecommends(target: string): string[] {\n switch (target) {\n case \"deb\":\n return [\"libappindicator3-1\"]\n default:\n return []\n }\n }\n}\n\ninterface FpmConfiguration {\n target: string\n args: Array<string>\n customDepends?: Array<string>\n customRecommends?: Array<string>\n compression?: string | null\n}\n\nasync function writeConfigFile(tmpDir: TmpDir, templatePath: string, options: any): Promise<string> {\n //noinspection JSUnusedLocalSymbols\n function replacer(match: string, p1: string) {\n if (p1 in options) {\n return options[p1]\n } else {\n throw new Error(`Macro ${p1} is not defined`)\n }\n }\n const config = (await readFile(templatePath, \"utf8\")).replace(/\\${([a-zA-Z]+)}/g, replacer).replace(/<%=([a-zA-Z]+)%>/g, (match, p1) => {\n log.warn(\"<%= varName %> is deprecated, please use ${varName} instead\")\n return replacer(match, p1.trim())\n })\n\n const outputPath = await tmpDir.getTempFile({ suffix: path.basename(templatePath, \".tpl\") })\n await outputFile(outputPath, config)\n return outputPath\n}\n"]}
1
+ {"version":3,"file":"FpmTarget.js","sourceRoot":"","sources":["../../src/targets/FpmTarget.ts"],"names":[],"mappings":";;AAAA,+CAAgK;AAEhK,uCAAqD;AACrD,0CAA6C;AAC7C,6BAA4B;AAC5B,wCAAoC;AACpC,kCAAgC;AAChC,kDAAiD;AAIjD,8DAA4E;AAC5E,mDAAiD;AACjD,qDAAgD;AAChD,uCAAuC;AACvC,uDAAoD;AACpD,qDAAqD;AACrD,2DAAsE;AACtE,mCAA2C;AAe3C,MAAqB,SAAU,SAAQ,aAAM;IAK3C,YACE,IAAY,EACK,QAAuB,EACvB,MAAyB,EACjC,MAAc;QAEvB,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QAJD,aAAQ,GAAR,QAAQ,CAAe;QACvB,WAAM,GAAN,MAAM,CAAmB;QACjC,WAAM,GAAN,MAAM,CAAQ;QARhB,YAAO,GAA+B,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,4BAA4B,EAAE,GAAI,IAAI,CAAC,QAAQ,CAAC,MAAc,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAA;QAY3I,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,aAAa,EAAE,CAAA;IACzC,CAAC;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CAAC;YAClB,OAAO,OAAO,CAAC,EAAE,CAAC,CAAA;QACpB,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAA;QAC/C,CAAC;IACH,CAAC;IACD,MAAM,MAAM,GAAG,CAAC,MAAM,IAAA,mBAAQ,EAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC,OAAO,CAAC,mBAAmB,EAAE,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE;QACrI,kBAAG,CAAC,IAAI,CAAC,6DAA6D,CAAC,CAAA;QACvE,OAAO,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,CAAA;IACnC,CAAC,CAAC,CAAA;IAEF,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC,EAAE,CAAC,CAAA;IAC5F,MAAM,IAAA,qBAAU,EAAC,UAAU,EAAE,MAAM,CAAC,CAAA;IACpC,OAAO,UAAU,CAAA;AACnB,CAAC","sourcesContent":["import { Arch, asArray, executeAppBuilder, getArchSuffix, getPath7za, log, serializeToYaml, TmpDir, toLinuxArchString, unlinkIfExists, use } from \"builder-util\"\nimport { Nullish } from \"builder-util-runtime\"\nimport { copyFile, outputFile, stat } from \"fs-extra\"\nimport { mkdir, readFile } from \"fs/promises\"\nimport * as path from \"path\"\nimport { smarten } from \"../appInfo\"\nimport { Target } from \"../core\"\nimport * as errorMessages from \"../errorMessages\"\nimport { LinuxPackager } from \"../linuxPackager\"\nimport { DebOptions, LinuxTargetSpecificOptions } from \"../options/linuxOptions\"\nimport { ArtifactCreated } from \"../packagerApi\"\nimport { getAppUpdatePublishConfiguration } from \"../publish/PublishManager\"\nimport { objectToArgs } from \"../util/appBuilder\"\nimport { computeEnv } from \"../util/bundledTool\"\nimport { hashFile } from \"../util/hash\"\nimport { isMacOsSierra } from \"../util/macosVersion\"\nimport { getTemplatePath } from \"../util/pathManager\"\nimport { installPrefix, LinuxTargetHelper } from \"./LinuxTargetHelper\"\nimport { getLinuxToolsPath } from \"./tools\"\n\ninterface FpmOptions {\n name: string\n maintainer: string | undefined\n vendor: string\n url: string\n}\n\ninterface ScriptFiles {\n afterRemove: string\n afterInstall: string\n appArmor: string\n}\n\nexport default class FpmTarget extends Target {\n readonly options: LinuxTargetSpecificOptions = { ...this.packager.platformSpecificBuildOptions, ...(this.packager.config as any)[this.name] }\n\n private readonly scriptFiles: Promise<ScriptFiles>\n\n constructor(\n name: string,\n private readonly packager: LinuxPackager,\n private readonly helper: LinuxTargetHelper,\n readonly outDir: string\n ) {\n super(name, false)\n\n this.scriptFiles = this.createScripts()\n }\n\n private async createScripts(): Promise<ScriptFiles> {\n const defaultTemplatesDir = getTemplatePath(\"linux\")\n\n const packager = this.packager\n const templateOptions = {\n // old API compatibility\n executable: packager.executableName,\n sanitizedProductName: packager.appInfo.sanitizedProductName,\n productFilename: packager.appInfo.productFilename,\n ...packager.platformSpecificBuildOptions,\n }\n\n function getResource(value: string | Nullish, defaultFile: string) {\n if (value == null) {\n return path.join(defaultTemplatesDir, defaultFile)\n }\n return path.resolve(packager.projectDir, value)\n }\n\n return {\n afterInstall: await writeConfigFile(packager.info.tempDirManager, getResource(this.options.afterInstall, \"after-install.tpl\"), templateOptions),\n afterRemove: await writeConfigFile(packager.info.tempDirManager, getResource(this.options.afterRemove, \"after-remove.tpl\"), templateOptions),\n appArmor: await writeConfigFile(packager.info.tempDirManager, getResource(this.options.appArmorProfile, \"apparmor-profile.tpl\"), templateOptions),\n }\n }\n\n checkOptions(): Promise<any> {\n return this.computeFpmMetaInfoOptions()\n }\n\n private async computeFpmMetaInfoOptions(): Promise<FpmOptions> {\n const packager = this.packager\n const projectUrl = await packager.appInfo.computePackageUrl()\n const errors: Array<string> = []\n if (projectUrl == null) {\n errors.push(\"Please specify project homepage, see https://www.electron.build/configuration#metadata\")\n }\n\n const options = this.options\n let author = options.maintainer\n if (author == null) {\n const a = packager.info.metadata.author\n if (a == null || a.email == null) {\n errors.push(errorMessages.authorEmailIsMissed)\n } else {\n author = `${a.name} <${a.email}>`\n }\n }\n\n if (errors.length > 0) {\n throw new Error(errors.join(\"\\n\\n\"))\n }\n\n return {\n name: options.packageName ?? this.packager.appInfo.linuxPackageName,\n maintainer: author!,\n url: projectUrl!,\n vendor: options.vendor || author!,\n }\n }\n\n async build(appOutDir: string, arch: Arch): Promise<any> {\n const target = this.name\n\n // tslint:disable:no-invalid-template-strings\n let nameFormat = \"${name}-${version}-${arch}.${ext}\"\n let isUseArchIfX64 = false\n if (target === \"deb\") {\n nameFormat = \"${name}_${version}_${arch}.${ext}\"\n isUseArchIfX64 = true\n } else if (target === \"rpm\") {\n nameFormat = \"${name}-${version}.${arch}.${ext}\"\n isUseArchIfX64 = true\n }\n\n const packager = this.packager\n const artifactName = packager.expandArtifactNamePattern(this.options, target, arch, nameFormat, !isUseArchIfX64)\n const artifactPath = path.join(this.outDir, artifactName)\n\n await packager.info.emitArtifactBuildStarted({\n targetPresentableName: target,\n file: artifactPath,\n arch,\n })\n\n await unlinkIfExists(artifactPath)\n if (packager.packagerOptions.prepackaged != null) {\n await mkdir(this.outDir, { recursive: true })\n }\n const linuxDistType = packager.packagerOptions.prepackaged || path.join(this.outDir, `linux${getArchSuffix(arch)}-unpacked`)\n const resourceDir = packager.getResourcesDir(linuxDistType)\n\n const publishConfig = this.supportsAutoUpdate(target)\n ? await getAppUpdatePublishConfiguration(packager, arch, false /* in any case validation will be done on publish */)\n : null\n if (publishConfig != null) {\n log.info({ resourceDir: log.filePath(resourceDir) }, `adding autoupdate files for: ${target}. (Beta feature)`)\n await outputFile(path.join(resourceDir, \"app-update.yml\"), serializeToYaml(publishConfig))\n // Extra file needed for auto-updater to detect installation method\n await outputFile(path.join(resourceDir, \"package-type\"), target)\n }\n\n const scripts = await this.scriptFiles\n\n // Install AppArmor support for ubuntu 24+\n // https://github.com/electron-userland/electron-builder/issues/8635\n await copyFile(scripts.appArmor, path.join(resourceDir, \"apparmor-profile\"))\n\n const appInfo = packager.appInfo\n const options = this.options\n const synopsis = options.synopsis\n const args = [\n \"--architecture\",\n toLinuxArchString(arch, target),\n \"--after-install\",\n scripts.afterInstall,\n \"--after-remove\",\n scripts.afterRemove,\n \"--description\",\n smarten(target === \"rpm\" ? this.helper.getDescription(options) : `${synopsis || \"\"}\\n ${this.helper.getDescription(options)}`),\n \"--version\",\n this.helper.getSanitizedVersion(target),\n \"--package\",\n artifactPath,\n ]\n\n objectToArgs(args, (await this.computeFpmMetaInfoOptions()) as any)\n\n const packageCategory = options.packageCategory\n if (packageCategory != null) {\n args.push(\"--category\", packageCategory)\n }\n\n if (target === \"deb\") {\n args.push(\"--deb-priority\", (options as DebOptions).priority ?? \"optional\")\n } else if (target === \"rpm\") {\n if (synopsis != null) {\n args.push(\"--rpm-summary\", smarten(synopsis))\n }\n }\n\n const fpmConfiguration: FpmConfiguration = {\n args,\n target,\n }\n\n if (options.compression != null) {\n fpmConfiguration.compression = options.compression\n }\n\n // noinspection JSDeprecatedSymbols\n const depends = options.depends\n if (depends != null) {\n if (Array.isArray(depends)) {\n fpmConfiguration.customDepends = depends\n } else {\n // noinspection SuspiciousTypeOfGuard\n if (typeof depends === \"string\") {\n fpmConfiguration.customDepends = [depends as string]\n } else {\n throw new Error(`depends must be Array or String, but specified as: ${depends}`)\n }\n }\n } else {\n fpmConfiguration.customDepends = this.getDefaultDepends(target)\n }\n\n if (target === \"deb\") {\n const recommends = (options as DebOptions).recommends\n if (recommends) {\n fpmConfiguration.customRecommends = asArray(recommends)\n } else {\n fpmConfiguration.customRecommends = this.getDefaultRecommends(target)\n }\n }\n\n use(packager.info.metadata.license, it => args.push(\"--license\", it))\n use(appInfo.buildNumber, it =>\n args.push(\n \"--iteration\",\n // dashes are not supported for iteration in older versions of fpm\n // https://github.com/jordansissel/fpm/issues/1833\n it.split(\"-\").join(\"_\")\n )\n )\n\n use(options.fpm, it => args.push(...it))\n\n args.push(`${appOutDir}/=${installPrefix}/${appInfo.sanitizedProductName}`)\n for (const icon of await this.helper.icons) {\n const extWithDot = path.extname(icon.file)\n const sizeName = extWithDot === \".svg\" ? \"scalable\" : `${icon.size}x${icon.size}`\n args.push(`${icon.file}=/usr/share/icons/hicolor/${sizeName}/apps/${packager.executableName}${extWithDot}`)\n }\n\n const mimeTypeFilePath = await this.helper.mimeTypeFiles\n if (mimeTypeFilePath != null) {\n args.push(`${mimeTypeFilePath}=/usr/share/mime/packages/${packager.executableName}.xml`)\n }\n\n const desktopFilePath = await this.helper.writeDesktopEntry(this.options)\n args.push(`${desktopFilePath}=/usr/share/applications/${packager.executableName}.desktop`)\n\n if (packager.packagerOptions.effectiveOptionComputed != null && (await packager.packagerOptions.effectiveOptionComputed([args, desktopFilePath]))) {\n return\n }\n\n const env = {\n ...process.env,\n SZA_PATH: await getPath7za(),\n SZA_COMPRESSION_LEVEL: packager.compression === \"store\" ? \"0\" : \"9\",\n }\n\n // rpmbuild wants directory rpm with some default config files. Even if we can use dylibbundler, path to such config files are not changed (we need to replace in the binary)\n // so, for now, brew install rpm is still required.\n if (target !== \"rpm\" && (await isMacOsSierra())) {\n const linuxToolsPath = await getLinuxToolsPath()\n Object.assign(env, {\n PATH: computeEnv(process.env.PATH, [path.join(linuxToolsPath, \"bin\")]),\n DYLD_LIBRARY_PATH: computeEnv(process.env.DYLD_LIBRARY_PATH, [path.join(linuxToolsPath, \"lib\")]),\n })\n }\n\n await executeAppBuilder([\"fpm\", \"--configuration\", JSON.stringify(fpmConfiguration)], undefined, { env })\n\n let info: ArtifactCreated = {\n file: artifactPath,\n target: this,\n arch,\n packager,\n }\n if (publishConfig != null) {\n info = {\n ...info,\n safeArtifactName: packager.computeSafeArtifactName(artifactName, target, arch, !isUseArchIfX64),\n isWriteUpdateInfo: true,\n updateInfo: {\n sha512: await hashFile(artifactPath),\n size: (await stat(artifactPath)).size,\n },\n }\n }\n await packager.info.emitArtifactBuildCompleted(info)\n }\n\n private supportsAutoUpdate(target: string) {\n return [\"deb\", \"rpm\", \"pacman\"].includes(target)\n }\n\n private getDefaultDepends(target: string): string[] {\n switch (target) {\n case \"deb\":\n return [\"libgtk-3-0\", \"libnotify4\", \"libnss3\", \"libxss1\", \"libxtst6\", \"xdg-utils\", \"libatspi2.0-0\", \"libuuid1\", \"libsecret-1-0\"]\n\n case \"rpm\":\n return [\n \"gtk3\" /* for electron 2+ (electron 1 uses gtk2, but this old version is not supported anymore) */,\n \"libnotify\",\n \"nss\",\n \"libXScrnSaver\",\n \"(libXtst or libXtst6)\",\n \"xdg-utils\",\n \"at-spi2-core\" /* since 5.0.0 */,\n \"(libuuid or libuuid1)\" /* since 4.0.0 */,\n ]\n\n case \"pacman\":\n return [\"c-ares\", \"ffmpeg\", \"gtk3\", \"http-parser\", \"libevent\", \"libvpx\", \"libxslt\", \"libxss\", \"minizip\", \"nss\", \"re2\", \"snappy\", \"libnotify\", \"libappindicator-gtk3\"]\n\n default:\n return []\n }\n }\n\n private getDefaultRecommends(target: string): string[] {\n switch (target) {\n case \"deb\":\n return [\"libappindicator3-1\"]\n default:\n return []\n }\n }\n}\n\ninterface FpmConfiguration {\n target: string\n args: Array<string>\n customDepends?: Array<string>\n customRecommends?: Array<string>\n compression?: string | null\n}\n\nasync function writeConfigFile(tmpDir: TmpDir, templatePath: string, options: any): Promise<string> {\n //noinspection JSUnusedLocalSymbols\n function replacer(match: string, p1: string) {\n if (p1 in options) {\n return options[p1]\n } else {\n throw new Error(`Macro ${p1} is not defined`)\n }\n }\n const config = (await readFile(templatePath, \"utf8\")).replace(/\\${([a-zA-Z]+)}/g, replacer).replace(/<%=([a-zA-Z]+)%>/g, (match, p1) => {\n log.warn(\"<%= varName %> is deprecated, please use ${varName} instead\")\n return replacer(match, p1.trim())\n })\n\n const outputPath = await tmpDir.getTempFile({ suffix: path.basename(templatePath, \".tpl\") })\n await outputFile(outputPath, config)\n return outputPath\n}\n"]}
@@ -50,7 +50,7 @@ class MsiTarget extends core_1.Target {
50
50
  const packager = this.packager;
51
51
  const artifactName = packager.expandArtifactBeautyNamePattern(this.options, "msi", arch);
52
52
  const artifactPath = path.join(this.outDir, artifactName);
53
- await packager.info.callArtifactBuildStarted({
53
+ await packager.info.emitArtifactBuildStarted({
54
54
  targetPresentableName: "MSI",
55
55
  file: artifactPath,
56
56
  arch,
@@ -66,7 +66,7 @@ class MsiTarget extends core_1.Target {
66
66
  const projectFile = stageDir.getTempFile("project.wxs");
67
67
  const objectFiles = ["project.wixobj"];
68
68
  await (0, promises_1.writeFile)(projectFile, await this.writeManifest(appOutDir, wixArch, commonOptions));
69
- await packager.info.callMsiProjectCreated(projectFile);
69
+ await packager.info.emitMsiProjectCreated(projectFile);
70
70
  // noinspection SpellCheckingInspection
71
71
  const vendorPath = await (0, binDownload_1.getBinFromUrl)("wix", "4.0.0.5512.2", "/X5poahdCc3199Vt6AP7gluTlT1nxi9cbbHhZhCMEu+ngyP1LiBMn+oZX7QAZVaKeBMc2SjVp7fJqNLqsUnPNQ==");
72
72
  // noinspection SpellCheckingInspection
@@ -78,7 +78,7 @@ class MsiTarget extends core_1.Target {
78
78
  await this.light(objectFiles, vm, artifactPath, appOutDir, vendorPath, stageDir.dir);
79
79
  await stageDir.cleanup();
80
80
  await packager.sign(artifactPath);
81
- await packager.info.callArtifactBuildCompleted({
81
+ await packager.info.emitArtifactBuildCompleted({
82
82
  file: artifactPath,
83
83
  packager,
84
84
  arch,
@@ -1 +1 @@
1
- {"version":3,"file":"MsiTarget.js","sourceRoot":"","sources":["../../src/targets/MsiTarget.ts"],"names":[],"mappings":";;AAAA,+CAAmE;AACnE,+DAA2C;AAC3C,mCAAmC;AACnC,2BAA0B;AAC1B,0CAAiD;AACjD,uCAA+B;AAC/B,6BAA4B;AAE5B,gDAA8C;AAC9C,kCAAgC;AAChC,wGAAuJ;AACvJ,0DAAkD;AAClD,qD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AC,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;AAC/H,CAAC","sourcesContent":["import { Arch, asArray, deepAssign, log, walk } from \"builder-util\"\nimport { UUID } from \"builder-util-runtime\"\nimport { createHash } from \"crypto\"\nimport * as ejs from \"ejs\"\nimport { readFile, writeFile } from \"fs/promises\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { MsiOptions } from \"../\"\nimport { getBinFromUrl } from \"../binDownload\"\nimport { Target } from \"../core\"\nimport { DesktopShortcutCreationPolicy, FinalCommonWindowsInstallerOptions, getEffectiveOptions } from \"../options/CommonWindowsInstallerConfiguration\"\nimport { normalizeExt } from \"../platformPackager\"\nimport { getTemplatePath } from \"../util/pathManager\"\nimport { VmManager } from \"../vm/vm\"\nimport { WineVmManager } from \"../vm/WineVm\"\nimport { WinPackager } from \"../winPackager\"\nimport { createStageDir, getWindowsInstallationDirName } from \"./targetUtil\"\n\nconst ELECTRON_BUILDER_UPGRADE_CODE_NS_UUID = UUID.parse(\"d752fe43-5d44-44d5-9fc9-6dd1bf19d5cc\")\nconst ROOT_DIR_ID = \"APPLICATIONFOLDER\"\n\n// WiX doesn't support Mono, so, dontnet462 is required to be installed for wine (preinstalled in our bundled wine)\nexport default class MsiTarget extends Target {\n protected readonly vm = process.platform === \"win32\" ? new VmManager() : new WineVmManager()\n\n readonly options: MsiOptions = deepAssign(this.packager.platformSpecificBuildOptions, this.packager.config.msi)\n\n constructor(\n protected readonly packager: WinPackager,\n readonly outDir: string,\n name = \"msi\",\n isAsyncSupported = true\n ) {\n super(name, isAsyncSupported)\n }\n\n protected projectTemplate = new Lazy<(data: any) => string>(async () => {\n const template = (await readFile(path.join(getTemplatePath(this.name), \"template.xml\"), \"utf8\"))\n .replace(/{{/g, \"<%\")\n .replace(/}}/g, \"%>\")\n .replace(/\\${([^}]+)}/g, \"<%=$1%>\")\n return ejs.compile(template)\n })\n\n /**\n * A product-specific string that can be used in an [MSI Identifier](https://docs.microsoft.com/en-us/windows/win32/msi/identifier).\n */\n private get productMsiIdPrefix() {\n const sanitizedId = this.packager.appInfo.productFilename.replace(/[^\\w.]/g, \"\").replace(/^[^A-Za-z_]+/, \"\")\n return sanitizedId.length > 0 ? sanitizedId : \"App\" + this.upgradeCode.replace(/-/g, \"\")\n }\n\n protected get iconId() {\n return `${this.productMsiIdPrefix}Icon.exe`\n }\n\n protected get upgradeCode(): string {\n return (this.options.upgradeCode || UUID.v5(this.packager.appInfo.id, ELECTRON_BUILDER_UPGRADE_CODE_NS_UUID)).toUpperCase()\n }\n\n async build(appOutDir: string, arch: Arch) {\n const packager = this.packager\n const artifactName = packager.expandArtifactBeautyNamePattern(this.options, \"msi\", arch)\n const artifactPath = path.join(this.outDir, artifactName)\n await packager.info.callArtifactBuildStarted({\n targetPresentableName: \"MSI\",\n file: artifactPath,\n arch,\n })\n\n const stageDir = await createStageDir(this, packager, arch)\n const vm = this.vm\n\n const commonOptions = getEffectiveOptions(this.options, this.packager)\n\n // wix 4.0.0.5512.2 doesn't support the arm64 architecture so default to x64 when building for arm64.\n // This will result in an x64 MSI installer that installs an arm64 version of the application. This is a\n // stopgap until the electron-builder-binaries wix version is upgraded to a version that supports arm64:\n // https://github.com/electron-userland/electron-builder/issues/6077\n const wixArch = arch == Arch.arm64 ? Arch.x64 : arch\n\n const projectFile = stageDir.getTempFile(\"project.wxs\")\n const objectFiles = [\"project.wixobj\"]\n await writeFile(projectFile, await this.writeManifest(appOutDir, wixArch, commonOptions))\n\n await packager.info.callMsiProjectCreated(projectFile)\n\n // noinspection SpellCheckingInspection\n const vendorPath = await getBinFromUrl(\"wix\", \"4.0.0.5512.2\", \"/X5poahdCc3199Vt6AP7gluTlT1nxi9cbbHhZhCMEu+ngyP1LiBMn+oZX7QAZVaKeBMc2SjVp7fJqNLqsUnPNQ==\")\n\n // noinspection SpellCheckingInspection\n const candleArgs = [\"-arch\", wixArch === Arch.ia32 ? \"x86\" : \"x64\", `-dappDir=${vm.toVmFile(appOutDir)}`].concat(this.getCommonWixArgs())\n candleArgs.push(\"project.wxs\")\n await vm.exec(vm.toVmFile(path.join(vendorPath, \"candle.exe\")), candleArgs, {\n cwd: stageDir.dir,\n })\n\n await this.light(objectFiles, vm, artifactPath, appOutDir, vendorPath, stageDir.dir)\n\n await stageDir.cleanup()\n\n await packager.sign(artifactPath)\n\n await packager.info.callArtifactBuildCompleted({\n file: artifactPath,\n packager,\n arch,\n safeArtifactName: packager.computeSafeArtifactName(artifactName, \"msi\"),\n target: this,\n isWriteUpdateInfo: false,\n })\n }\n\n private async light(objectFiles: Array<string>, vm: VmManager, artifactPath: string, appOutDir: string, vendorPath: string, tempDir: string) {\n // noinspection SpellCheckingInspection\n const lightArgs = [\n \"-out\",\n vm.toVmFile(artifactPath),\n \"-v\",\n // https://github.com/wixtoolset/issues/issues/5169\n \"-spdb\",\n // https://sourceforge.net/p/wix/bugs/2405/\n // error LGHT1076 : ICE61: This product should remove only older versions of itself. The Maximum version is not less than the current product. (1.1.0.42 1.1.0.42)\n \"-sw1076\",\n `-dappDir=${vm.toVmFile(appOutDir)}`,\n // \"-dcl:high\",\n ]\n .concat(this.getCommonWixArgs())\n .concat(this.getAdditionalLightArgs())\n\n // http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Build-3-5-2229-0-give-me-the-following-error-error-LGHT0216-An-unexpected-Win32-exception-with-errorn-td5707443.html\n if (process.platform !== \"win32\") {\n // noinspection SpellCheckingInspection\n lightArgs.push(\"-sval\")\n }\n\n if (this.options.oneClick === false) {\n lightArgs.push(\"-ext\", \"WixUIExtension\")\n }\n\n // objectFiles - only filenames, we set current directory to our temp stage dir\n lightArgs.push(...objectFiles)\n await vm.exec(vm.toVmFile(path.join(vendorPath, \"light.exe\")), lightArgs, {\n cwd: tempDir,\n })\n }\n\n private getAdditionalLightArgs() {\n const args: Array<string> = []\n if (this.options.additionalLightArgs != null) {\n args.push(...this.options.additionalLightArgs)\n }\n return args\n }\n\n private getCommonWixArgs() {\n const args: Array<string> = [\"-pedantic\"]\n if (this.options.warningsAsErrors !== false) {\n args.push(\"-wx\")\n }\n if (this.options.additionalWixArgs != null) {\n args.push(...this.options.additionalWixArgs)\n }\n return args\n }\n\n protected async writeManifest(appOutDir: string, wixArch: Arch, commonOptions: FinalCommonWindowsInstallerOptions) {\n const appInfo = this.packager.appInfo\n const { files, dirs } = await this.computeFileDeclaration(appOutDir)\n const options = this.options\n\n return (await this.projectTemplate.value)({\n ...(await this.getBaseOptions(commonOptions)),\n isCreateDesktopShortcut: commonOptions.isCreateDesktopShortcut !== DesktopShortcutCreationPolicy.NEVER,\n isRunAfterFinish: options.runAfterFinish !== false,\n // https://stackoverflow.com/questions/1929038/compilation-error-ice80-the-64bitcomponent-uses-32bitdirectory\n programFilesId: wixArch === Arch.x64 ? \"ProgramFiles64Folder\" : \"ProgramFilesFolder\",\n // wix in the name because special wix format can be used in the name\n installationDirectoryWixName: getWindowsInstallationDirName(appInfo, commonOptions.isAssisted || commonOptions.isPerMachine === true),\n dirs,\n files,\n })\n }\n\n protected async getBaseOptions(commonOptions: FinalCommonWindowsInstallerOptions): Promise<any> {\n const appInfo = this.packager.appInfo\n const iconPath = await this.packager.getIconPath()\n const compression = this.packager.compression\n\n const companyName = appInfo.companyName\n if (!companyName) {\n log.warn(`Manufacturer is not set for MSI — please set \"author\" in the package.json`)\n }\n\n return {\n ...commonOptions,\n iconPath: iconPath == null ? null : this.vm.toVmFile(iconPath),\n iconId: this.iconId,\n compressionLevel: compression === \"store\" ? \"none\" : \"high\",\n version: appInfo.getVersionInWeirdWindowsForm(),\n productName: appInfo.productName,\n upgradeCode: this.upgradeCode,\n manufacturer: companyName || appInfo.productName,\n appDescription: appInfo.description,\n }\n }\n\n private async computeFileDeclaration(appOutDir: string) {\n const appInfo = this.packager.appInfo\n let isRootDirAddedToRemoveTable = false\n const dirNames = new Set<string>()\n const dirs: Array<string> = []\n const fileSpace = \" \".repeat(6)\n const commonOptions = getEffectiveOptions(this.options, this.packager)\n const files = (await walk(appOutDir)).map(file => {\n const packagePath = file.substring(appOutDir.length + 1)\n\n const lastSlash = packagePath.lastIndexOf(path.sep)\n const fileName = lastSlash > 0 ? packagePath.substring(lastSlash + 1) : packagePath\n let directoryId: string | null = null\n let dirName = \"\"\n // Wix Directory.FileSource doesn't work - https://stackoverflow.com/questions/21519388/wix-filesource-confusion\n if (lastSlash > 0) {\n // This Name attribute may also define multiple directories using the inline directory syntax.\n // For example, \"ProgramFilesFolder:\\My Company\\My Product\\bin\" would create a reference to a Directory element with Id=\"ProgramFilesFolder\" then create directories named \"My Company\" then \"My Product\" then \"bin\" nested beneath each other.\n // This syntax is a shortcut to defining each directory in an individual Directory element.\n dirName = packagePath.substring(0, lastSlash)\n // https://github.com/electron-userland/electron-builder/issues/3027\n directoryId = \"d\" + createHash(\"md5\").update(dirName).digest(\"base64\").replace(/\\//g, \"_\").replace(/\\+/g, \".\").replace(/=+$/, \"\")\n if (!dirNames.has(dirName)) {\n dirNames.add(dirName)\n dirs.push(`<Directory Id=\"${directoryId}\" Name=\"${ROOT_DIR_ID}:\\\\${dirName.replace(/\\//g, \"\\\\\")}\\\\\"/>`)\n }\n } else if (!isRootDirAddedToRemoveTable) {\n isRootDirAddedToRemoveTable = true\n }\n\n // since RegistryValue can be part of Component, *** *** *** *** *** *** *** *** *** wix cannot auto generate guid\n // https://stackoverflow.com/questions/1405100/change-my-component-guid-in-wix\n let result = `<Component${directoryId === null ? \"\" : ` Directory=\"${directoryId}\"`}>`\n result += `\\n${fileSpace} <File Name=\"${xmlAttr(fileName)}\" Source=\"$(var.appDir)${path.sep}${xmlAttr(packagePath)}\" ReadOnly=\"yes\" KeyPath=\"yes\"`\n const isMainExecutable = packagePath === `${appInfo.productFilename}.exe`\n if (isMainExecutable) {\n result += ' Id=\"mainExecutable\"'\n } else if (directoryId === null) {\n result += ` Id=\"${path.basename(packagePath)}_f\"`\n }\n\n const isCreateDesktopShortcut = commonOptions.isCreateDesktopShortcut !== DesktopShortcutCreationPolicy.NEVER\n if (isMainExecutable && (isCreateDesktopShortcut || commonOptions.isCreateStartMenuShortcut)) {\n result += `>\\n`\n const shortcutName = commonOptions.shortcutName\n if (isCreateDesktopShortcut) {\n result += `${fileSpace} <Shortcut Id=\"desktopShortcut\" Directory=\"DesktopFolder\" Name=\"${xmlAttr(\n shortcutName\n )}\" WorkingDirectory=\"APPLICATIONFOLDER\" Advertise=\"yes\" Icon=\"${this.iconId}\"/>\\n`\n }\n\n const hasMenuCategory = commonOptions.menuCategory != null\n const startMenuShortcutDirectoryId = hasMenuCategory ? \"AppProgramMenuDir\" : \"ProgramMenuFolder\"\n if (commonOptions.isCreateStartMenuShortcut) {\n if (hasMenuCategory) {\n dirs.push(`<Directory Id=\"${startMenuShortcutDirectoryId}\" Name=\"ProgramMenuFolder:\\\\${commonOptions.menuCategory}\\\\\"/>`)\n }\n result += `${fileSpace} <Shortcut Id=\"startMenuShortcut\" Directory=\"${startMenuShortcutDirectoryId}\" Name=\"${xmlAttr(\n shortcutName\n )}\" WorkingDirectory=\"APPLICATIONFOLDER\" Advertise=\"yes\" Icon=\"${this.iconId}\">\\n`\n result += `${fileSpace} <ShortcutProperty Key=\"System.AppUserModel.ID\" Value=\"${xmlAttr(this.packager.appInfo.id)}\"/>\\n`\n result += `${fileSpace} </Shortcut>\\n`\n }\n result += `${fileSpace}</File>`\n\n if (hasMenuCategory) {\n result += `<RemoveFolder Id=\"${startMenuShortcutDirectoryId}\" Directory=\"${startMenuShortcutDirectoryId}\" On=\"uninstall\"/>\\n`\n }\n } else {\n result += `/>`\n }\n\n const fileAssociations = this.packager.fileAssociations\n if (isMainExecutable && fileAssociations.length !== 0) {\n for (const item of fileAssociations) {\n const extensions = asArray(item.ext).map(normalizeExt)\n for (const ext of extensions) {\n result += `${fileSpace} <ProgId Id=\"${this.productMsiIdPrefix}.${ext}\" Advertise=\"yes\" Icon=\"${this.iconId}\" ${\n item.description ? `Description=\"${item.description}\"` : \"\"\n }>\\n`\n result += `${fileSpace} <Extension Id=\"${ext}\" Advertise=\"yes\">\\n`\n result += `${fileSpace} <Verb Id=\"open\" Command=\"Open with ${xmlAttr(this.packager.appInfo.productName)}\" Argument=\"&quot;%1&quot;\"/>\\n`\n result += `${fileSpace} </Extension>\\n`\n result += `${fileSpace} </ProgId>\\n`\n }\n }\n }\n\n return `${result}\\n${fileSpace}</Component>`\n })\n\n return { dirs: listToString(dirs, 2), files: listToString(files, 3) }\n }\n}\n\nfunction listToString(list: Array<string>, indentLevel: number) {\n const space = \" \".repeat(indentLevel * 2)\n return list.join(`\\n${space}`)\n}\n\nfunction xmlAttr(str: string) {\n return str.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\").replace(/\"/g, \"&quot;\").replace(/'/g, \"&apos;\")\n}\n"]}
1
+ {"version":3,"file":"MsiTarget.js","sourceRoot":"","sources":["../../src/targets/MsiTarget.ts"],"names":[],"mappings":";;AAAA,+CAAmE;AACnE,+DAA2C;AAC3C,mCAAmC;AACnC,2BAA0B;AAC1B,0CAAiD;AACjD,uCAA+B;AAC/B,6BAA4B;AAE5B,gDAA8C;AAC9C,kCAAgC;AAChC,wGAAuJ;AACvJ,0DAAkD;AAClD,qDAAqD;AACrD,iCAAoC;AACpC,yCAA4C;AAE5C,6CAA4E;AAE5E,MAAM,qCAAqC,GAAG,2BAAI,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAA;AAChG,MAAM,WAAW,GAAG,mBAAmB,CAAA;AAEvC,mHAAmH;AACnH,MAAqB,SAAU,SAAQ,aAAM;IAK3C,YACqB,QAAqB,EAC/B,MAAc,EACvB,IAAI,GAAG,KAAK,EACZ,gBAAgB,GAAG,IAAI;QAEvB,KAAK,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAA;QALV,aAAQ,GAAR,QAAQ,CAAa;QAC/B,WAAM,GAAN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AAsB,GAAG,sBAAsB,CAAA;wBACrE,MAAM,IAAI,GAAG,SAAS,4CAA4C,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,iCAAiC,CAAA;wBAC7I,MAAM,IAAI,GAAG,SAAS,oBAAoB,CAAA;wBAC1C,MAAM,IAAI,GAAG,SAAS,eAAe,CAAA;oBACvC,CAAC;gBACH,CAAC;YACH,CAAC;YAED,OAAO,GAAG,MAAM,KAAK,SAAS,cAAc,CAAA;QAC9C,CAAC,CAAC,CAAA;QAEF,OAAO,EAAE,IAAI,EAAE,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,YAAY,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAA;IACvE,CAAC;CACF;AAtRD,4BAsRC;AAED,SAAS,YAAY,CAAC,IAAmB,EAAE,WAAmB;IAC5D,MAAM,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,WAAW,GAAG,CAAC,CAAC,CAAA;IACzC,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,EAAE,CAAC,CAAA;AAChC,CAAC;AAED,SAAS,OAAO,CAAC,GAAW;IAC1B,OAAO,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;AAC/H,CAAC","sourcesContent":["import { Arch, asArray, deepAssign, log, walk } from \"builder-util\"\nimport { UUID } from \"builder-util-runtime\"\nimport { createHash } from \"crypto\"\nimport * as ejs from \"ejs\"\nimport { readFile, writeFile } from \"fs/promises\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { MsiOptions } from \"../\"\nimport { getBinFromUrl } from \"../binDownload\"\nimport { Target } from \"../core\"\nimport { DesktopShortcutCreationPolicy, FinalCommonWindowsInstallerOptions, getEffectiveOptions } from \"../options/CommonWindowsInstallerConfiguration\"\nimport { normalizeExt } from \"../platformPackager\"\nimport { getTemplatePath } from \"../util/pathManager\"\nimport { VmManager } from \"../vm/vm\"\nimport { WineVmManager } from \"../vm/WineVm\"\nimport { WinPackager } from \"../winPackager\"\nimport { createStageDir, getWindowsInstallationDirName } from \"./targetUtil\"\n\nconst ELECTRON_BUILDER_UPGRADE_CODE_NS_UUID = UUID.parse(\"d752fe43-5d44-44d5-9fc9-6dd1bf19d5cc\")\nconst ROOT_DIR_ID = \"APPLICATIONFOLDER\"\n\n// WiX doesn't support Mono, so, dontnet462 is required to be installed for wine (preinstalled in our bundled wine)\nexport default class MsiTarget extends Target {\n protected readonly vm = process.platform === \"win32\" ? new VmManager() : new WineVmManager()\n\n readonly options: MsiOptions = deepAssign(this.packager.platformSpecificBuildOptions, this.packager.config.msi)\n\n constructor(\n protected readonly packager: WinPackager,\n readonly outDir: string,\n name = \"msi\",\n isAsyncSupported = true\n ) {\n super(name, isAsyncSupported)\n }\n\n protected projectTemplate = new Lazy<(data: any) => string>(async () => {\n const template = (await readFile(path.join(getTemplatePath(this.name), \"template.xml\"), \"utf8\"))\n .replace(/{{/g, \"<%\")\n .replace(/}}/g, \"%>\")\n .replace(/\\${([^}]+)}/g, \"<%=$1%>\")\n return ejs.compile(template)\n })\n\n /**\n * A product-specific string that can be used in an [MSI Identifier](https://docs.microsoft.com/en-us/windows/win32/msi/identifier).\n */\n private get productMsiIdPrefix() {\n const sanitizedId = this.packager.appInfo.productFilename.replace(/[^\\w.]/g, \"\").replace(/^[^A-Za-z_]+/, \"\")\n return sanitizedId.length > 0 ? sanitizedId : \"App\" + this.upgradeCode.replace(/-/g, \"\")\n }\n\n protected get iconId() {\n return `${this.productMsiIdPrefix}Icon.exe`\n }\n\n protected get upgradeCode(): string {\n return (this.options.upgradeCode || UUID.v5(this.packager.appInfo.id, ELECTRON_BUILDER_UPGRADE_CODE_NS_UUID)).toUpperCase()\n }\n\n async build(appOutDir: string, arch: Arch) {\n const packager = this.packager\n const artifactName = packager.expandArtifactBeautyNamePattern(this.options, \"msi\", arch)\n const artifactPath = path.join(this.outDir, artifactName)\n await packager.info.emitArtifactBuildStarted({\n targetPresentableName: \"MSI\",\n file: artifactPath,\n arch,\n })\n\n const stageDir = await createStageDir(this, packager, arch)\n const vm = this.vm\n\n const commonOptions = getEffectiveOptions(this.options, this.packager)\n\n // wix 4.0.0.5512.2 doesn't support the arm64 architecture so default to x64 when building for arm64.\n // This will result in an x64 MSI installer that installs an arm64 version of the application. This is a\n // stopgap until the electron-builder-binaries wix version is upgraded to a version that supports arm64:\n // https://github.com/electron-userland/electron-builder/issues/6077\n const wixArch = arch == Arch.arm64 ? Arch.x64 : arch\n\n const projectFile = stageDir.getTempFile(\"project.wxs\")\n const objectFiles = [\"project.wixobj\"]\n await writeFile(projectFile, await this.writeManifest(appOutDir, wixArch, commonOptions))\n\n await packager.info.emitMsiProjectCreated(projectFile)\n\n // noinspection SpellCheckingInspection\n const vendorPath = await getBinFromUrl(\"wix\", \"4.0.0.5512.2\", \"/X5poahdCc3199Vt6AP7gluTlT1nxi9cbbHhZhCMEu+ngyP1LiBMn+oZX7QAZVaKeBMc2SjVp7fJqNLqsUnPNQ==\")\n\n // noinspection SpellCheckingInspection\n const candleArgs = [\"-arch\", wixArch === Arch.ia32 ? \"x86\" : \"x64\", `-dappDir=${vm.toVmFile(appOutDir)}`].concat(this.getCommonWixArgs())\n candleArgs.push(\"project.wxs\")\n await vm.exec(vm.toVmFile(path.join(vendorPath, \"candle.exe\")), candleArgs, {\n cwd: stageDir.dir,\n })\n\n await this.light(objectFiles, vm, artifactPath, appOutDir, vendorPath, stageDir.dir)\n\n await stageDir.cleanup()\n\n await packager.sign(artifactPath)\n\n await packager.info.emitArtifactBuildCompleted({\n file: artifactPath,\n packager,\n arch,\n safeArtifactName: packager.computeSafeArtifactName(artifactName, \"msi\"),\n target: this,\n isWriteUpdateInfo: false,\n })\n }\n\n private async light(objectFiles: Array<string>, vm: VmManager, artifactPath: string, appOutDir: string, vendorPath: string, tempDir: string) {\n // noinspection SpellCheckingInspection\n const lightArgs = [\n \"-out\",\n vm.toVmFile(artifactPath),\n \"-v\",\n // https://github.com/wixtoolset/issues/issues/5169\n \"-spdb\",\n // https://sourceforge.net/p/wix/bugs/2405/\n // error LGHT1076 : ICE61: This product should remove only older versions of itself. The Maximum version is not less than the current product. (1.1.0.42 1.1.0.42)\n \"-sw1076\",\n `-dappDir=${vm.toVmFile(appOutDir)}`,\n // \"-dcl:high\",\n ]\n .concat(this.getCommonWixArgs())\n .concat(this.getAdditionalLightArgs())\n\n // http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Build-3-5-2229-0-give-me-the-following-error-error-LGHT0216-An-unexpected-Win32-exception-with-errorn-td5707443.html\n if (process.platform !== \"win32\") {\n // noinspection SpellCheckingInspection\n lightArgs.push(\"-sval\")\n }\n\n if (this.options.oneClick === false) {\n lightArgs.push(\"-ext\", \"WixUIExtension\")\n }\n\n // objectFiles - only filenames, we set current directory to our temp stage dir\n lightArgs.push(...objectFiles)\n await vm.exec(vm.toVmFile(path.join(vendorPath, \"light.exe\")), lightArgs, {\n cwd: tempDir,\n })\n }\n\n private getAdditionalLightArgs() {\n const args: Array<string> = []\n if (this.options.additionalLightArgs != null) {\n args.push(...this.options.additionalLightArgs)\n }\n return args\n }\n\n private getCommonWixArgs() {\n const args: Array<string> = [\"-pedantic\"]\n if (this.options.warningsAsErrors !== false) {\n args.push(\"-wx\")\n }\n if (this.options.additionalWixArgs != null) {\n args.push(...this.options.additionalWixArgs)\n }\n return args\n }\n\n protected async writeManifest(appOutDir: string, wixArch: Arch, commonOptions: FinalCommonWindowsInstallerOptions) {\n const appInfo = this.packager.appInfo\n const { files, dirs } = await this.computeFileDeclaration(appOutDir)\n const options = this.options\n\n return (await this.projectTemplate.value)({\n ...(await this.getBaseOptions(commonOptions)),\n isCreateDesktopShortcut: commonOptions.isCreateDesktopShortcut !== DesktopShortcutCreationPolicy.NEVER,\n isRunAfterFinish: options.runAfterFinish !== false,\n // https://stackoverflow.com/questions/1929038/compilation-error-ice80-the-64bitcomponent-uses-32bitdirectory\n programFilesId: wixArch === Arch.x64 ? \"ProgramFiles64Folder\" : \"ProgramFilesFolder\",\n // wix in the name because special wix format can be used in the name\n installationDirectoryWixName: getWindowsInstallationDirName(appInfo, commonOptions.isAssisted || commonOptions.isPerMachine === true),\n dirs,\n files,\n })\n }\n\n protected async getBaseOptions(commonOptions: FinalCommonWindowsInstallerOptions): Promise<any> {\n const appInfo = this.packager.appInfo\n const iconPath = await this.packager.getIconPath()\n const compression = this.packager.compression\n\n const companyName = appInfo.companyName\n if (!companyName) {\n log.warn(`Manufacturer is not set for MSI — please set \"author\" in the package.json`)\n }\n\n return {\n ...commonOptions,\n iconPath: iconPath == null ? null : this.vm.toVmFile(iconPath),\n iconId: this.iconId,\n compressionLevel: compression === \"store\" ? \"none\" : \"high\",\n version: appInfo.getVersionInWeirdWindowsForm(),\n productName: appInfo.productName,\n upgradeCode: this.upgradeCode,\n manufacturer: companyName || appInfo.productName,\n appDescription: appInfo.description,\n }\n }\n\n private async computeFileDeclaration(appOutDir: string) {\n const appInfo = this.packager.appInfo\n let isRootDirAddedToRemoveTable = false\n const dirNames = new Set<string>()\n const dirs: Array<string> = []\n const fileSpace = \" \".repeat(6)\n const commonOptions = getEffectiveOptions(this.options, this.packager)\n const files = (await walk(appOutDir)).map(file => {\n const packagePath = file.substring(appOutDir.length + 1)\n\n const lastSlash = packagePath.lastIndexOf(path.sep)\n const fileName = lastSlash > 0 ? packagePath.substring(lastSlash + 1) : packagePath\n let directoryId: string | null = null\n let dirName = \"\"\n // Wix Directory.FileSource doesn't work - https://stackoverflow.com/questions/21519388/wix-filesource-confusion\n if (lastSlash > 0) {\n // This Name attribute may also define multiple directories using the inline directory syntax.\n // For example, \"ProgramFilesFolder:\\My Company\\My Product\\bin\" would create a reference to a Directory element with Id=\"ProgramFilesFolder\" then create directories named \"My Company\" then \"My Product\" then \"bin\" nested beneath each other.\n // This syntax is a shortcut to defining each directory in an individual Directory element.\n dirName = packagePath.substring(0, lastSlash)\n // https://github.com/electron-userland/electron-builder/issues/3027\n directoryId = \"d\" + createHash(\"md5\").update(dirName).digest(\"base64\").replace(/\\//g, \"_\").replace(/\\+/g, \".\").replace(/=+$/, \"\")\n if (!dirNames.has(dirName)) {\n dirNames.add(dirName)\n dirs.push(`<Directory Id=\"${directoryId}\" Name=\"${ROOT_DIR_ID}:\\\\${dirName.replace(/\\//g, \"\\\\\")}\\\\\"/>`)\n }\n } else if (!isRootDirAddedToRemoveTable) {\n isRootDirAddedToRemoveTable = true\n }\n\n // since RegistryValue can be part of Component, *** *** *** *** *** *** *** *** *** wix cannot auto generate guid\n // https://stackoverflow.com/questions/1405100/change-my-component-guid-in-wix\n let result = `<Component${directoryId === null ? \"\" : ` Directory=\"${directoryId}\"`}>`\n result += `\\n${fileSpace} <File Name=\"${xmlAttr(fileName)}\" Source=\"$(var.appDir)${path.sep}${xmlAttr(packagePath)}\" ReadOnly=\"yes\" KeyPath=\"yes\"`\n const isMainExecutable = packagePath === `${appInfo.productFilename}.exe`\n if (isMainExecutable) {\n result += ' Id=\"mainExecutable\"'\n } else if (directoryId === null) {\n result += ` Id=\"${path.basename(packagePath)}_f\"`\n }\n\n const isCreateDesktopShortcut = commonOptions.isCreateDesktopShortcut !== DesktopShortcutCreationPolicy.NEVER\n if (isMainExecutable && (isCreateDesktopShortcut || commonOptions.isCreateStartMenuShortcut)) {\n result += `>\\n`\n const shortcutName = commonOptions.shortcutName\n if (isCreateDesktopShortcut) {\n result += `${fileSpace} <Shortcut Id=\"desktopShortcut\" Directory=\"DesktopFolder\" Name=\"${xmlAttr(\n shortcutName\n )}\" WorkingDirectory=\"APPLICATIONFOLDER\" Advertise=\"yes\" Icon=\"${this.iconId}\"/>\\n`\n }\n\n const hasMenuCategory = commonOptions.menuCategory != null\n const startMenuShortcutDirectoryId = hasMenuCategory ? \"AppProgramMenuDir\" : \"ProgramMenuFolder\"\n if (commonOptions.isCreateStartMenuShortcut) {\n if (hasMenuCategory) {\n dirs.push(`<Directory Id=\"${startMenuShortcutDirectoryId}\" Name=\"ProgramMenuFolder:\\\\${commonOptions.menuCategory}\\\\\"/>`)\n }\n result += `${fileSpace} <Shortcut Id=\"startMenuShortcut\" Directory=\"${startMenuShortcutDirectoryId}\" Name=\"${xmlAttr(\n shortcutName\n )}\" WorkingDirectory=\"APPLICATIONFOLDER\" Advertise=\"yes\" Icon=\"${this.iconId}\">\\n`\n result += `${fileSpace} <ShortcutProperty Key=\"System.AppUserModel.ID\" Value=\"${xmlAttr(this.packager.appInfo.id)}\"/>\\n`\n result += `${fileSpace} </Shortcut>\\n`\n }\n result += `${fileSpace}</File>`\n\n if (hasMenuCategory) {\n result += `<RemoveFolder Id=\"${startMenuShortcutDirectoryId}\" Directory=\"${startMenuShortcutDirectoryId}\" On=\"uninstall\"/>\\n`\n }\n } else {\n result += `/>`\n }\n\n const fileAssociations = this.packager.fileAssociations\n if (isMainExecutable && fileAssociations.length !== 0) {\n for (const item of fileAssociations) {\n const extensions = asArray(item.ext).map(normalizeExt)\n for (const ext of extensions) {\n result += `${fileSpace} <ProgId Id=\"${this.productMsiIdPrefix}.${ext}\" Advertise=\"yes\" Icon=\"${this.iconId}\" ${\n item.description ? `Description=\"${item.description}\"` : \"\"\n }>\\n`\n result += `${fileSpace} <Extension Id=\"${ext}\" Advertise=\"yes\">\\n`\n result += `${fileSpace} <Verb Id=\"open\" Command=\"Open with ${xmlAttr(this.packager.appInfo.productName)}\" Argument=\"&quot;%1&quot;\"/>\\n`\n result += `${fileSpace} </Extension>\\n`\n result += `${fileSpace} </ProgId>\\n`\n }\n }\n }\n\n return `${result}\\n${fileSpace}</Component>`\n })\n\n return { dirs: listToString(dirs, 2), files: listToString(files, 3) }\n }\n}\n\nfunction listToString(list: Array<string>, indentLevel: number) {\n const space = \" \".repeat(indentLevel * 2)\n return list.join(`\\n${space}`)\n}\n\nfunction xmlAttr(str: string) {\n return str.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\").replace(/\"/g, \"&quot;\").replace(/'/g, \"&apos;\")\n}\n"]}
@@ -67,7 +67,7 @@ async function createBlockmap(file, target, packager, safeArtifactName) {
67
67
  const blockMapFile = `${file}${exports.BLOCK_MAP_FILE_SUFFIX}`;
68
68
  builder_util_1.log.info({ blockMapFile: builder_util_1.log.filePath(blockMapFile) }, "building block map");
69
69
  const updateInfo = await (0, appBuilder_1.executeAppBuilderAsJson)(["blockmap", "--input", file, "--output", blockMapFile]);
70
- await packager.info.callArtifactBuildCompleted({
70
+ await packager.info.emitArtifactBuildCompleted({
71
71
  file: blockMapFile,
72
72
  safeArtifactName: safeArtifactName == null ? null : `${safeArtifactName}${exports.BLOCK_MAP_FILE_SUFFIX}`,
73
73
  target,
@@ -1 +1 @@
1
- {"version":3,"file":"differentialUpdateInfoBuilder.js","sourceRoot":"","sources":["../../src/targets/differentialUpdateInfoBuilder.ts"],"names":[],"mappings":";;;AAUA,kFAsBC;AAED,4FA4BC;AAED,wCAGC;AAED,wCAaC;AAlFD,+CAAkC;AAElC,6BAA4B;AAG5B,mDAA4D;AAG/C,QAAA,qBAAqB,GAAG,WAAW,CAAA;AAEhD,SAAgB,mCAAmC,CAAC,YAAoB,EAAE,YAAiD;IACzH,IAAI,YAAY,IAAI,IAAI,EAAE,CAAC;QACzB,OAAO,IAAI,CAAA;IACb,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;IACtC,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;QACrB,OAAO,IAAI,CAAA;IACb,CAAC;IAED,MAAM,QAAQ,GAAwC,EAAE,CAAA;IACxD,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;QACxB,MAAM,eAAe,GAA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7H,MAAM,QAAQ,CAAC,IAAI,CAAC,0BAA0B,CAAC;QAC7C,IAAI,EAAE,YAAY;QAClB,gBAAgB,EAAE,gBAAgB,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,gBAAgB,GAAG,6BAAqB,EAAE;QACjG,MAAM;QACN,IAAI,EAAE,IAAI;QACV,QAAQ;QACR,UAAU;KACX,CAAC,CAAA;IACF,OAAO,UAAU,CAAA;AACnB,CAAC","sourcesContent":["import { log } from \"builder-util\"\nimport { BlockMapDataHolder, PackageFileInfo } from \"builder-util-runtime\"\nimport * as path from \"path\"\nimport { Target } from \"../core\"\nimport { PlatformPackager } from \"../platformPackager\"\nimport { executeAppBuilderAsJson } from \"../util/appBuilder\"\nimport { ArchiveOptions } from \"./archive\"\n\nexport const BLOCK_MAP_FILE_SUFFIX = \".blockmap\"\n\nexport function createNsisWebDifferentialUpdateInfo(artifactPath: string, packageFiles: { [arch: string]: PackageFileInfo }) {\n if (packageFiles == null) {\n return null\n }\n\n const keys = Object.keys(packageFiles)\n if (keys.length <= 0) {\n return null\n }\n\n const packages: { [arch: string]: PackageFileInfo } = {}\n for (const arch of keys) {\n const packageFileInfo = packageFiles[arch]\n const file = path.basename(packageFileInfo.path)\n packages[arch] = {\n ...packageFileInfo,\n path: file,\n // https://github.com/electron-userland/electron-builder/issues/2583\n file,\n } as any\n }\n return { packages }\n}\n\nexport function configureDifferentialAwareArchiveOptions(archiveOptions: ArchiveOptions): ArchiveOptions {\n /*\n * dict size 64 MB: Full: 33,744.88 KB, To download: 17,630.3 KB (52%)\n * dict size 16 MB: Full: 33,936.84 KB, To download: 16,175.9 KB (48%)\n * dict size 8 MB: Full: 34,187.59 KB, To download: 8,229.9 KB (24%)\n * dict size 4 MB: Full: 34,628.73 KB, To download: 3,782.97 KB (11%)\n\n as we can see, if file changed in one place, all block is invalidated (and update size approximately equals to dict size)\n\n 1 MB is used:\n\n 1MB:\n\n 2018/01/11 11:54:41:0045 File has 59 changed blocks\n 2018/01/11 11:54:41:0050 Full: 71,588.59 KB, To download: 1,243.39 KB (2%)\n\n 4MB:\n\n 2018/01/11 11:31:43:0440 Full: 70,303.55 KB, To download: 4,843.27 KB (7%)\n 2018/01/11 11:31:43:0435 File has 234 changed blocks\n\n */\n archiveOptions.dictSize = 1\n // solid compression leads to a lot of changed blocks\n archiveOptions.solid = false\n // do not allow to change compression level to avoid different packages\n archiveOptions.compression = \"normal\"\n return archiveOptions\n}\n\nexport async function appendBlockmap(file: string): Promise<BlockMapDataHolder> {\n log.info({ file: log.filePath(file) }, \"building embedded block map\")\n return await executeAppBuilderAsJson<BlockMapDataHolder>([\"blockmap\", \"--input\", file, \"--compression\", \"deflate\"])\n}\n\nexport async function createBlockmap(file: string, target: Target, packager: PlatformPackager<any>, safeArtifactName: string | null): Promise<BlockMapDataHolder> {\n const blockMapFile = `${file}${BLOCK_MAP_FILE_SUFFIX}`\n log.info({ blockMapFile: log.filePath(blockMapFile) }, \"building block map\")\n const updateInfo = await executeAppBuilderAsJson<BlockMapDataHolder>([\"blockmap\", \"--input\", file, \"--output\", blockMapFile])\n await packager.info.callArtifactBuildCompleted({\n file: blockMapFile,\n safeArtifactName: safeArtifactName == null ? null : `${safeArtifactName}${BLOCK_MAP_FILE_SUFFIX}`,\n target,\n arch: null,\n packager,\n updateInfo,\n })\n return updateInfo\n}\n"]}
1
+ {"version":3,"file":"differentialUpdateInfoBuilder.js","sourceRoot":"","sources":["../../src/targets/differentialUpdateInfoBuilder.ts"],"names":[],"mappings":";;;AAUA,kFAsBC;AAED,4FA4BC;AAED,wCAGC;AAED,wCAaC;AAlFD,+CAAkC;AAElC,6BAA4B;AAG5B,mDAA4D;AAG/C,QAAA,qBAAqB,GAAG,WAAW,CAAA;AAEhD,SAAgB,mCAAmC,CAAC,YAAoB,EAAE,YAAiD;IACzH,IAAI,YAAY,IAAI,IAAI,EAAE,CAAC;QACzB,OAAO,IAAI,CAAA;IACb,CAAC;IAED,MAAM,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,kBAAG,CAAC,IAAI,CAAC,EAAE,YAAY,EAAE,kBAAG,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,EAAE,oBAAoB,CAAC,CAAA;IAC5E,MAAM,UAAU,GAAG,MAAM,IAAA,oCAAuB,EAAqB,CAAC,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC,CAAA;IAC7H,MAAM,QAAQ,CAAC,IAAI,CAAC,0BAA0B,CAAC;QAC7C,IAAI,EAAE,YAAY;QAClB,gBAAgB,EAAE,gBAAgB,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,gBAAgB,GAAG,6BAAqB,EAAE;QACjG,MAAM;QACN,IAAI,EAAE,IAAI;QACV,QAAQ;QACR,UAAU;KACX,CAAC,CAAA;IACF,OAAO,UAAU,CAAA;AACnB,CAAC","sourcesContent":["import { log } from \"builder-util\"\nimport { BlockMapDataHolder, PackageFileInfo } from \"builder-util-runtime\"\nimport * as path from \"path\"\nimport { Target } from \"../core\"\nimport { PlatformPackager } from \"../platformPackager\"\nimport { executeAppBuilderAsJson } from \"../util/appBuilder\"\nimport { ArchiveOptions } from \"./archive\"\n\nexport const BLOCK_MAP_FILE_SUFFIX = \".blockmap\"\n\nexport function createNsisWebDifferentialUpdateInfo(artifactPath: string, packageFiles: { [arch: string]: PackageFileInfo }) {\n if (packageFiles == null) {\n return null\n }\n\n const keys = Object.keys(packageFiles)\n if (keys.length <= 0) {\n return null\n }\n\n const packages: { [arch: string]: PackageFileInfo } = {}\n for (const arch of keys) {\n const packageFileInfo = packageFiles[arch]\n const file = path.basename(packageFileInfo.path)\n packages[arch] = {\n ...packageFileInfo,\n path: file,\n // https://github.com/electron-userland/electron-builder/issues/2583\n file,\n } as any\n }\n return { packages }\n}\n\nexport function configureDifferentialAwareArchiveOptions(archiveOptions: ArchiveOptions): ArchiveOptions {\n /*\n * dict size 64 MB: Full: 33,744.88 KB, To download: 17,630.3 KB (52%)\n * dict size 16 MB: Full: 33,936.84 KB, To download: 16,175.9 KB (48%)\n * dict size 8 MB: Full: 34,187.59 KB, To download: 8,229.9 KB (24%)\n * dict size 4 MB: Full: 34,628.73 KB, To download: 3,782.97 KB (11%)\n\n as we can see, if file changed in one place, all block is invalidated (and update size approximately equals to dict size)\n\n 1 MB is used:\n\n 1MB:\n\n 2018/01/11 11:54:41:0045 File has 59 changed blocks\n 2018/01/11 11:54:41:0050 Full: 71,588.59 KB, To download: 1,243.39 KB (2%)\n\n 4MB:\n\n 2018/01/11 11:31:43:0440 Full: 70,303.55 KB, To download: 4,843.27 KB (7%)\n 2018/01/11 11:31:43:0435 File has 234 changed blocks\n\n */\n archiveOptions.dictSize = 1\n // solid compression leads to a lot of changed blocks\n archiveOptions.solid = false\n // do not allow to change compression level to avoid different packages\n archiveOptions.compression = \"normal\"\n return archiveOptions\n}\n\nexport async function appendBlockmap(file: string): Promise<BlockMapDataHolder> {\n log.info({ file: log.filePath(file) }, \"building embedded block map\")\n return await executeAppBuilderAsJson<BlockMapDataHolder>([\"blockmap\", \"--input\", file, \"--compression\", \"deflate\"])\n}\n\nexport async function createBlockmap(file: string, target: Target, packager: PlatformPackager<any>, safeArtifactName: string | null): Promise<BlockMapDataHolder> {\n const blockMapFile = `${file}${BLOCK_MAP_FILE_SUFFIX}`\n log.info({ blockMapFile: log.filePath(blockMapFile) }, \"building block map\")\n const updateInfo = await executeAppBuilderAsJson<BlockMapDataHolder>([\"blockmap\", \"--input\", file, \"--output\", blockMapFile])\n await packager.info.emitArtifactBuildCompleted({\n file: blockMapFile,\n safeArtifactName: safeArtifactName == null ? null : `${safeArtifactName}${BLOCK_MAP_FILE_SUFFIX}`,\n target,\n arch: null,\n packager,\n updateInfo,\n })\n return updateInfo\n}\n"]}
@@ -149,7 +149,7 @@ class NsisTarget extends core_1.Target {
149
149
  logFields.oneClick = oneClick;
150
150
  logFields.perMachine = isPerMachine;
151
151
  }
152
- await packager.info.callArtifactBuildStarted({
152
+ await packager.info.emitArtifactBuildStarted({
153
153
  targetPresentableName: this.name,
154
154
  file: installerPath,
155
155
  arch: primaryArch,
@@ -300,7 +300,7 @@ class NsisTarget extends core_1.Target {
300
300
  if (updateInfo != null && isPerMachine && (oneClick || options.packElevateHelper)) {
301
301
  updateInfo.isAdminRightsRequired = true;
302
302
  }
303
- await packager.info.callArtifactBuildCompleted({
303
+ await packager.info.emitArtifactBuildCompleted({
304
304
  file: installerPath,
305
305
  updateInfo,
306
306
  target: this,