electron-builder-squirrel-windows 24.0.0-alpha.1 → 24.0.0-alpha.11

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.
@@ -17,11 +17,11 @@ class SquirrelWindowsTarget extends app_builder_lib_1.Target {
17
17
  async build(appOutDir, arch) {
18
18
  const packager = this.packager;
19
19
  const version = packager.appInfo.version;
20
- const sanitizedName = filename_1.sanitizeFileName(this.appName);
20
+ const sanitizedName = (0, filename_1.sanitizeFileName)(this.appName);
21
21
  // tslint:disable-next-line:no-invalid-template-strings
22
22
  const setupFile = packager.expandArtifactNamePattern(this.options, "exe", arch, "${productName} Setup ${version}.${ext}");
23
- const packageFile = `${sanitizedName}-${squirrelPack_1.convertVersion(version)}-full.nupkg`;
24
- const installerOutDir = path.join(this.outDir, `squirrel-windows${app_builder_lib_1.getArchSuffix(arch)}`);
23
+ const packageFile = `${sanitizedName}-${(0, squirrelPack_1.convertVersion)(version)}-full.nupkg`;
24
+ const installerOutDir = path.join(this.outDir, `squirrel-windows${(0, app_builder_lib_1.getArchSuffix)(arch)}`);
25
25
  const artifactPath = path.join(installerOutDir, setupFile);
26
26
  await packager.info.callArtifactBuildStarted({
27
27
  targetPresentableName: "Squirrel.Windows",
@@ -38,10 +38,10 @@ class SquirrelWindowsTarget extends app_builder_lib_1.Target {
38
38
  file: artifactPath,
39
39
  target: this,
40
40
  arch,
41
- safeArtifactName: `${sanitizedName}-Setup-${version}${app_builder_lib_1.getArchSuffix(arch)}.exe`,
41
+ safeArtifactName: `${sanitizedName}-Setup-${version}${(0, app_builder_lib_1.getArchSuffix)(arch)}.exe`,
42
42
  packager: this.packager,
43
43
  });
44
- const packagePrefix = `${this.appName}-${squirrelPack_1.convertVersion(version)}-`;
44
+ const packagePrefix = `${this.appName}-${(0, squirrelPack_1.convertVersion)(version)}-`;
45
45
  packager.info.dispatchArtifactCreated({
46
46
  file: path.join(installerOutDir, `${packagePrefix}full.nupkg`),
47
47
  target: this,
@@ -94,10 +94,10 @@ class SquirrelWindowsTarget extends app_builder_lib_1.Target {
94
94
  extraMetadataSpecs: projectUrl == null ? null : `\n <projectUrl>${projectUrl}</projectUrl>`,
95
95
  copyright: appInfo.copyright,
96
96
  packageCompressionLevel: parseInt((process.env.ELECTRON_BUILDER_COMPRESSION_LEVEL || packager.compression === "store" ? 0 : 9), 10),
97
- vendorPath: await binDownload_1.getBinFromUrl("Squirrel.Windows", "1.9.0", "zJHk4CMATM7jHJ2ojRH1n3LkOnaIezDk5FAzJmlSEQSiEdRuB4GGLCegLDtsRCakfHIVfKh3ysJHLjynPkXwhQ=="),
97
+ vendorPath: await (0, binDownload_1.getBinFromUrl)("Squirrel.Windows", "1.9.0", "zJHk4CMATM7jHJ2ojRH1n3LkOnaIezDk5FAzJmlSEQSiEdRuB4GGLCegLDtsRCakfHIVfKh3ysJHLjynPkXwhQ=="),
98
98
  ...this.options,
99
99
  };
100
- if (builder_util_1.isEmptyOrSpaces(options.description)) {
100
+ if ((0, builder_util_1.isEmptyOrSpaces)(options.description)) {
101
101
  options.description = options.productName;
102
102
  }
103
103
  if (options.remoteToken == null) {
@@ -1 +1 @@
1
- {"version":3,"file":"SquirrelWindowsTarget.js","sourceRoot":"","sources":["../src/SquirrelWindowsTarget.ts"],"names":[],"mappings":";;AAAA,gEAAoE;AACpE,+CAA8E;AAC9E,iEAA+D;AAC/D,qDAAqF;AAErF,6BAA4B;AAC5B,iDAAiF;AAEjF,MAAqB,qBAAsB,SAAQ,wBAAM;IAIvD,YAA6B,QAAqB,EAAW,MAAc;QACzE,KAAK,CAAC,UAAU,CAAC,CAAA;QADU,aAAQ,GAAR,QAAQ,CAAa;QAAW,WAAM,GAAN,MAAM,CAAQ;QAH3E,2DAA2D;QAClD,YAAO,GAA2B,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,4BAA4B,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,eAAe,EAA4B,CAAA;IAI/J,CAAC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BAAiB,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,UAAU,CAAC,EAAE;QACnK,IAAI,IAAI,IAAI,OAAO,EAAE;YACnB,MAAM,IAAI,wCAAyB,CAAC,UAAU,IAAI,iCAAiC,CAAC,CAAA;SACrF;KACF;IAED,IAAI,OAAO,IAAI,OAAO,EAAE;QACtB,kBAAG,CAAC,IAAI,CAAC,2FAA2F,CAAC,CAAA;QACrG,OAAO,CAAC,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,CAAA;KAC7B;IAED,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAA;IACvB,IAAI,GAAG,IAAI,IAAI,IAAI,OAAO,GAAG,KAAK,SAAS,EAAE;QAC3C,MAAM,IAAI,wCAAyB,CAAC,kDAAkD,GAAG,kBAAkB,CAAC,CAAA;KAC7G;AACH,CAAC","sourcesContent":["import { sanitizeFileName } from \"app-builder-lib/out/util/filename\"\nimport { InvalidConfigurationError, log, isEmptyOrSpaces } from \"builder-util\"\nimport { getBinFromUrl } from \"app-builder-lib/out/binDownload\"\nimport { Arch, getArchSuffix, SquirrelWindowsOptions, Target } from \"app-builder-lib\"\nimport { WinPackager } from \"app-builder-lib/out/winPackager\"\nimport * as path from \"path\"\nimport { convertVersion, SquirrelBuilder, SquirrelOptions } from \"./squirrelPack\"\n\nexport default class SquirrelWindowsTarget extends Target {\n //tslint:disable-next-line:no-object-literal-type-assertion\n readonly options: SquirrelWindowsOptions = { ...this.packager.platformSpecificBuildOptions, ...this.packager.config.squirrelWindows } as SquirrelWindowsOptions\n\n constructor(private readonly packager: WinPackager, readonly outDir: string) {\n super(\"squirrel\")\n }\n\n async build(appOutDir: string, arch: Arch) {\n const packager = this.packager\n const version = packager.appInfo.version\n const sanitizedName = sanitizeFileName(this.appName)\n\n // tslint:disable-next-line:no-invalid-template-strings\n const setupFile = packager.expandArtifactNamePattern(this.options, \"exe\", arch, \"${productName} Setup ${version}.${ext}\")\n const packageFile = `${sanitizedName}-${convertVersion(version)}-full.nupkg`\n\n const installerOutDir = path.join(this.outDir, `squirrel-windows${getArchSuffix(arch)}`)\n const artifactPath = path.join(installerOutDir, setupFile)\n\n await packager.info.callArtifactBuildStarted({\n targetPresentableName: \"Squirrel.Windows\",\n file: artifactPath,\n arch,\n })\n\n if (arch === Arch.ia32) {\n log.warn(\"For windows consider only distributing 64-bit or use nsis target, see https://github.com/electron-userland/electron-builder/issues/359#issuecomment-214851130\")\n }\n\n const distOptions = await this.computeEffectiveDistOptions()\n const squirrelBuilder = new SquirrelBuilder(distOptions, installerOutDir, packager)\n await squirrelBuilder.buildInstaller({ setupFile, packageFile }, appOutDir, this.outDir, arch)\n\n await packager.info.callArtifactBuildCompleted({\n file: artifactPath,\n target: this,\n arch,\n safeArtifactName: `${sanitizedName}-Setup-${version}${getArchSuffix(arch)}.exe`,\n packager: this.packager,\n })\n\n const packagePrefix = `${this.appName}-${convertVersion(version)}-`\n packager.info.dispatchArtifactCreated({\n file: path.join(installerOutDir, `${packagePrefix}full.nupkg`),\n target: this,\n arch,\n packager,\n })\n if (distOptions.remoteReleases != null) {\n packager.info.dispatchArtifactCreated({\n file: path.join(installerOutDir, `${packagePrefix}delta.nupkg`),\n target: this,\n arch,\n packager,\n })\n }\n\n packager.info.dispatchArtifactCreated({\n file: path.join(installerOutDir, \"RELEASES\"),\n target: this,\n arch,\n packager,\n })\n }\n\n private get appName() {\n return this.options.name || this.packager.appInfo.name\n }\n\n async computeEffectiveDistOptions(): Promise<SquirrelOptions> {\n const packager = this.packager\n let iconUrl = this.options.iconUrl\n if (iconUrl == null) {\n const info = await packager.info.repositoryInfo\n if (info != null) {\n iconUrl = `https://github.com/${info.user}/${info.project}/blob/master/${packager.info.relativeBuildResourcesDirname}/icon.ico?raw=true`\n }\n\n if (iconUrl == null) {\n throw new InvalidConfigurationError(\n \"squirrelWindows.iconUrl is not specified, please see https://www.electron.build/configuration/squirrel-windows#SquirrelWindowsOptions-iconUrl\"\n )\n }\n }\n\n checkConflictingOptions(this.options)\n\n const appInfo = packager.appInfo\n const projectUrl = await appInfo.computePackageUrl()\n const appName = this.appName\n const options: SquirrelOptions = {\n name: appName,\n productName: this.options.name || appInfo.productName,\n appId: this.options.useAppIdAsId ? appInfo.id : appName,\n version: appInfo.version,\n description: appInfo.description,\n // better to explicitly set to empty string, to avoid any nugget errors\n authors: appInfo.companyName || \"\",\n iconUrl,\n extraMetadataSpecs: projectUrl == null ? null : `\\n <projectUrl>${projectUrl}</projectUrl>`,\n copyright: appInfo.copyright,\n packageCompressionLevel: parseInt((process.env.ELECTRON_BUILDER_COMPRESSION_LEVEL || packager.compression === \"store\" ? 0 : 9) as any, 10),\n vendorPath: await getBinFromUrl(\"Squirrel.Windows\", \"1.9.0\", \"zJHk4CMATM7jHJ2ojRH1n3LkOnaIezDk5FAzJmlSEQSiEdRuB4GGLCegLDtsRCakfHIVfKh3ysJHLjynPkXwhQ==\"),\n ...(this.options as any),\n }\n\n if (isEmptyOrSpaces(options.description)) {\n options.description = options.productName\n }\n\n if (options.remoteToken == null) {\n options.remoteToken = process.env.GH_TOKEN || process.env.GITHUB_TOKEN\n }\n\n if (!(\"loadingGif\" in options)) {\n const resourceList = await packager.resourceList\n if (resourceList.includes(\"install-spinner.gif\")) {\n options.loadingGif = path.join(packager.buildResourcesDir, \"install-spinner.gif\")\n }\n }\n\n if (this.options.remoteReleases === true) {\n const info = await packager.info.repositoryInfo\n if (info == null) {\n log.warn(\"remoteReleases set to true, but cannot get repository info\")\n } else {\n options.remoteReleases = `https://github.com/${info.user}/${info.project}`\n log.info({ remoteReleases: options.remoteReleases }, `remoteReleases is set`)\n }\n }\n\n return options\n }\n}\n\nfunction checkConflictingOptions(options: any) {\n for (const name of [\"outputDirectory\", \"appDirectory\", \"exe\", \"fixUpPaths\", \"usePackageJson\", \"extraFileSpecs\", \"extraMetadataSpecs\", \"skipUpdateIcon\", \"setupExe\"]) {\n if (name in options) {\n throw new InvalidConfigurationError(`Option ${name} is ignored, do not specify it.`)\n }\n }\n\n if (\"noMsi\" in options) {\n log.warn(`noMsi is deprecated, please specify as \"msi\": true if you want to create an MSI installer`)\n options.msi = !options.noMsi\n }\n\n const msi = options.msi\n if (msi != null && typeof msi !== \"boolean\") {\n throw new InvalidConfigurationError(`msi expected to be boolean value, but string '\"${msi}\"' was specified`)\n }\n}\n"]}
1
+ {"version":3,"file":"SquirrelWindowsTarget.js","sourceRoot":"","sources":["../src/SquirrelWindowsTarget.ts"],"names":[],"mappings":";;AAAA,gEAAoE;AACpE,+CAA8E;AAC9E,iEAA+D;AAC/D,qDAAqF;AAErF,6BAA4B;AAC5B,iDAAiF;AAEjF,MAAqB,qBAAsB,SAAQ,wBAAM;IAIvD,YAA6B,QAAqB,EAAW,MAAc;QACzE,KAAK,CAAC,UAAU,CAAC,CAAA;QADU,aAAQ,GAAR,QAAQ,CAAa;QAAW,WAAM,GAAN,MAAM,CAAQ;QAH3E,2DAA2D;QAClD,YAAO,GAA2B,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,4BAA4B,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,eAAe,EAA4B,CAAA;IAI/J,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,SAAiB,EAAE,IAAU;QACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAA;QAC9B,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAA;QACxC,MAAM,aAAa,GAAG,IAAA,2BAAgB,EAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAEpD,uDAAuD;QACvD,MAAM,SAAS,GAAG,QAAQ,CAAC,yBAAyB,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,wCAAwC,CAAC,CAAA;QACzH,MAAM,WAAW,GAAG,GAAG,aAAa,IAAI,IAAA,6BAAc,EAAC,OAAO,CAAC,aAAa,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AG,OAAO,CAAC,GAAG,CAAA;IACvB,IAAI,GAAG,IAAI,IAAI,IAAI,OAAO,GAAG,KAAK,SAAS,EAAE;QAC3C,MAAM,IAAI,wCAAyB,CAAC,kDAAkD,GAAG,kBAAkB,CAAC,CAAA;KAC7G;AACH,CAAC","sourcesContent":["import { sanitizeFileName } from \"app-builder-lib/out/util/filename\"\nimport { InvalidConfigurationError, log, isEmptyOrSpaces } from \"builder-util\"\nimport { getBinFromUrl } from \"app-builder-lib/out/binDownload\"\nimport { Arch, getArchSuffix, SquirrelWindowsOptions, Target } from \"app-builder-lib\"\nimport { WinPackager } from \"app-builder-lib/out/winPackager\"\nimport * as path from \"path\"\nimport { convertVersion, SquirrelBuilder, SquirrelOptions } from \"./squirrelPack\"\n\nexport default class SquirrelWindowsTarget extends Target {\n //tslint:disable-next-line:no-object-literal-type-assertion\n readonly options: SquirrelWindowsOptions = { ...this.packager.platformSpecificBuildOptions, ...this.packager.config.squirrelWindows } as SquirrelWindowsOptions\n\n constructor(private readonly packager: WinPackager, readonly outDir: string) {\n super(\"squirrel\")\n }\n\n async build(appOutDir: string, arch: Arch) {\n const packager = this.packager\n const version = packager.appInfo.version\n const sanitizedName = sanitizeFileName(this.appName)\n\n // tslint:disable-next-line:no-invalid-template-strings\n const setupFile = packager.expandArtifactNamePattern(this.options, \"exe\", arch, \"${productName} Setup ${version}.${ext}\")\n const packageFile = `${sanitizedName}-${convertVersion(version)}-full.nupkg`\n\n const installerOutDir = path.join(this.outDir, `squirrel-windows${getArchSuffix(arch)}`)\n const artifactPath = path.join(installerOutDir, setupFile)\n\n await packager.info.callArtifactBuildStarted({\n targetPresentableName: \"Squirrel.Windows\",\n file: artifactPath,\n arch,\n })\n\n if (arch === Arch.ia32) {\n log.warn(\"For windows consider only distributing 64-bit or use nsis target, see https://github.com/electron-userland/electron-builder/issues/359#issuecomment-214851130\")\n }\n\n const distOptions = await this.computeEffectiveDistOptions()\n const squirrelBuilder = new SquirrelBuilder(distOptions, installerOutDir, packager)\n await squirrelBuilder.buildInstaller({ setupFile, packageFile }, appOutDir, this.outDir, arch)\n\n await packager.info.callArtifactBuildCompleted({\n file: artifactPath,\n target: this,\n arch,\n safeArtifactName: `${sanitizedName}-Setup-${version}${getArchSuffix(arch)}.exe`,\n packager: this.packager,\n })\n\n const packagePrefix = `${this.appName}-${convertVersion(version)}-`\n packager.info.dispatchArtifactCreated({\n file: path.join(installerOutDir, `${packagePrefix}full.nupkg`),\n target: this,\n arch,\n packager,\n })\n if (distOptions.remoteReleases != null) {\n packager.info.dispatchArtifactCreated({\n file: path.join(installerOutDir, `${packagePrefix}delta.nupkg`),\n target: this,\n arch,\n packager,\n })\n }\n\n packager.info.dispatchArtifactCreated({\n file: path.join(installerOutDir, \"RELEASES\"),\n target: this,\n arch,\n packager,\n })\n }\n\n private get appName() {\n return this.options.name || this.packager.appInfo.name\n }\n\n async computeEffectiveDistOptions(): Promise<SquirrelOptions> {\n const packager = this.packager\n let iconUrl = this.options.iconUrl\n if (iconUrl == null) {\n const info = await packager.info.repositoryInfo\n if (info != null) {\n iconUrl = `https://github.com/${info.user}/${info.project}/blob/master/${packager.info.relativeBuildResourcesDirname}/icon.ico?raw=true`\n }\n\n if (iconUrl == null) {\n throw new InvalidConfigurationError(\n \"squirrelWindows.iconUrl is not specified, please see https://www.electron.build/configuration/squirrel-windows#SquirrelWindowsOptions-iconUrl\"\n )\n }\n }\n\n checkConflictingOptions(this.options)\n\n const appInfo = packager.appInfo\n const projectUrl = await appInfo.computePackageUrl()\n const appName = this.appName\n const options: SquirrelOptions = {\n name: appName,\n productName: this.options.name || appInfo.productName,\n appId: this.options.useAppIdAsId ? appInfo.id : appName,\n version: appInfo.version,\n description: appInfo.description,\n // better to explicitly set to empty string, to avoid any nugget errors\n authors: appInfo.companyName || \"\",\n iconUrl,\n extraMetadataSpecs: projectUrl == null ? null : `\\n <projectUrl>${projectUrl}</projectUrl>`,\n copyright: appInfo.copyright,\n packageCompressionLevel: parseInt((process.env.ELECTRON_BUILDER_COMPRESSION_LEVEL || packager.compression === \"store\" ? 0 : 9) as any, 10),\n vendorPath: await getBinFromUrl(\"Squirrel.Windows\", \"1.9.0\", \"zJHk4CMATM7jHJ2ojRH1n3LkOnaIezDk5FAzJmlSEQSiEdRuB4GGLCegLDtsRCakfHIVfKh3ysJHLjynPkXwhQ==\"),\n ...(this.options as any),\n }\n\n if (isEmptyOrSpaces(options.description)) {\n options.description = options.productName\n }\n\n if (options.remoteToken == null) {\n options.remoteToken = process.env.GH_TOKEN || process.env.GITHUB_TOKEN\n }\n\n if (!(\"loadingGif\" in options)) {\n const resourceList = await packager.resourceList\n if (resourceList.includes(\"install-spinner.gif\")) {\n options.loadingGif = path.join(packager.buildResourcesDir, \"install-spinner.gif\")\n }\n }\n\n if (this.options.remoteReleases === true) {\n const info = await packager.info.repositoryInfo\n if (info == null) {\n log.warn(\"remoteReleases set to true, but cannot get repository info\")\n } else {\n options.remoteReleases = `https://github.com/${info.user}/${info.project}`\n log.info({ remoteReleases: options.remoteReleases }, `remoteReleases is set`)\n }\n }\n\n return options\n }\n}\n\nfunction checkConflictingOptions(options: any) {\n for (const name of [\"outputDirectory\", \"appDirectory\", \"exe\", \"fixUpPaths\", \"usePackageJson\", \"extraFileSpecs\", \"extraMetadataSpecs\", \"skipUpdateIcon\", \"setupExe\"]) {\n if (name in options) {\n throw new InvalidConfigurationError(`Option ${name} is ignored, do not specify it.`)\n }\n }\n\n if (\"noMsi\" in options) {\n log.warn(`noMsi is deprecated, please specify as \"msi\": true if you want to create an MSI installer`)\n options.msi = !options.noMsi\n }\n\n const msi = options.msi\n if (msi != null && typeof msi !== \"boolean\") {\n throw new InvalidConfigurationError(`msi expected to be boolean value, but string '\"${msi}\"' was specified`)\n }\n}\n"]}
@@ -23,11 +23,11 @@ function convertVersion(version) {
23
23
  exports.convertVersion = convertVersion;
24
24
  function syncReleases(outputDirectory, options) {
25
25
  builder_util_1.log.info("syncing releases to build delta package");
26
- const args = wine_1.prepareWindowsExecutableArgs(["-u", options.remoteReleases, "-r", outputDirectory], path.join(options.vendorPath, "SyncReleases.exe"));
26
+ const args = (0, wine_1.prepareWindowsExecutableArgs)(["-u", options.remoteReleases, "-r", outputDirectory], path.join(options.vendorPath, "SyncReleases.exe"));
27
27
  if (options.remoteToken) {
28
28
  args.push("-t", options.remoteToken);
29
29
  }
30
- return builder_util_1.spawn(process.platform === "win32" ? path.join(options.vendorPath, "SyncReleases.exe") : "mono", args);
30
+ return (0, builder_util_1.spawn)(process.platform === "win32" ? path.join(options.vendorPath, "SyncReleases.exe") : "mono", args);
31
31
  }
32
32
  class SquirrelBuilder {
33
33
  constructor(options, outputDirectory, packager) {
@@ -42,13 +42,13 @@ class SquirrelBuilder {
42
42
  const options = this.options;
43
43
  const appUpdate = path.join(dirToArchive, "Update.exe");
44
44
  await Promise.all([
45
- fs_1.copyFile(path.join(options.vendorPath, "Update.exe"), appUpdate).then(() => packager.sign(appUpdate)),
45
+ (0, fs_1.copyFile)(path.join(options.vendorPath, "Update.exe"), appUpdate).then(() => packager.sign(appUpdate)),
46
46
  Promise.all([
47
47
  fs.rm(`${outputDirectory.replace(/\\/g, "/")}/*-full.nupkg`, { recursive: true, force: true }),
48
48
  fs.rm(path.join(outputDirectory, "RELEASES"), { recursive: true, force: true }),
49
49
  ]).then(() => fs.mkdir(outputDirectory, { recursive: true })),
50
50
  ]);
51
- if (builder_util_1.isEmptyOrSpaces(options.description)) {
51
+ if ((0, builder_util_1.isEmptyOrSpaces)(options.description)) {
52
52
  options.description = options.productName;
53
53
  }
54
54
  if (options.remoteReleases) {
@@ -59,13 +59,13 @@ class SquirrelBuilder {
59
59
  const setupPath = path.join(outputDirectory, outFileNames.setupFile);
60
60
  await Promise.all([
61
61
  pack(options, appOutDir, appUpdate, nupkgPath, version, packager),
62
- fs_1.copyFile(path.join(options.vendorPath, "Setup.exe"), setupPath),
63
- fs_1.copyFile(options.loadingGif ? path.resolve(packager.projectDir, options.loadingGif) : path.join(options.vendorPath, "install-spinner.gif"), path.join(dirToArchive, "background.gif")),
62
+ (0, fs_1.copyFile)(path.join(options.vendorPath, "Setup.exe"), setupPath),
63
+ (0, fs_1.copyFile)(options.loadingGif ? path.resolve(packager.projectDir, options.loadingGif) : path.join(options.vendorPath, "install-spinner.gif"), path.join(dirToArchive, "background.gif")),
64
64
  ]);
65
65
  // releasify can be called only after pack nupkg and nupkg must be in the final output directory (where other old version nupkg can be located)
66
- await this.releasify(nupkgPath, outFileNames.packageFile).then(it => fs_extra_1.writeFile(path.join(dirToArchive, "RELEASES"), it));
66
+ await this.releasify(nupkgPath, outFileNames.packageFile).then(it => (0, fs_extra_1.writeFile)(path.join(dirToArchive, "RELEASES"), it));
67
67
  const embeddedArchiveFile = await this.createEmbeddedArchiveFile(nupkgPath, dirToArchive);
68
- await wine_1.execWine(path.join(options.vendorPath, "WriteZipToSetup.exe"), null, [setupPath, embeddedArchiveFile]);
68
+ await (0, wine_1.execWine)(path.join(options.vendorPath, "WriteZipToSetup.exe"), null, [setupPath, embeddedArchiveFile]);
69
69
  await packager.signAndEditResources(setupPath, arch, outDir);
70
70
  if (options.msi && process.platform === "win32") {
71
71
  const outFile = outFileNames.setupFile.replace(".exe", ".msi");
@@ -78,7 +78,7 @@ class SquirrelBuilder {
78
78
  const args = ["--releasify", nupkgPath, "--releaseDir", this.outputDirectory];
79
79
  const out = (await execSw(this.options, args)).trim();
80
80
  if (builder_util_1.debug.enabled) {
81
- builder_util_1.debug(`Squirrel output: ${out}`);
81
+ (0, builder_util_1.debug)(`Squirrel output: ${out}`);
82
82
  }
83
83
  const lines = out.split("\n");
84
84
  for (let i = lines.length - 1; i > -1; i--) {
@@ -91,13 +91,13 @@ class SquirrelBuilder {
91
91
  }
92
92
  async createEmbeddedArchiveFile(nupkgPath, dirToArchive) {
93
93
  const embeddedArchiveFile = await this.packager.getTempFile("setup.zip");
94
- await builder_util_1.exec(_7zip_bin_1.path7za, archive_1.compute7zCompressArgs("zip", {
94
+ await (0, builder_util_1.exec)(_7zip_bin_1.path7za, (0, archive_1.compute7zCompressArgs)("zip", {
95
95
  isRegularFile: true,
96
96
  compression: this.packager.compression,
97
97
  }).concat(embeddedArchiveFile, "."), {
98
98
  cwd: dirToArchive,
99
99
  });
100
- await builder_util_1.exec(_7zip_bin_1.path7za, archive_1.compute7zCompressArgs("zip", {
100
+ await (0, builder_util_1.exec)(_7zip_bin_1.path7za, (0, archive_1.compute7zCompressArgs)("zip", {
101
101
  isRegularFile: true,
102
102
  compression: "store" /* nupkg is already compressed */,
103
103
  }).concat(embeddedArchiveFile, nupkgPath));
@@ -108,7 +108,7 @@ exports.SquirrelBuilder = SquirrelBuilder;
108
108
  async function pack(options, directory, updateFile, outFile, version, packager) {
109
109
  // SW now doesn't support 0-level nupkg compressed files. It means that we are forced to use level 1 if store level requested.
110
110
  const archive = archiver("zip", { zlib: { level: Math.max(1, options.packageCompressionLevel == null ? 9 : options.packageCompressionLevel) } });
111
- const archiveOut = fs_extra_1.createWriteStream(outFile);
111
+ const archiveOut = (0, fs_extra_1.createWriteStream)(outFile);
112
112
  const archivePromise = new Promise((resolve, reject) => {
113
113
  archive.on("error", reject);
114
114
  archiveOut.on("error", reject);
@@ -130,7 +130,7 @@ async function pack(options, directory, updateFile, outFile, version, packager)
130
130
  <copyright>${copyright}</copyright>${options.extraMetadataSpecs || ""}
131
131
  </metadata>
132
132
  </package>`;
133
- builder_util_1.debug(`Created NuSpec file:\n${nuspecContent}`);
133
+ (0, builder_util_1.debug)(`Created NuSpec file:\n${nuspecContent}`);
134
134
  archive.append(nuspecContent.replace(/\n/, "\r\n"), { name: `${options.name}.nuspec` });
135
135
  //noinspection SpellCheckingInspection
136
136
  archive.append(`<?xml version="1.0" encoding="utf-8"?>
@@ -172,7 +172,7 @@ async function pack(options, directory, updateFile, outFile, version, packager)
172
172
  await archivePromise;
173
173
  }
174
174
  function execSw(options, args) {
175
- return builder_util_1.exec(process.platform === "win32" ? path.join(options.vendorPath, "Update.com") : "mono", wine_1.prepareWindowsExecutableArgs(args, path.join(options.vendorPath, "Update-Mono.exe")), {
175
+ return (0, builder_util_1.exec)(process.platform === "win32" ? path.join(options.vendorPath, "Update.com") : "mono", (0, wine_1.prepareWindowsExecutableArgs)(args, path.join(options.vendorPath, "Update-Mono.exe")), {
176
176
  env: {
177
177
  ...process.env,
178
178
  SZA_PATH: _7zip_bin_1.path7za,
@@ -183,22 +183,22 @@ async function msi(options, nupkgPath, setupPath, outputDirectory, outFile) {
183
183
  const args = ["--createMsi", nupkgPath, "--bootstrapperExe", setupPath];
184
184
  await execSw(options, args);
185
185
  //noinspection SpellCheckingInspection
186
- await builder_util_1.exec(path.join(options.vendorPath, "candle.exe"), ["-nologo", "-ext", "WixNetFxExtension", "-out", "Setup.wixobj", "Setup.wxs"], {
186
+ await (0, builder_util_1.exec)(path.join(options.vendorPath, "candle.exe"), ["-nologo", "-ext", "WixNetFxExtension", "-out", "Setup.wixobj", "Setup.wxs"], {
187
187
  cwd: outputDirectory,
188
188
  });
189
189
  //noinspection SpellCheckingInspection
190
- await builder_util_1.exec(path.join(options.vendorPath, "light.exe"), ["-ext", "WixNetFxExtension", "-sval", "-out", outFile, "Setup.wixobj"], {
190
+ await (0, builder_util_1.exec)(path.join(options.vendorPath, "light.exe"), ["-ext", "WixNetFxExtension", "-sval", "-out", outFile, "Setup.wixobj"], {
191
191
  cwd: outputDirectory,
192
192
  });
193
193
  //noinspection SpellCheckingInspection
194
194
  await Promise.all([
195
- fs_extra_1.unlink(path.join(outputDirectory, "Setup.wxs")),
196
- fs_extra_1.unlink(path.join(outputDirectory, "Setup.wixobj")),
197
- fs_extra_1.unlink(path.join(outputDirectory, outFile.replace(".msi", ".wixpdb"))).catch(e => builder_util_1.debug(e.toString())),
195
+ (0, fs_extra_1.unlink)(path.join(outputDirectory, "Setup.wxs")),
196
+ (0, fs_extra_1.unlink)(path.join(outputDirectory, "Setup.wixobj")),
197
+ (0, fs_extra_1.unlink)(path.join(outputDirectory, outFile.replace(".msi", ".wixpdb"))).catch((e) => (0, builder_util_1.debug)(e.toString())),
198
198
  ]);
199
199
  }
200
200
  async function encodedZip(archive, dir, prefix, vendorPath, packager) {
201
- await fs_1.walk(dir, null, {
201
+ await (0, fs_1.walk)(dir, null, {
202
202
  isIncludeDir: true,
203
203
  consume: async (file, stats) => {
204
204
  if (stats.isDirectory()) {
@@ -214,13 +214,13 @@ async function encodedZip(archive, dir, prefix, vendorPath, packager) {
214
214
  // https://github.com/Squirrel/Squirrel.Windows/pull/1051 Only generate execution stubs for the top-level executables
215
215
  if (file.endsWith(".exe") && !file.includes("squirrel.exe") && !relativeSafeFilePath.includes("/")) {
216
216
  const tempFile = await packager.getTempFile("stub.exe");
217
- await fs_1.copyFile(path.join(vendorPath, "StubExecutable.exe"), tempFile);
218
- await wine_1.execWine(path.join(vendorPath, "WriteZipToSetup.exe"), null, ["--copy-stub-resources", file, tempFile]);
217
+ await (0, fs_1.copyFile)(path.join(vendorPath, "StubExecutable.exe"), tempFile);
218
+ await (0, wine_1.execWine)(path.join(vendorPath, "WriteZipToSetup.exe"), null, ["--copy-stub-resources", file, tempFile]);
219
219
  await packager.sign(tempFile);
220
220
  archive._append(tempFile, {
221
221
  name: relativeSafeFilePath.substring(0, relativeSafeFilePath.length - 4) + "_ExecutionStub.exe",
222
222
  prefix,
223
- stats: await fs_extra_1.stat(tempFile),
223
+ stats: await (0, fs_extra_1.stat)(tempFile),
224
224
  });
225
225
  }
226
226
  },
@@ -1 +1 @@
1
- {"version":3,"file":"squirrelPack.js","sourceRoot":"","sources":["../src/squirrelPack.ts"],"names":[],"mappings":";;;AAAA,wCAAkC;AAClC,+CAA6E;AAC7E,4CAAoD;AACpD,iEAA2E;AAC3E,mDAAgG;AAEhG,uCAAqE;AACrE,6BAA4B;AAC5B,qCAAoC;AACpC,kCAAiC;AAEjC,SAAgB,cAAc,CAAC,OAAe;IAC5C,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAChC,MAA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AQ,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;gBAClG,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAA;gBACvD,MAAM,aAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,oBAAoB,CAAC,EAAE,QAAQ,CAAC,CAAA;gBACrE,MAAM,eAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,qBAAqB,CAAC,EAAE,IAAI,EAAE,CAAC,uBAAuB,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAA;gBAC7G,MAAM,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;gBAE7B,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE;oBACxB,IAAI,EAAE,oBAAoB,CAAC,SAAS,CAAC,CAAC,EAAE,oBAAoB,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,oBAAoB;oBAC/F,MAAM;oBACN,KAAK,EAAE,MAAM,eAAI,CAAC,QAAQ,CAAC;iBAC5B,CAAC,CAAA;aACH;QACH,CAAC;KACF,CAAC,CAAA;IACF,OAAO,CAAC,QAAQ,EAAE,CAAA;AACpB,CAAC","sourcesContent":["import { path7za } from \"7zip-bin\"\nimport { Arch, debug, exec, log, spawn, isEmptyOrSpaces } from \"builder-util\"\nimport { copyFile, walk } from \"builder-util/out/fs\"\nimport { compute7zCompressArgs } from \"app-builder-lib/out/targets/archive\"\nimport { execWine, prepareWindowsExecutableArgs as prepareArgs } from \"app-builder-lib/out/wine\"\nimport { WinPackager } from \"app-builder-lib/out/winPackager\"\nimport { createWriteStream, stat, unlink, writeFile } from \"fs-extra\"\nimport * as path from \"path\"\nimport * as archiver from \"archiver\"\nimport * as fs from \"fs/promises\"\n\nexport function convertVersion(version: string): string {\n const parts = version.split(\"-\")\n const mainVersion = parts.shift()\n if (parts.length > 0) {\n return [mainVersion, parts.join(\"-\").replace(/\\./g, \"\")].join(\"-\")\n } else {\n return mainVersion!\n }\n}\n\nfunction syncReleases(outputDirectory: string, options: SquirrelOptions) {\n log.info(\"syncing releases to build delta package\")\n const args = prepareArgs([\"-u\", options.remoteReleases!, \"-r\", outputDirectory], path.join(options.vendorPath, \"SyncReleases.exe\"))\n if (options.remoteToken) {\n args.push(\"-t\", options.remoteToken)\n }\n return spawn(process.platform === \"win32\" ? path.join(options.vendorPath, \"SyncReleases.exe\") : \"mono\", args)\n}\n\nexport interface SquirrelOptions {\n vendorPath: string\n remoteReleases?: string\n remoteToken?: string\n loadingGif?: string\n productName: string\n appId?: string\n name: string\n packageCompressionLevel?: number\n version: string\n msi?: any\n\n description?: string\n iconUrl?: string\n authors?: string\n extraMetadataSpecs?: string\n copyright?: string\n}\n\nexport interface OutFileNames {\n setupFile: string\n packageFile: string\n}\n\nexport class SquirrelBuilder {\n constructor(private readonly options: SquirrelOptions, private readonly outputDirectory: string, private readonly packager: WinPackager) {}\n\n async buildInstaller(outFileNames: OutFileNames, appOutDir: string, outDir: string, arch: Arch) {\n const packager = this.packager\n const dirToArchive = await packager.info.tempDirManager.createTempDir({ prefix: \"squirrel-windows\" })\n const outputDirectory = this.outputDirectory\n const options = this.options\n const appUpdate = path.join(dirToArchive, \"Update.exe\")\n await Promise.all([\n copyFile(path.join(options.vendorPath, \"Update.exe\"), appUpdate).then(() => packager.sign(appUpdate)),\n Promise.all([\n fs.rm(`${outputDirectory.replace(/\\\\/g, \"/\")}/*-full.nupkg`, { recursive: true, force: true }),\n fs.rm(path.join(outputDirectory, \"RELEASES\"), { recursive: true, force: true }),\n ]).then(() => fs.mkdir(outputDirectory, { recursive: true })),\n ])\n\n if (isEmptyOrSpaces(options.description)) {\n options.description = options.productName\n }\n\n if (options.remoteReleases) {\n await syncReleases(outputDirectory, options)\n }\n\n const version = convertVersion(options.version)\n const nupkgPath = path.join(outputDirectory, outFileNames.packageFile)\n const setupPath = path.join(outputDirectory, outFileNames.setupFile)\n\n await Promise.all<any>([\n pack(options, appOutDir, appUpdate, nupkgPath, version, packager),\n copyFile(path.join(options.vendorPath, \"Setup.exe\"), setupPath),\n copyFile(\n options.loadingGif ? path.resolve(packager.projectDir, options.loadingGif) : path.join(options.vendorPath, \"install-spinner.gif\"),\n path.join(dirToArchive, \"background.gif\")\n ),\n ])\n\n // releasify can be called only after pack nupkg and nupkg must be in the final output directory (where other old version nupkg can be located)\n await this.releasify(nupkgPath, outFileNames.packageFile).then(it => writeFile(path.join(dirToArchive, \"RELEASES\"), it))\n\n const embeddedArchiveFile = await this.createEmbeddedArchiveFile(nupkgPath, dirToArchive)\n\n await execWine(path.join(options.vendorPath, \"WriteZipToSetup.exe\"), null, [setupPath, embeddedArchiveFile])\n\n await packager.signAndEditResources(setupPath, arch, outDir)\n if (options.msi && process.platform === \"win32\") {\n const outFile = outFileNames.setupFile.replace(\".exe\", \".msi\")\n await msi(options, nupkgPath, setupPath, outputDirectory, outFile)\n // rcedit can only edit .exe resources\n await packager.sign(path.join(outputDirectory, outFile))\n }\n }\n\n private async releasify(nupkgPath: string, packageName: string) {\n const args = [\"--releasify\", nupkgPath, \"--releaseDir\", this.outputDirectory]\n const out = (await execSw(this.options, args)).trim()\n if (debug.enabled) {\n debug(`Squirrel output: ${out}`)\n }\n\n const lines = out.split(\"\\n\")\n for (let i = lines.length - 1; i > -1; i--) {\n const line = lines[i]\n if (line.includes(packageName)) {\n return line.trim()\n }\n }\n\n throw new Error(`Invalid output, cannot find last release entry, output: ${out}`)\n }\n\n private async createEmbeddedArchiveFile(nupkgPath: string, dirToArchive: string) {\n const embeddedArchiveFile = await this.packager.getTempFile(\"setup.zip\")\n await exec(\n path7za,\n compute7zCompressArgs(\"zip\", {\n isRegularFile: true,\n compression: this.packager.compression,\n }).concat(embeddedArchiveFile, \".\"),\n {\n cwd: dirToArchive,\n }\n )\n await exec(\n path7za,\n compute7zCompressArgs(\"zip\", {\n isRegularFile: true,\n compression: \"store\" /* nupkg is already compressed */,\n }).concat(embeddedArchiveFile, nupkgPath)\n )\n return embeddedArchiveFile\n }\n}\n\nasync function pack(options: SquirrelOptions, directory: string, updateFile: string, outFile: string, version: string, packager: WinPackager) {\n // SW now doesn't support 0-level nupkg compressed files. It means that we are forced to use level 1 if store level requested.\n const archive = archiver(\"zip\", { zlib: { level: Math.max(1, options.packageCompressionLevel == null ? 9 : options.packageCompressionLevel) } })\n const archiveOut = createWriteStream(outFile)\n const archivePromise = new Promise((resolve, reject) => {\n archive.on(\"error\", reject)\n archiveOut.on(\"error\", reject)\n archiveOut.on(\"close\", resolve)\n })\n archive.pipe(archiveOut)\n\n const author = options.authors\n const copyright = options.copyright || `Copyright © ${new Date().getFullYear()} ${author}`\n const nuspecContent = `<?xml version=\"1.0\"?>\n<package xmlns=\"http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd\">\n <metadata>\n <id>${options.appId}</id>\n <version>${version}</version>\n <title>${options.productName}</title>\n <authors>${author}</authors>\n <iconUrl>${options.iconUrl}</iconUrl>\n <requireLicenseAcceptance>false</requireLicenseAcceptance>\n <description>${options.description}</description>\n <copyright>${copyright}</copyright>${options.extraMetadataSpecs || \"\"}\n </metadata>\n</package>`\n debug(`Created NuSpec file:\\n${nuspecContent}`)\n archive.append(nuspecContent.replace(/\\n/, \"\\r\\n\"), { name: `${options.name}.nuspec` })\n\n //noinspection SpellCheckingInspection\n archive.append(\n `<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">\n <Relationship Type=\"http://schemas.microsoft.com/packaging/2010/07/manifest\" Target=\"/${options.name}.nuspec\" Id=\"Re0\" />\n <Relationship Type=\"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\" Target=\"/package/services/metadata/core-properties/1.psmdcp\" Id=\"Re1\" />\n</Relationships>`.replace(/\\n/, \"\\r\\n\"),\n { name: \".rels\", prefix: \"_rels\" }\n )\n\n //noinspection SpellCheckingInspection\n archive.append(\n `<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Types xmlns=\"http://schemas.openxmlformats.org/package/2006/content-types\">\n <Default Extension=\"rels\" ContentType=\"application/vnd.openxmlformats-package.relationships+xml\" />\n <Default Extension=\"nuspec\" ContentType=\"application/octet\" />\n <Default Extension=\"pak\" ContentType=\"application/octet\" />\n <Default Extension=\"asar\" ContentType=\"application/octet\" />\n <Default Extension=\"bin\" ContentType=\"application/octet\" />\n <Default Extension=\"dll\" ContentType=\"application/octet\" />\n <Default Extension=\"exe\" ContentType=\"application/octet\" />\n <Default Extension=\"dat\" ContentType=\"application/octet\" />\n <Default Extension=\"psmdcp\" ContentType=\"application/vnd.openxmlformats-package.core-properties+xml\" />\n <Default Extension=\"diff\" ContentType=\"application/octet\" />\n <Default Extension=\"bsdiff\" ContentType=\"application/octet\" />\n <Default Extension=\"shasum\" ContentType=\"text/plain\" />\n <Default Extension=\"mp3\" ContentType=\"audio/mpeg\" />\n <Default Extension=\"node\" ContentType=\"application/octet\" />\n</Types>`.replace(/\\n/, \"\\r\\n\"),\n { name: \"[Content_Types].xml\" }\n )\n\n archive.append(\n `<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<coreProperties xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:dcterms=\"http://purl.org/dc/terms/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xmlns=\"http://schemas.openxmlformats.org/package/2006/metadata/core-properties\">\n <dc:creator>${author}</dc:creator>\n <dc:description>${options.description}</dc:description>\n <dc:identifier>${options.appId}</dc:identifier>\n <version>${version}</version>\n <keywords/>\n <dc:title>${options.productName}</dc:title>\n <lastModifiedBy>NuGet, Version=2.8.50926.602, Culture=neutral, PublicKeyToken=null;Microsoft Windows NT 6.2.9200.0;.NET Framework 4</lastModifiedBy>\n</coreProperties>`.replace(/\\n/, \"\\r\\n\"),\n { name: \"1.psmdcp\", prefix: \"package/services/metadata/core-properties\" }\n )\n\n archive.file(updateFile, { name: \"Update.exe\", prefix: \"lib/net45\" })\n await encodedZip(archive, directory, \"lib/net45\", options.vendorPath, packager)\n await archivePromise\n}\n\nfunction execSw(options: SquirrelOptions, args: Array<string>) {\n return exec(process.platform === \"win32\" ? path.join(options.vendorPath, \"Update.com\") : \"mono\", prepareArgs(args, path.join(options.vendorPath, \"Update-Mono.exe\")), {\n env: {\n ...process.env,\n SZA_PATH: path7za,\n },\n })\n}\n\nasync function msi(options: SquirrelOptions, nupkgPath: string, setupPath: string, outputDirectory: string, outFile: string) {\n const args = [\"--createMsi\", nupkgPath, \"--bootstrapperExe\", setupPath]\n await execSw(options, args)\n //noinspection SpellCheckingInspection\n await exec(path.join(options.vendorPath, \"candle.exe\"), [\"-nologo\", \"-ext\", \"WixNetFxExtension\", \"-out\", \"Setup.wixobj\", \"Setup.wxs\"], {\n cwd: outputDirectory,\n })\n //noinspection SpellCheckingInspection\n await exec(path.join(options.vendorPath, \"light.exe\"), [\"-ext\", \"WixNetFxExtension\", \"-sval\", \"-out\", outFile, \"Setup.wixobj\"], {\n cwd: outputDirectory,\n })\n\n //noinspection SpellCheckingInspection\n await Promise.all([\n unlink(path.join(outputDirectory, \"Setup.wxs\")),\n unlink(path.join(outputDirectory, \"Setup.wixobj\")),\n unlink(path.join(outputDirectory, outFile.replace(\".msi\", \".wixpdb\"))).catch(e => debug(e.toString())),\n ])\n}\n\nasync function encodedZip(archive: any, dir: string, prefix: string, vendorPath: string, packager: WinPackager) {\n await walk(dir, null, {\n isIncludeDir: true,\n consume: async (file, stats) => {\n if (stats.isDirectory()) {\n return\n }\n\n const relativeSafeFilePath = file.substring(dir.length + 1).replace(/\\\\/g, \"/\")\n archive._append(file, {\n name: relativeSafeFilePath,\n prefix,\n stats,\n })\n\n // createExecutableStubForExe\n // https://github.com/Squirrel/Squirrel.Windows/pull/1051 Only generate execution stubs for the top-level executables\n if (file.endsWith(\".exe\") && !file.includes(\"squirrel.exe\") && !relativeSafeFilePath.includes(\"/\")) {\n const tempFile = await packager.getTempFile(\"stub.exe\")\n await copyFile(path.join(vendorPath, \"StubExecutable.exe\"), tempFile)\n await execWine(path.join(vendorPath, \"WriteZipToSetup.exe\"), null, [\"--copy-stub-resources\", file, tempFile])\n await packager.sign(tempFile)\n\n archive._append(tempFile, {\n name: relativeSafeFilePath.substring(0, relativeSafeFilePath.length - 4) + \"_ExecutionStub.exe\",\n prefix,\n stats: await stat(tempFile),\n })\n }\n },\n })\n archive.finalize()\n}\n"]}
1
+ {"version":3,"file":"squirrelPack.js","sourceRoot":"","sources":["../src/squirrelPack.ts"],"names":[],"mappings":";;;AAAA,wCAAkC;AAClC,+CAA6E;AAC7E,4CAAoD;AACpD,iEAA2E;AAC3E,mDAAgG;AAEhG,uCAAqE;AACrE,6BAA4B;AAC5B,qCAAoC;AACpC,kCAAiC;AAEjC,SAAgB,cAAc,CAAC,OAAe;IAC5C,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAChC,MAAM,WAAW,GAAG,KAAK,CAAC,KAAK,EAAE,CAAA;IACjC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;QACpB,OAAO,CAAC,WAAW,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;KACnE;SAAM;QACL,OAAO,WAAY,CAAA;KACpB;AACH,CAAC;AARD,wCAQC;AAED,SAAS,YAAY,CAAC,eAAuB,EAAE,OAAwB;IACrE,kBAAG,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAA;IACnD,MAAM,IAAI,GAAG,IAAA,mCAAW,EAAC,CAAC,IAAI,EAAE,OAAO,CAAC,cAAe,EAAE,IAAI,EAAE,eAAe,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,kBAAkB,CAA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uB,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAA;gBAC7G,MAAM,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;gBAE7B,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE;oBACxB,IAAI,EAAE,oBAAoB,CAAC,SAAS,CAAC,CAAC,EAAE,oBAAoB,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,oBAAoB;oBAC/F,MAAM;oBACN,KAAK,EAAE,MAAM,IAAA,eAAI,EAAC,QAAQ,CAAC;iBAC5B,CAAC,CAAA;aACH;QACH,CAAC;KACF,CAAC,CAAA;IACF,OAAO,CAAC,QAAQ,EAAE,CAAA;AACpB,CAAC","sourcesContent":["import { path7za } from \"7zip-bin\"\nimport { Arch, debug, exec, log, spawn, isEmptyOrSpaces } from \"builder-util\"\nimport { copyFile, walk } from \"builder-util/out/fs\"\nimport { compute7zCompressArgs } from \"app-builder-lib/out/targets/archive\"\nimport { execWine, prepareWindowsExecutableArgs as prepareArgs } from \"app-builder-lib/out/wine\"\nimport { WinPackager } from \"app-builder-lib/out/winPackager\"\nimport { createWriteStream, stat, unlink, writeFile } from \"fs-extra\"\nimport * as path from \"path\"\nimport * as archiver from \"archiver\"\nimport * as fs from \"fs/promises\"\n\nexport function convertVersion(version: string): string {\n const parts = version.split(\"-\")\n const mainVersion = parts.shift()\n if (parts.length > 0) {\n return [mainVersion, parts.join(\"-\").replace(/\\./g, \"\")].join(\"-\")\n } else {\n return mainVersion!\n }\n}\n\nfunction syncReleases(outputDirectory: string, options: SquirrelOptions) {\n log.info(\"syncing releases to build delta package\")\n const args = prepareArgs([\"-u\", options.remoteReleases!, \"-r\", outputDirectory], path.join(options.vendorPath, \"SyncReleases.exe\"))\n if (options.remoteToken) {\n args.push(\"-t\", options.remoteToken)\n }\n return spawn(process.platform === \"win32\" ? path.join(options.vendorPath, \"SyncReleases.exe\") : \"mono\", args)\n}\n\nexport interface SquirrelOptions {\n vendorPath: string\n remoteReleases?: string\n remoteToken?: string\n loadingGif?: string\n productName: string\n appId?: string\n name: string\n packageCompressionLevel?: number\n version: string\n msi?: any\n\n description?: string\n iconUrl?: string\n authors?: string\n extraMetadataSpecs?: string\n copyright?: string\n}\n\nexport interface OutFileNames {\n setupFile: string\n packageFile: string\n}\n\nexport class SquirrelBuilder {\n constructor(private readonly options: SquirrelOptions, private readonly outputDirectory: string, private readonly packager: WinPackager) {}\n\n async buildInstaller(outFileNames: OutFileNames, appOutDir: string, outDir: string, arch: Arch) {\n const packager = this.packager\n const dirToArchive = await packager.info.tempDirManager.createTempDir({ prefix: \"squirrel-windows\" })\n const outputDirectory = this.outputDirectory\n const options = this.options\n const appUpdate = path.join(dirToArchive, \"Update.exe\")\n await Promise.all([\n copyFile(path.join(options.vendorPath, \"Update.exe\"), appUpdate).then(() => packager.sign(appUpdate)),\n Promise.all([\n fs.rm(`${outputDirectory.replace(/\\\\/g, \"/\")}/*-full.nupkg`, { recursive: true, force: true }),\n fs.rm(path.join(outputDirectory, \"RELEASES\"), { recursive: true, force: true }),\n ]).then(() => fs.mkdir(outputDirectory, { recursive: true })),\n ])\n\n if (isEmptyOrSpaces(options.description)) {\n options.description = options.productName\n }\n\n if (options.remoteReleases) {\n await syncReleases(outputDirectory, options)\n }\n\n const version = convertVersion(options.version)\n const nupkgPath = path.join(outputDirectory, outFileNames.packageFile)\n const setupPath = path.join(outputDirectory, outFileNames.setupFile)\n\n await Promise.all<any>([\n pack(options, appOutDir, appUpdate, nupkgPath, version, packager),\n copyFile(path.join(options.vendorPath, \"Setup.exe\"), setupPath),\n copyFile(\n options.loadingGif ? path.resolve(packager.projectDir, options.loadingGif) : path.join(options.vendorPath, \"install-spinner.gif\"),\n path.join(dirToArchive, \"background.gif\")\n ),\n ])\n\n // releasify can be called only after pack nupkg and nupkg must be in the final output directory (where other old version nupkg can be located)\n await this.releasify(nupkgPath, outFileNames.packageFile).then(it => writeFile(path.join(dirToArchive, \"RELEASES\"), it))\n\n const embeddedArchiveFile = await this.createEmbeddedArchiveFile(nupkgPath, dirToArchive)\n\n await execWine(path.join(options.vendorPath, \"WriteZipToSetup.exe\"), null, [setupPath, embeddedArchiveFile])\n\n await packager.signAndEditResources(setupPath, arch, outDir)\n if (options.msi && process.platform === \"win32\") {\n const outFile = outFileNames.setupFile.replace(\".exe\", \".msi\")\n await msi(options, nupkgPath, setupPath, outputDirectory, outFile)\n // rcedit can only edit .exe resources\n await packager.sign(path.join(outputDirectory, outFile))\n }\n }\n\n private async releasify(nupkgPath: string, packageName: string) {\n const args = [\"--releasify\", nupkgPath, \"--releaseDir\", this.outputDirectory]\n const out = (await execSw(this.options, args)).trim()\n if (debug.enabled) {\n debug(`Squirrel output: ${out}`)\n }\n\n const lines = out.split(\"\\n\")\n for (let i = lines.length - 1; i > -1; i--) {\n const line = lines[i]\n if (line.includes(packageName)) {\n return line.trim()\n }\n }\n\n throw new Error(`Invalid output, cannot find last release entry, output: ${out}`)\n }\n\n private async createEmbeddedArchiveFile(nupkgPath: string, dirToArchive: string) {\n const embeddedArchiveFile = await this.packager.getTempFile(\"setup.zip\")\n await exec(\n path7za,\n compute7zCompressArgs(\"zip\", {\n isRegularFile: true,\n compression: this.packager.compression,\n }).concat(embeddedArchiveFile, \".\"),\n {\n cwd: dirToArchive,\n }\n )\n await exec(\n path7za,\n compute7zCompressArgs(\"zip\", {\n isRegularFile: true,\n compression: \"store\" /* nupkg is already compressed */,\n }).concat(embeddedArchiveFile, nupkgPath)\n )\n return embeddedArchiveFile\n }\n}\n\nasync function pack(options: SquirrelOptions, directory: string, updateFile: string, outFile: string, version: string, packager: WinPackager) {\n // SW now doesn't support 0-level nupkg compressed files. It means that we are forced to use level 1 if store level requested.\n const archive = archiver(\"zip\", { zlib: { level: Math.max(1, options.packageCompressionLevel == null ? 9 : options.packageCompressionLevel) } })\n const archiveOut = createWriteStream(outFile)\n const archivePromise = new Promise((resolve, reject) => {\n archive.on(\"error\", reject)\n archiveOut.on(\"error\", reject)\n archiveOut.on(\"close\", resolve)\n })\n archive.pipe(archiveOut)\n\n const author = options.authors\n const copyright = options.copyright || `Copyright © ${new Date().getFullYear()} ${author}`\n const nuspecContent = `<?xml version=\"1.0\"?>\n<package xmlns=\"http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd\">\n <metadata>\n <id>${options.appId}</id>\n <version>${version}</version>\n <title>${options.productName}</title>\n <authors>${author}</authors>\n <iconUrl>${options.iconUrl}</iconUrl>\n <requireLicenseAcceptance>false</requireLicenseAcceptance>\n <description>${options.description}</description>\n <copyright>${copyright}</copyright>${options.extraMetadataSpecs || \"\"}\n </metadata>\n</package>`\n debug(`Created NuSpec file:\\n${nuspecContent}`)\n archive.append(nuspecContent.replace(/\\n/, \"\\r\\n\"), { name: `${options.name}.nuspec` })\n\n //noinspection SpellCheckingInspection\n archive.append(\n `<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">\n <Relationship Type=\"http://schemas.microsoft.com/packaging/2010/07/manifest\" Target=\"/${options.name}.nuspec\" Id=\"Re0\" />\n <Relationship Type=\"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\" Target=\"/package/services/metadata/core-properties/1.psmdcp\" Id=\"Re1\" />\n</Relationships>`.replace(/\\n/, \"\\r\\n\"),\n { name: \".rels\", prefix: \"_rels\" }\n )\n\n //noinspection SpellCheckingInspection\n archive.append(\n `<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Types xmlns=\"http://schemas.openxmlformats.org/package/2006/content-types\">\n <Default Extension=\"rels\" ContentType=\"application/vnd.openxmlformats-package.relationships+xml\" />\n <Default Extension=\"nuspec\" ContentType=\"application/octet\" />\n <Default Extension=\"pak\" ContentType=\"application/octet\" />\n <Default Extension=\"asar\" ContentType=\"application/octet\" />\n <Default Extension=\"bin\" ContentType=\"application/octet\" />\n <Default Extension=\"dll\" ContentType=\"application/octet\" />\n <Default Extension=\"exe\" ContentType=\"application/octet\" />\n <Default Extension=\"dat\" ContentType=\"application/octet\" />\n <Default Extension=\"psmdcp\" ContentType=\"application/vnd.openxmlformats-package.core-properties+xml\" />\n <Default Extension=\"diff\" ContentType=\"application/octet\" />\n <Default Extension=\"bsdiff\" ContentType=\"application/octet\" />\n <Default Extension=\"shasum\" ContentType=\"text/plain\" />\n <Default Extension=\"mp3\" ContentType=\"audio/mpeg\" />\n <Default Extension=\"node\" ContentType=\"application/octet\" />\n</Types>`.replace(/\\n/, \"\\r\\n\"),\n { name: \"[Content_Types].xml\" }\n )\n\n archive.append(\n `<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<coreProperties xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:dcterms=\"http://purl.org/dc/terms/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xmlns=\"http://schemas.openxmlformats.org/package/2006/metadata/core-properties\">\n <dc:creator>${author}</dc:creator>\n <dc:description>${options.description}</dc:description>\n <dc:identifier>${options.appId}</dc:identifier>\n <version>${version}</version>\n <keywords/>\n <dc:title>${options.productName}</dc:title>\n <lastModifiedBy>NuGet, Version=2.8.50926.602, Culture=neutral, PublicKeyToken=null;Microsoft Windows NT 6.2.9200.0;.NET Framework 4</lastModifiedBy>\n</coreProperties>`.replace(/\\n/, \"\\r\\n\"),\n { name: \"1.psmdcp\", prefix: \"package/services/metadata/core-properties\" }\n )\n\n archive.file(updateFile, { name: \"Update.exe\", prefix: \"lib/net45\" })\n await encodedZip(archive, directory, \"lib/net45\", options.vendorPath, packager)\n await archivePromise\n}\n\nfunction execSw(options: SquirrelOptions, args: Array<string>) {\n return exec(process.platform === \"win32\" ? path.join(options.vendorPath, \"Update.com\") : \"mono\", prepareArgs(args, path.join(options.vendorPath, \"Update-Mono.exe\")), {\n env: {\n ...process.env,\n SZA_PATH: path7za,\n },\n })\n}\n\nasync function msi(options: SquirrelOptions, nupkgPath: string, setupPath: string, outputDirectory: string, outFile: string) {\n const args = [\"--createMsi\", nupkgPath, \"--bootstrapperExe\", setupPath]\n await execSw(options, args)\n //noinspection SpellCheckingInspection\n await exec(path.join(options.vendorPath, \"candle.exe\"), [\"-nologo\", \"-ext\", \"WixNetFxExtension\", \"-out\", \"Setup.wixobj\", \"Setup.wxs\"], {\n cwd: outputDirectory,\n })\n //noinspection SpellCheckingInspection\n await exec(path.join(options.vendorPath, \"light.exe\"), [\"-ext\", \"WixNetFxExtension\", \"-sval\", \"-out\", outFile, \"Setup.wixobj\"], {\n cwd: outputDirectory,\n })\n\n //noinspection SpellCheckingInspection\n await Promise.all([\n unlink(path.join(outputDirectory, \"Setup.wxs\")),\n unlink(path.join(outputDirectory, \"Setup.wixobj\")),\n unlink(path.join(outputDirectory, outFile.replace(\".msi\", \".wixpdb\"))).catch((e: any) => debug(e.toString())),\n ])\n}\n\nasync function encodedZip(archive: any, dir: string, prefix: string, vendorPath: string, packager: WinPackager) {\n await walk(dir, null, {\n isIncludeDir: true,\n consume: async (file, stats) => {\n if (stats.isDirectory()) {\n return\n }\n\n const relativeSafeFilePath = file.substring(dir.length + 1).replace(/\\\\/g, \"/\")\n archive._append(file, {\n name: relativeSafeFilePath,\n prefix,\n stats,\n })\n\n // createExecutableStubForExe\n // https://github.com/Squirrel/Squirrel.Windows/pull/1051 Only generate execution stubs for the top-level executables\n if (file.endsWith(\".exe\") && !file.includes(\"squirrel.exe\") && !relativeSafeFilePath.includes(\"/\")) {\n const tempFile = await packager.getTempFile(\"stub.exe\")\n await copyFile(path.join(vendorPath, \"StubExecutable.exe\"), tempFile)\n await execWine(path.join(vendorPath, \"WriteZipToSetup.exe\"), null, [\"--copy-stub-resources\", file, tempFile])\n await packager.sign(tempFile)\n\n archive._append(tempFile, {\n name: relativeSafeFilePath.substring(0, relativeSafeFilePath.length - 4) + \"_ExecutionStub.exe\",\n prefix,\n stats: await stat(tempFile),\n })\n }\n },\n })\n archive.finalize()\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "electron-builder-squirrel-windows",
3
- "version": "24.0.0-alpha.1",
3
+ "version": "24.0.0-alpha.11",
4
4
  "main": "out/SquirrelWindowsTarget.js",
5
5
  "author": "Vladimir Krivosheev",
6
6
  "license": "MIT",
@@ -15,10 +15,10 @@
15
15
  "out"
16
16
  ],
17
17
  "dependencies": {
18
- "app-builder-lib": "24.0.0-alpha.1",
18
+ "app-builder-lib": "24.0.0-alpha.11",
19
19
  "archiver": "^5.3.1",
20
- "builder-util": "23.6.0",
21
- "fs-extra": "^10.0.0"
20
+ "builder-util": "24.0.0-alpha.11",
21
+ "fs-extra": "^10.1.0"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@types/archiver": "5.3.1",