app-builder-lib 23.0.2 → 23.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/options/pkgOptions.d.ts +3 -1
- package/out/options/pkgOptions.js.map +1 -1
- package/out/targets/nsis/NsisTarget.js +4 -3
- package/out/targets/nsis/NsisTarget.js.map +1 -1
- package/out/targets/nsis/nsisOptions.d.ts +8 -12
- package/out/targets/nsis/nsisOptions.js.map +1 -1
- package/out/targets/targetUtil.d.ts +1 -0
- package/out/targets/targetUtil.js +6 -1
- package/out/targets/targetUtil.js.map +1 -1
- package/out/version.d.ts +1 -1
- package/out/version.js +1 -1
- package/out/version.js.map +1 -1
- package/package.json +7 -7
- package/scheme.json +30 -26
- package/templates/nsis/{readme.md → README.md} +14 -3
- package/templates/nsis/assistedMessages.yml +14 -14
- package/templates/nsis/common.nsh +5 -4
- package/templates/nsis/include/allowOnlyOneInstallerInstance.nsh +1 -1
- package/templates/nsis/messages.yml +5 -5
|
@@ -64,7 +64,9 @@ export interface PkgOptions extends TargetSpecificOptions {
|
|
|
64
64
|
*/
|
|
65
65
|
readonly welcome?: string | null;
|
|
66
66
|
/**
|
|
67
|
-
* Identifies applications that must be closed before the package is installed
|
|
67
|
+
* Identifies applications that must be closed before the package is installed.
|
|
68
|
+
*
|
|
69
|
+
* Corresponds to [must-close](https://developer.apple.com/library/archive/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html#//apple_ref/doc/uid/TP40005370-CH100-SW77).
|
|
68
70
|
*/
|
|
69
71
|
readonly mustClose?: Array<string> | null;
|
|
70
72
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pkgOptions.js","sourceRoot":"","sources":["../../src/options/pkgOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { TargetSpecificOptions } from \"../core\"\n\n// noinspection SpellCheckingInspection\nexport type BackgroundAlignment = \"center\" | \"left\" | \"right\" | \"top\" | \"bottom\" | \"topleft\" | \"topright\" | \"bottomleft\" | \"bottomright\"\n// noinspection SpellCheckingInspection\nexport type BackgroundScaling = \"tofit\" | \"none\" | \"proportional\"\n\n/**\n * macOS product archive options.\n */\nexport interface PkgOptions extends TargetSpecificOptions {\n /**\n * The scripts directory, relative to `build` (build resources directory).\n * The scripts can be in any language so long as the files are marked executable and have the appropriate shebang indicating the path to the interpreter.\n * Scripts are required to be executable (`chmod +x file`).\n * @default build/pkg-scripts\n * @see [Scripting in installer packages](http://macinstallers.blogspot.de/2012/07/scripting-in-installer-packages.html).\n */\n readonly scripts?: string | null\n\n /**\n * should be not documented, only to experiment\n * @private\n */\n readonly productbuild?: Array<string> | null\n\n /**\n * The install location. [Do not use it](https://stackoverflow.com/questions/12863944/how-do-you-specify-a-default-install-location-to-home-with-pkgbuild) to create per-user package.\n * Mostly never you will need to change this option. `/Applications` would install it as expected into `/Applications` if the local system domain is chosen, or into `$HOME/Applications` if the home installation is chosen.\n * @default /Applications\n */\n readonly installLocation?: string | null\n\n /**\n * Whether can be installed at the root of any volume, including non-system volumes. Otherwise, it cannot be installed at the root of a volume.\n *\n * Corresponds to [enable_anywhere](https://developer.apple.com/library/content/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html#//apple_ref/doc/uid/TP40005370-CH100-SW70).\n * @default true\n */\n readonly allowAnywhere?: boolean | null\n\n /**\n * Whether can be installed into the current user’s home directory.\n * A home directory installation is done as the current user (not as root), and it cannot write outside of the home directory.\n * If the product cannot be installed in the user’s home directory and be not completely functional from user’s home directory.\n *\n * Corresponds to [enable_currentUserHome](https://developer.apple.com/library/content/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html#//apple_ref/doc/uid/TP40005370-CH100-SW70).\n * @default true\n */\n readonly allowCurrentUserHome?: boolean | null\n\n /**\n * Whether can be installed into the root directory. Should usually be `true` unless the product can be installed only to the user’s home directory.\n *\n * Corresponds to [enable_localSystem](https://developer.apple.com/library/content/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html#//apple_ref/doc/uid/TP40005370-CH100-SW70).\n * @default true\n */\n readonly allowRootDirectory?: boolean | null\n\n /**\n * The name of certificate to use when signing. Consider using environment variables [CSC_LINK or CSC_NAME](/code-signing) instead of specifying this option.\n */\n readonly identity?: string | null\n\n /**\n * The path to EULA license file. Defaults to `license.txt` or `eula.txt` (or uppercase variants). In addition to `txt, `rtf` and `html` supported (don't forget to use `target=\"_blank\"` for links).\n */\n readonly license?: string | null\n\n /**\n * Options for the background image for the installer.\n */\n readonly background?: PkgBackgroundOptions | null\n\n /**\n * The path to the welcome file. This may be used to customize the text on the Introduction page of the installer.\n */\n readonly welcome?: string | null\n\n /**\n * Identifies applications that must be closed before the package is installed
|
|
1
|
+
{"version":3,"file":"pkgOptions.js","sourceRoot":"","sources":["../../src/options/pkgOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { TargetSpecificOptions } from \"../core\"\n\n// noinspection SpellCheckingInspection\nexport type BackgroundAlignment = \"center\" | \"left\" | \"right\" | \"top\" | \"bottom\" | \"topleft\" | \"topright\" | \"bottomleft\" | \"bottomright\"\n// noinspection SpellCheckingInspection\nexport type BackgroundScaling = \"tofit\" | \"none\" | \"proportional\"\n\n/**\n * macOS product archive options.\n */\nexport interface PkgOptions extends TargetSpecificOptions {\n /**\n * The scripts directory, relative to `build` (build resources directory).\n * The scripts can be in any language so long as the files are marked executable and have the appropriate shebang indicating the path to the interpreter.\n * Scripts are required to be executable (`chmod +x file`).\n * @default build/pkg-scripts\n * @see [Scripting in installer packages](http://macinstallers.blogspot.de/2012/07/scripting-in-installer-packages.html).\n */\n readonly scripts?: string | null\n\n /**\n * should be not documented, only to experiment\n * @private\n */\n readonly productbuild?: Array<string> | null\n\n /**\n * The install location. [Do not use it](https://stackoverflow.com/questions/12863944/how-do-you-specify-a-default-install-location-to-home-with-pkgbuild) to create per-user package.\n * Mostly never you will need to change this option. `/Applications` would install it as expected into `/Applications` if the local system domain is chosen, or into `$HOME/Applications` if the home installation is chosen.\n * @default /Applications\n */\n readonly installLocation?: string | null\n\n /**\n * Whether can be installed at the root of any volume, including non-system volumes. Otherwise, it cannot be installed at the root of a volume.\n *\n * Corresponds to [enable_anywhere](https://developer.apple.com/library/content/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html#//apple_ref/doc/uid/TP40005370-CH100-SW70).\n * @default true\n */\n readonly allowAnywhere?: boolean | null\n\n /**\n * Whether can be installed into the current user’s home directory.\n * A home directory installation is done as the current user (not as root), and it cannot write outside of the home directory.\n * If the product cannot be installed in the user’s home directory and be not completely functional from user’s home directory.\n *\n * Corresponds to [enable_currentUserHome](https://developer.apple.com/library/content/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html#//apple_ref/doc/uid/TP40005370-CH100-SW70).\n * @default true\n */\n readonly allowCurrentUserHome?: boolean | null\n\n /**\n * Whether can be installed into the root directory. Should usually be `true` unless the product can be installed only to the user’s home directory.\n *\n * Corresponds to [enable_localSystem](https://developer.apple.com/library/content/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html#//apple_ref/doc/uid/TP40005370-CH100-SW70).\n * @default true\n */\n readonly allowRootDirectory?: boolean | null\n\n /**\n * The name of certificate to use when signing. Consider using environment variables [CSC_LINK or CSC_NAME](/code-signing) instead of specifying this option.\n */\n readonly identity?: string | null\n\n /**\n * The path to EULA license file. Defaults to `license.txt` or `eula.txt` (or uppercase variants). In addition to `txt, `rtf` and `html` supported (don't forget to use `target=\"_blank\"` for links).\n */\n readonly license?: string | null\n\n /**\n * Options for the background image for the installer.\n */\n readonly background?: PkgBackgroundOptions | null\n\n /**\n * The path to the welcome file. This may be used to customize the text on the Introduction page of the installer.\n */\n readonly welcome?: string | null\n\n /**\n * Identifies applications that must be closed before the package is installed.\n *\n * Corresponds to [must-close](https://developer.apple.com/library/archive/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html#//apple_ref/doc/uid/TP40005370-CH100-SW77).\n */\n readonly mustClose?: Array<string> | null\n\n /**\n * The path to the conclusion file. This may be used to customize the text on the final \"Summary\" page of the installer.\n */\n readonly conclusion?: string | null\n\n /**\n * Install bundle over previous version if moved by user?\n * @default true\n */\n readonly isRelocatable?: boolean | null\n\n /**\n * Don't install bundle if newer version on disk?\n * @default true\n */\n readonly isVersionChecked?: boolean | null\n\n /**\n * Require identical bundle identifiers at install path?\n * @default true\n */\n readonly hasStrictIdentifier?: boolean | null\n\n /**\n * Specifies how an existing version of the bundle on disk should be handled when the version in\n * the package is installed.\n *\n * If you specify upgrade, the bundle in the package atomi-cally replaces any version on disk;\n * this has the effect of deleting old paths that no longer exist in the new version of\n * the bundle.\n *\n * If you specify update, the bundle in the package overwrites the version on disk, and any files\n * not contained in the package will be left intact; this is appropriate when you are delivering\n * an update-only package.\n *\n * Another effect of update is that the package bundle will not be installed at all if there is\n * not already a version on disk; this allows a package to deliver an update for an app that\n * the user might have deleted.\n *\n * @default upgrade\n */\n readonly overwriteAction?: \"upgrade\" | \"update\" | null\n}\n\n/**\n * Options for the background image in a PKG installer\n */\nexport interface PkgBackgroundOptions {\n /**\n * Path to the image to use as an installer background.\n */\n file?: string\n\n /**\n * Alignment of the background image.\n * Options are: center, left, right, top, bottom, topleft, topright, bottomleft, bottomright\n * @default center\n */\n alignment?: BackgroundAlignment | null\n\n /**\n * Scaling of the background image.\n * Options are: tofit, none, proportional\n * @default tofit\n */\n scaling?: BackgroundScaling | null\n}\n"]}
|
|
@@ -119,6 +119,7 @@ class NsisTarget extends core_1.Target {
|
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
async buildInstaller(archs) {
|
|
122
|
+
var _a;
|
|
122
123
|
const primaryArch = archs.size === 1 ? archs.keys().next().value : null;
|
|
123
124
|
const packager = this.packager;
|
|
124
125
|
const appInfo = packager.appInfo;
|
|
@@ -157,10 +158,10 @@ class NsisTarget extends core_1.Target {
|
|
|
157
158
|
VERSION: appInfo.version,
|
|
158
159
|
PROJECT_DIR: packager.projectDir,
|
|
159
160
|
BUILD_RESOURCES_DIR: packager.info.buildResourcesDir,
|
|
160
|
-
APP_PACKAGE_NAME: appInfo.name,
|
|
161
|
+
APP_PACKAGE_NAME: targetUtil_1.getWindowsInstallationAppPackageName(appInfo.name),
|
|
161
162
|
};
|
|
162
|
-
if (options.debugLogging) {
|
|
163
|
-
defines.
|
|
163
|
+
if ((_a = options.customNsisBinary) === null || _a === void 0 ? void 0 : _a.debugLogging) {
|
|
164
|
+
defines.ENABLE_LOGGING_ELECTRON_BUILDER = null;
|
|
164
165
|
}
|
|
165
166
|
if (uninstallAppKey !== guid) {
|
|
166
167
|
defines.UNINSTALL_REGISTRY_KEY_2 = `Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${guid}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NsisTarget.js","sourceRoot":"","sources":["../../../src/targets/nsis/NsisTarget.ts"],"names":[],"mappings":";;;AAAA,wCAAkC;AAClC,+CAA0C;AAC1C,+CAAoK;AACpK,+DAA4H;AAC5H,4CAA8D;AAC9D,iCAA0B;AAC1B,yBAAwB;AACxB,uCAAiD;AACjD,6BAA4B;AAC5B,mDAAiD;AACjD,qCAAmC;AACnC,2GAAsH;AACtH,6DAAsF;AACtF,0CAA0C;AAC1C,0DAAyD;AACzD,4CAAuC;AACvC,qCAAqC;AAErC,wCAAoD;AACpD,oFAAgK;AAChK,8CAA6D;AAC7D,yCAA+F;AAC/F,+CAAkD;AAElD,+DAA2D;AAC3D,yCAAgH;AAEhH,MAAM,KAAK,GAAG,eAAM,CAAC,uBAAuB,CAAC,CAAA;AAE7C,uCAAuC;AACvC,MAAM,wBAAwB,GAAG,2BAAI,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAA;AAEnF,uCAAuC;AACvC,MAAM,uBAAuB,GAAG,GA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;iBAAM;gBACL,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAA;aAClF;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,MAAM,MAAM,CAAC,KAAK,CAAC,CAAA;AACrB,CAAC;AAED,KAAK,UAAU,qBAAqB,CAAC,IAAY;IAC/C,OAAO;QACL,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,CAAC,MAAM,eAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI;QAC7B,MAAM,EAAE,MAAM,eAAQ,CAAC,IAAI,CAAC;KAC7B,CAAA;AACH,CAAC","sourcesContent":["import { path7za } from \"7zip-bin\"\nimport BluebirdPromise from \"bluebird-lst\"\nimport { Arch, asArray, AsyncTaskManager, exec, executeAppBuilder, getPlatformIconFileName, InvalidConfigurationError, log, spawnAndWrite, use } from \"builder-util\"\nimport { CURRENT_APP_INSTALLER_FILE_NAME, CURRENT_APP_PACKAGE_FILE_NAME, PackageFileInfo, UUID } from \"builder-util-runtime\"\nimport { exists, statOrNull, walk } from \"builder-util/out/fs\"\nimport _debug from \"debug\"\nimport * as fs from \"fs\"\nimport { readFile, stat, unlink } from \"fs-extra\"\nimport * as path from \"path\"\nimport { getBinFromUrl } from \"../../binDownload\"\nimport { Target } from \"../../core\"\nimport { DesktopShortcutCreationPolicy, getEffectiveOptions } from \"../../options/CommonWindowsInstallerConfiguration\"\nimport { computeSafeArtifactNameIfNeeded, normalizeExt } from \"../../platformPackager\"\nimport { hashFile } from \"../../util/hash\"\nimport { isMacOsCatalina } from \"../../util/macosVersion\"\nimport { time } from \"../../util/timer\"\nimport { execWine } from \"../../wine\"\nimport { WinPackager } from \"../../winPackager\"\nimport { archive, ArchiveOptions } from \"../archive\"\nimport { appendBlockmap, configureDifferentialAwareArchiveOptions, createBlockmap, createNsisWebDifferentialUpdateInfo } from \"../differentialUpdateInfoBuilder\"\nimport { getWindowsInstallationDirName } from \"../targetUtil\"\nimport { addCustomMessageFileInclude, createAddLangsMacro, LangConfigurator } from \"./nsisLang\"\nimport { computeLicensePage } from \"./nsisLicense\"\nimport { NsisOptions, PortableOptions } from \"./nsisOptions\"\nimport { NsisScriptGenerator } from \"./nsisScriptGenerator\"\nimport { AppPackageHelper, nsisTemplatesDir, NSIS_PATH, UninstallerReader, NsisTargetOptions } from \"./nsisUtil\"\n\nconst debug = _debug(\"electron-builder:nsis\")\n\n// noinspection SpellCheckingInspection\nconst ELECTRON_BUILDER_NS_UUID = UUID.parse(\"50e065bc-3134-11e6-9bab-38c9862bdaf3\")\n\n// noinspection SpellCheckingInspection\nconst nsisResourcePathPromise = () => getBinFromUrl(\"nsis-resources\", \"3.4.1\", \"Dqd6g+2buwwvoG1Vyf6BHR1b+25QMmPcwZx40atOT57gH27rkjOei1L0JTldxZu4NFoEmW4kJgZ3DlSWVON3+Q==\")\n\nconst USE_NSIS_BUILT_IN_COMPRESSOR = false\n\nexport class NsisTarget extends Target {\n readonly options: NsisOptions\n\n /** @private */\n readonly archs: Map<Arch, string> = new Map()\n\n constructor(readonly packager: WinPackager, readonly outDir: string, targetName: string, protected readonly packageHelper: AppPackageHelper) {\n super(targetName)\n\n this.packageHelper.refCount++\n\n this.options =\n targetName === \"portable\"\n ? Object.create(null)\n : {\n preCompressedFileExtensions: [\".avi\", \".mov\", \".m4v\", \".mp4\", \".m4p\", \".qt\", \".mkv\", \".webm\", \".vmdk\"],\n ...this.packager.config.nsis,\n }\n\n if (targetName !== \"nsis\") {\n Object.assign(this.options, (this.packager.config as any)[targetName === \"nsis-web\" ? \"nsisWeb\" : targetName])\n }\n\n const deps = packager.info.metadata.dependencies\n if (deps != null && deps[\"electron-squirrel-startup\"] != null) {\n log.warn('\"electron-squirrel-startup\" dependency is not required for NSIS')\n }\n\n NsisTargetOptions.resolve(this.options)\n }\n\n build(appOutDir: string, arch: Arch) {\n this.archs.set(arch, appOutDir)\n return Promise.resolve()\n }\n\n get isBuildDifferentialAware() {\n return !this.isPortable && this.options.differentialPackage !== false\n }\n\n private getPreCompressedFileExtensions(): Array<string> | null {\n const result = this.isWebInstaller ? null : this.options.preCompressedFileExtensions\n return result == null ? null : asArray(result).map(it => (it.startsWith(\".\") ? it : `.${it}`))\n }\n\n /** @private */\n async buildAppPackage(appOutDir: string, arch: Arch): Promise<PackageFileInfo> {\n const options = this.options\n const packager = this.packager\n\n const isBuildDifferentialAware = this.isBuildDifferentialAware\n const format = !isBuildDifferentialAware && options.useZip ? \"zip\" : \"7z\"\n const archiveFile = path.join(this.outDir, `${packager.appInfo.sanitizedName}-${packager.appInfo.version}-${Arch[arch]}.nsis.${format}`)\n const preCompressedFileExtensions = this.getPreCompressedFileExtensions()\n const archiveOptions: ArchiveOptions = {\n withoutDir: true,\n compression: packager.compression,\n excluded: preCompressedFileExtensions == null ? null : preCompressedFileExtensions.map(it => `*${it}`),\n }\n\n const timer = time(`nsis package, ${Arch[arch]}`)\n await archive(format, archiveFile, appOutDir, isBuildDifferentialAware ? configureDifferentialAwareArchiveOptions(archiveOptions) : archiveOptions)\n timer.end()\n\n if (isBuildDifferentialAware && this.isWebInstaller) {\n const data = await appendBlockmap(archiveFile)\n return {\n ...data,\n path: archiveFile,\n }\n } else {\n return await createPackageFileInfo(archiveFile)\n }\n }\n\n protected get installerFilenamePattern(): string {\n // tslint:disable:no-invalid-template-strings\n return \"${productName} \" + (this.isPortable ? \"\" : \"Setup \") + \"${version}.${ext}\"\n }\n\n private get isPortable() {\n return this.name === \"portable\"\n }\n\n async finishBuild(): Promise<any> {\n try {\n const { pattern } = this.packager.artifactPatternConfig(this.options, this.installerFilenamePattern)\n const builds = new Set([this.archs])\n if (pattern.includes(\"${arch}\") && this.archs.size > 1) {\n ;[...this.archs].forEach(([arch, appOutDir]) => builds.add(new Map().set(arch, appOutDir)))\n }\n const doBuildArchs = builds.values()\n for (const archs of doBuildArchs) {\n await this.buildInstaller(archs)\n }\n } finally {\n await this.packageHelper.finishBuild()\n }\n }\n\n private async buildInstaller(archs: Map<Arch, string>): Promise<any> {\n const primaryArch = archs.size === 1 ? archs.keys().next().value : null\n const packager = this.packager\n const appInfo = packager.appInfo\n const options = this.options\n const installerFilename = packager.expandArtifactNamePattern(\n options,\n \"exe\",\n primaryArch,\n this.installerFilenamePattern,\n false,\n this.packager.platformSpecificBuildOptions.defaultArch\n )\n const oneClick = options.oneClick !== false\n const installerPath = path.join(this.outDir, installerFilename)\n\n const logFields: any = {\n target: this.name,\n file: log.filePath(installerPath),\n archs: Array.from(archs.keys())\n .map(it => Arch[it])\n .join(\", \"),\n }\n const isPerMachine = options.perMachine === true\n if (!this.isPortable) {\n logFields.oneClick = oneClick\n logFields.perMachine = isPerMachine\n }\n\n await packager.info.callArtifactBuildStarted(\n {\n targetPresentableName: this.name,\n file: installerPath,\n arch: primaryArch,\n },\n logFields\n )\n\n const guid = options.guid || UUID.v5(appInfo.id, ELECTRON_BUILDER_NS_UUID)\n const uninstallAppKey = guid.replace(/\\\\/g, \" - \")\n const defines: any = {\n APP_ID: appInfo.id,\n APP_GUID: guid,\n // Windows bug - entry in Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall cannot have \\ symbols (dir)\n UNINSTALL_APP_KEY: uninstallAppKey,\n PRODUCT_NAME: appInfo.productName,\n PRODUCT_FILENAME: appInfo.productFilename,\n APP_FILENAME: getWindowsInstallationDirName(appInfo, !oneClick || isPerMachine),\n APP_DESCRIPTION: appInfo.description,\n VERSION: appInfo.version,\n\n PROJECT_DIR: packager.projectDir,\n BUILD_RESOURCES_DIR: packager.info.buildResourcesDir,\n\n APP_PACKAGE_NAME: appInfo.name,\n }\n if (options.debugLogging) {\n defines.ENABLE_LOGGING = null\n }\n if (uninstallAppKey !== guid) {\n defines.UNINSTALL_REGISTRY_KEY_2 = `Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Uninstall\\\\${guid}`\n }\n\n const commands: any = {\n OutFile: `\"${installerPath}\"`,\n VIProductVersion: appInfo.getVersionInWeirdWindowsForm(),\n VIAddVersionKey: this.computeVersionKey(),\n Unicode: this.isUnicodeEnabled,\n }\n\n const isPortable = this.isPortable\n const iconPath = (isPortable ? null : await packager.getResource(options.installerIcon, \"installerIcon.ico\")) || (await packager.getIconPath())\n if (iconPath != null) {\n if (isPortable) {\n commands.Icon = `\"${iconPath}\"`\n } else {\n defines.MUI_ICON = iconPath\n defines.MUI_UNICON = iconPath\n }\n }\n\n const packageFiles: { [arch: string]: PackageFileInfo } = {}\n let estimatedSize = 0\n if (this.isPortable && options.useZip) {\n for (const [arch, dir] of archs.entries()) {\n defines[arch === Arch.x64 ? \"APP_DIR_64\" : arch === Arch.arm64 ? \"APP_DIR_ARM64\" : \"APP_DIR_32\"] = dir\n }\n } else if (USE_NSIS_BUILT_IN_COMPRESSOR && archs.size === 1) {\n defines.APP_BUILD_DIR = archs.get(archs.keys().next().value)\n } else {\n await BluebirdPromise.map(archs.keys(), async arch => {\n const fileInfo = await this.packageHelper.packArch(arch, this)\n const file = fileInfo.path\n const defineKey = arch === Arch.x64 ? \"APP_64\" : arch === Arch.arm64 ? \"APP_ARM64\" : \"APP_32\"\n defines[defineKey] = file\n defines[`${defineKey}_NAME`] = path.basename(file)\n // nsis expect a hexadecimal string\n defines[`${defineKey}_HASH`] = Buffer.from(fileInfo.sha512, \"base64\").toString(\"hex\").toUpperCase()\n\n if (this.isWebInstaller) {\n await packager.dispatchArtifactCreated(file, this, arch)\n packageFiles[Arch[arch]] = fileInfo\n }\n\n const archiveInfo = (await exec(path7za, [\"l\", file])).trim()\n // after adding blockmap data will be \"Warnings: 1\" in the end of output\n const match = /(\\d+)\\s+\\d+\\s+\\d+\\s+files/.exec(archiveInfo)\n if (match == null) {\n log.warn({ output: archiveInfo }, \"cannot compute size of app package\")\n } else {\n estimatedSize += parseInt(match[1], 10)\n }\n })\n }\n\n this.configureDefinesForAllTypeOfInstaller(defines)\n if (isPortable) {\n const { unpackDirName, requestExecutionLevel, splashImage } = options as PortableOptions\n defines.REQUEST_EXECUTION_LEVEL = requestExecutionLevel || \"user\"\n\n // https://github.com/electron-userland/electron-builder/issues/5764\n if (typeof unpackDirName === \"string\" || !unpackDirName) {\n defines.UNPACK_DIR_NAME = unpackDirName || (await executeAppBuilder([\"ksuid\"]))\n }\n\n if (splashImage != null) {\n defines.SPLASH_IMAGE = path.resolve(packager.projectDir, splashImage)\n }\n } else {\n await this.configureDefines(oneClick, defines)\n }\n\n if (estimatedSize !== 0) {\n // in kb\n defines.ESTIMATED_SIZE = Math.round(estimatedSize / 1024)\n }\n\n if (packager.compression === \"store\") {\n commands.SetCompress = \"off\"\n } else {\n // difference - 33.540 vs 33.601, only 61 KB (but zip is faster to decompress)\n // do not use /SOLID - \"With solid compression, files are uncompressed to temporary file before they are copied to their final destination\",\n // it is not good for portable installer (where built-in NSIS compression is used). http://forums.winamp.com/showpost.php?p=2982902&postcount=6\n commands.SetCompressor = \"zlib\"\n if (!this.isWebInstaller) {\n defines.COMPRESS = \"auto\"\n }\n }\n\n debug(defines)\n debug(commands)\n\n if (packager.packagerOptions.effectiveOptionComputed != null && (await packager.packagerOptions.effectiveOptionComputed([defines, commands]))) {\n return\n }\n\n // prepare short-version variants of defines and commands, to make an uninstaller that doesn't differ much from the previous one\n const definesUninstaller: any = { ...defines }\n const commandsUninstaller: any = { ...commands }\n if (appInfo.shortVersion != null) {\n definesUninstaller.VERSION = appInfo.shortVersion\n commandsUninstaller.VIProductVersion = appInfo.shortVersionWindows\n commandsUninstaller.VIAddVersionKey = this.computeVersionKey(true)\n }\n\n const sharedHeader = await this.computeCommonInstallerScriptHeader()\n const script = isPortable\n ? await readFile(path.join(nsisTemplatesDir, \"portable.nsi\"), \"utf8\")\n : await this.computeScriptAndSignUninstaller(definesUninstaller, commandsUninstaller, installerPath, sharedHeader, archs)\n\n // copy outfile name into main options, as the computeScriptAndSignUninstaller function was kind enough to add important data to temporary defines.\n defines.UNINSTALLER_OUT_FILE = definesUninstaller.UNINSTALLER_OUT_FILE\n\n await this.executeMakensis(defines, commands, sharedHeader + (await this.computeFinalScript(script, true, archs)))\n await Promise.all<any>([packager.sign(installerPath), defines.UNINSTALLER_OUT_FILE == null ? Promise.resolve() : unlink(defines.UNINSTALLER_OUT_FILE)])\n\n const safeArtifactName = computeSafeArtifactNameIfNeeded(installerFilename, () => this.generateGitHubInstallerName())\n let updateInfo: any\n if (this.isWebInstaller) {\n updateInfo = createNsisWebDifferentialUpdateInfo(installerPath, packageFiles)\n } else if (this.isBuildDifferentialAware) {\n updateInfo = await createBlockmap(installerPath, this, packager, safeArtifactName)\n }\n\n if (updateInfo != null && isPerMachine && oneClick) {\n updateInfo.isAdminRightsRequired = true\n }\n\n await packager.info.callArtifactBuildCompleted({\n file: installerPath,\n updateInfo,\n target: this,\n packager,\n arch: primaryArch,\n safeArtifactName,\n isWriteUpdateInfo: !this.isPortable,\n })\n }\n\n protected generateGitHubInstallerName() {\n const appInfo = this.packager.appInfo\n const classifier = appInfo.name.toLowerCase() === appInfo.name ? \"setup-\" : \"Setup-\"\n return `${appInfo.name}-${this.isPortable ? \"\" : classifier}${appInfo.version}.exe`\n }\n\n private get isUnicodeEnabled() {\n return this.options.unicode !== false\n }\n\n get isWebInstaller(): boolean {\n return false\n }\n\n private async computeScriptAndSignUninstaller(defines: any, commands: any, installerPath: string, sharedHeader: string, archs: Map<Arch, string>) {\n const packager = this.packager\n const customScriptPath = await packager.getResource(this.options.script, \"installer.nsi\")\n const script = await readFile(customScriptPath || path.join(nsisTemplatesDir, \"installer.nsi\"), \"utf8\")\n\n if (customScriptPath != null) {\n log.info({ reason: \"custom NSIS script is used\" }, \"uninstaller is not signed by electron-builder\")\n return script\n }\n\n // https://github.com/electron-userland/electron-builder/issues/2103\n // it is more safe and reliable to write uninstaller to our out dir\n const uninstallerPath = path.join(this.outDir, `__uninstaller-${this.name}-${this.packager.appInfo.sanitizedName}.exe`)\n const isWin = process.platform === \"win32\"\n defines.BUILD_UNINSTALLER = null\n defines.UNINSTALLER_OUT_FILE = isWin ? uninstallerPath : path.win32.join(\"Z:\", uninstallerPath)\n await this.executeMakensis(defines, commands, sharedHeader + (await this.computeFinalScript(script, false, archs)))\n\n // http://forums.winamp.com/showthread.php?p=3078545\n if (isMacOsCatalina()) {\n try {\n await UninstallerReader.exec(installerPath, uninstallerPath)\n } catch (error) {\n log.warn(`packager.vm is used: ${error.message}`)\n\n const vm = await packager.vm.value\n await vm.exec(installerPath, [])\n // Parallels VM can exit after command execution, but NSIS continue to be running\n let i = 0\n while (!(await exists(uninstallerPath)) && i++ < 100) {\n // noinspection JSUnusedLocalSymbols\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n await new Promise((resolve, _reject) => setTimeout(resolve, 300))\n }\n }\n } else {\n await execWine(installerPath, null, [], { env: { __COMPAT_LAYER: \"RunAsInvoker\" } })\n }\n await packager.sign(uninstallerPath, \" Signing NSIS uninstaller\")\n\n delete defines.BUILD_UNINSTALLER\n // platform-specific path, not wine\n defines.UNINSTALLER_OUT_FILE = uninstallerPath\n return script\n }\n\n private computeVersionKey(short = false) {\n // Error: invalid VIProductVersion format, should be X.X.X.X\n // so, we must strip beta\n const localeId = this.options.language || \"1033\"\n const appInfo = this.packager.appInfo\n const versionKey = [\n `/LANG=${localeId} ProductName \"${appInfo.productName}\"`,\n `/LANG=${localeId} ProductVersion \"${appInfo.version}\"`,\n `/LANG=${localeId} LegalCopyright \"${appInfo.copyright}\"`,\n `/LANG=${localeId} FileDescription \"${appInfo.description}\"`,\n `/LANG=${localeId} FileVersion \"${appInfo.buildVersion}\"`,\n ]\n if (short) {\n versionKey[1] = `/LANG=${localeId} ProductVersion \"${appInfo.shortVersion}\"`\n versionKey[4] = `/LANG=${localeId} FileVersion \"${appInfo.shortVersion}\"`\n }\n use(this.packager.platformSpecificBuildOptions.legalTrademarks, it => versionKey.push(`/LANG=${localeId} LegalTrademarks \"${it}\"`))\n use(appInfo.companyName, it => versionKey.push(`/LANG=${localeId} CompanyName \"${it}\"`))\n return versionKey\n }\n\n protected configureDefines(oneClick: boolean, defines: any): Promise<any> {\n const packager = this.packager\n const options = this.options\n\n const asyncTaskManager = new AsyncTaskManager(packager.info.cancellationToken)\n\n if (oneClick) {\n defines.ONE_CLICK = null\n\n if (options.runAfterFinish !== false) {\n defines.RUN_AFTER_FINISH = null\n }\n\n asyncTaskManager.add(async () => {\n const installerHeaderIcon = await packager.getResource(options.installerHeaderIcon, \"installerHeaderIcon.ico\")\n if (installerHeaderIcon != null) {\n defines.HEADER_ICO = installerHeaderIcon\n }\n })\n } else {\n if (options.runAfterFinish === false) {\n defines.HIDE_RUN_AFTER_FINISH = null\n }\n\n asyncTaskManager.add(async () => {\n const installerHeader = await packager.getResource(options.installerHeader, \"installerHeader.bmp\")\n if (installerHeader != null) {\n defines.MUI_HEADERIMAGE = null\n defines.MUI_HEADERIMAGE_RIGHT = null\n defines.MUI_HEADERIMAGE_BITMAP = installerHeader\n }\n })\n\n asyncTaskManager.add(async () => {\n const bitmap = (await packager.getResource(options.installerSidebar, \"installerSidebar.bmp\")) || \"${NSISDIR}\\\\Contrib\\\\Graphics\\\\Wizard\\\\nsis3-metro.bmp\"\n defines.MUI_WELCOMEFINISHPAGE_BITMAP = bitmap\n defines.MUI_UNWELCOMEFINISHPAGE_BITMAP = (await packager.getResource(options.uninstallerSidebar, \"uninstallerSidebar.bmp\")) || bitmap\n })\n\n if (options.allowElevation !== false) {\n defines.MULTIUSER_INSTALLMODE_ALLOW_ELEVATION = null\n }\n }\n\n if (options.perMachine === true) {\n defines.INSTALL_MODE_PER_ALL_USERS = null\n }\n\n if (!oneClick || options.perMachine === true) {\n defines.INSTALL_MODE_PER_ALL_USERS_REQUIRED = null\n }\n\n if (options.allowToChangeInstallationDirectory) {\n if (oneClick) {\n throw new InvalidConfigurationError(\"allowToChangeInstallationDirectory makes sense only for assisted installer (please set oneClick to false)\")\n }\n defines.allowToChangeInstallationDirectory = null\n }\n\n const commonOptions = getEffectiveOptions(options, packager)\n\n if (commonOptions.menuCategory != null) {\n defines.MENU_FILENAME = commonOptions.menuCategory\n }\n\n defines.SHORTCUT_NAME = commonOptions.shortcutName\n\n if (options.deleteAppDataOnUninstall) {\n defines.DELETE_APP_DATA_ON_UNINSTALL = null\n }\n\n asyncTaskManager.add(async () => {\n const uninstallerIcon = await packager.getResource(options.uninstallerIcon, \"uninstallerIcon.ico\")\n if (uninstallerIcon != null) {\n // we don't need to copy MUI_UNICON (defaults to app icon), so, we have 2 defines\n defines.UNINSTALLER_ICON = uninstallerIcon\n defines.MUI_UNICON = uninstallerIcon\n }\n })\n\n defines.UNINSTALL_DISPLAY_NAME = packager.expandMacro(options.uninstallDisplayName || \"${productName} ${version}\", null, {}, false)\n if (commonOptions.isCreateDesktopShortcut === DesktopShortcutCreationPolicy.NEVER) {\n defines.DO_NOT_CREATE_DESKTOP_SHORTCUT = null\n }\n if (commonOptions.isCreateDesktopShortcut === DesktopShortcutCreationPolicy.ALWAYS) {\n defines.RECREATE_DESKTOP_SHORTCUT = null\n }\n if (!commonOptions.isCreateStartMenuShortcut) {\n defines.DO_NOT_CREATE_START_MENU_SHORTCUT = null\n }\n\n if (options.displayLanguageSelector === true) {\n defines.DISPLAY_LANG_SELECTOR = null\n }\n\n return asyncTaskManager.awaitTasks()\n }\n\n private configureDefinesForAllTypeOfInstaller(defines: any) {\n const appInfo = this.packager.appInfo\n const companyName = appInfo.companyName\n if (companyName != null) {\n defines.COMPANY_NAME = companyName\n }\n\n // electron uses product file name as app data, define it as well to remove on uninstall\n if (defines.APP_FILENAME !== appInfo.productFilename) {\n defines.APP_PRODUCT_FILENAME = appInfo.productFilename\n }\n\n if (this.isWebInstaller) {\n defines.APP_PACKAGE_STORE_FILE = `${appInfo.updaterCacheDirName}\\\\${CURRENT_APP_PACKAGE_FILE_NAME}`\n } else {\n defines.APP_INSTALLER_STORE_FILE = `${appInfo.updaterCacheDirName}\\\\${CURRENT_APP_INSTALLER_FILE_NAME}`\n }\n\n if (!this.isWebInstaller && defines.APP_BUILD_DIR == null) {\n const options = this.options\n if (options.useZip) {\n defines.ZIP_COMPRESSION = null\n }\n\n defines.COMPRESSION_METHOD = options.useZip ? \"zip\" : \"7z\"\n }\n }\n\n private async executeMakensis(defines: any, commands: any, script: string) {\n const args: Array<string> = this.options.warningsAsErrors === false ? [] : [\"-WX\"]\n args.push(\"-INPUTCHARSET\", \"UTF8\")\n for (const name of Object.keys(defines)) {\n const value = defines[name]\n if (value == null) {\n args.push(`-D${name}`)\n } else {\n args.push(`-D${name}=${value}`)\n }\n }\n\n for (const name of Object.keys(commands)) {\n const value = commands[name]\n if (Array.isArray(value)) {\n for (const c of value) {\n args.push(`-X${name} ${c}`)\n }\n } else {\n args.push(`-X${name} ${value}`)\n }\n }\n\n args.push(\"-\")\n\n if (this.packager.debugLogger.isEnabled) {\n this.packager.debugLogger.add(\"nsis.script\", script)\n }\n\n const nsisPath = await NSIS_PATH()\n const command = path.join(\n nsisPath,\n process.platform === \"darwin\" ? \"mac\" : process.platform === \"win32\" ? \"Bin\" : \"linux\",\n process.platform === \"win32\" ? \"makensis.exe\" : \"makensis\"\n )\n\n // if (process.platform === \"win32\") {\n // fix for an issue caused by virus scanners, locking the file during write\n // https://github.com/electron-userland/electron-builder/issues/5005\n await ensureNotBusy(commands[\"OutFile\"].replace(/\"/g, \"\"))\n // }\n\n await spawnAndWrite(command, args, script, {\n // we use NSIS_CONFIG_CONST_DATA_PATH=no to build makensis on Linux, but in any case it doesn't use stubs as MacOS/Windows version, so, we explicitly set NSISDIR\n env: { ...process.env, NSISDIR: nsisPath },\n cwd: nsisTemplatesDir,\n })\n }\n\n private async computeCommonInstallerScriptHeader() {\n const packager = this.packager\n const options = this.options\n const scriptGenerator = new NsisScriptGenerator()\n const langConfigurator = new LangConfigurator(options)\n\n scriptGenerator.include(path.join(nsisTemplatesDir, \"include\", \"StdUtils.nsh\"))\n\n const includeDir = path.join(nsisTemplatesDir, \"include\")\n scriptGenerator.addIncludeDir(includeDir)\n scriptGenerator.flags([\"updated\", \"force-run\", \"keep-shortcuts\", \"no-desktop-shortcut\", \"delete-app-data\", \"allusers\", \"currentuser\"])\n\n createAddLangsMacro(scriptGenerator, langConfigurator)\n\n const taskManager = new AsyncTaskManager(packager.info.cancellationToken)\n\n const pluginArch = this.isUnicodeEnabled ? \"x86-unicode\" : \"x86-ansi\"\n taskManager.add(async () => {\n scriptGenerator.addPluginDir(pluginArch, path.join(await nsisResourcePathPromise(), \"plugins\", pluginArch))\n })\n\n taskManager.add(async () => {\n const userPluginDir = path.join(packager.info.buildResourcesDir, pluginArch)\n const stat = await statOrNull(userPluginDir)\n if (stat != null && stat.isDirectory()) {\n scriptGenerator.addPluginDir(pluginArch, userPluginDir)\n }\n })\n\n taskManager.addTask(addCustomMessageFileInclude(\"messages.yml\", packager, scriptGenerator, langConfigurator))\n\n if (!this.isPortable) {\n if (options.oneClick === false) {\n taskManager.addTask(addCustomMessageFileInclude(\"assistedMessages.yml\", packager, scriptGenerator, langConfigurator))\n }\n\n taskManager.add(async () => {\n const customInclude = await packager.getResource(this.options.include, \"installer.nsh\")\n if (customInclude != null) {\n scriptGenerator.addIncludeDir(packager.info.buildResourcesDir)\n scriptGenerator.include(customInclude)\n }\n })\n }\n\n await taskManager.awaitTasks()\n return scriptGenerator.build()\n }\n\n private async computeFinalScript(originalScript: string, isInstaller: boolean, archs: Map<Arch, string>) {\n const packager = this.packager\n const options = this.options\n const langConfigurator = new LangConfigurator(options)\n\n const scriptGenerator = new NsisScriptGenerator()\n const taskManager = new AsyncTaskManager(packager.info.cancellationToken)\n\n if (isInstaller) {\n // http://stackoverflow.com/questions/997456/nsis-license-file-based-on-language-selection\n taskManager.add(() => computeLicensePage(packager, options, scriptGenerator, langConfigurator.langs))\n }\n\n await taskManager.awaitTasks()\n\n if (this.isPortable) {\n return scriptGenerator.build() + originalScript\n }\n\n const preCompressedFileExtensions = this.getPreCompressedFileExtensions()\n if (preCompressedFileExtensions != null && preCompressedFileExtensions.length !== 0) {\n for (const [arch, dir] of archs.entries()) {\n await generateForPreCompressed(preCompressedFileExtensions, dir, arch, scriptGenerator)\n }\n }\n\n const fileAssociations = packager.fileAssociations\n if (fileAssociations.length !== 0) {\n scriptGenerator.include(path.join(path.join(nsisTemplatesDir, \"include\"), \"FileAssociation.nsh\"))\n if (isInstaller) {\n const registerFileAssociationsScript = new NsisScriptGenerator()\n for (const item of fileAssociations) {\n const extensions = asArray(item.ext).map(normalizeExt)\n for (const ext of extensions) {\n const customIcon = await packager.getResource(getPlatformIconFileName(item.icon, false), `${extensions[0]}.ico`)\n let installedIconPath = \"$appExe,0\"\n if (customIcon != null) {\n installedIconPath = `$INSTDIR\\\\resources\\\\${path.basename(customIcon)}`\n registerFileAssociationsScript.file(installedIconPath, customIcon)\n }\n\n const icon = `\"${installedIconPath}\"`\n const commandText = `\"Open with ${packager.appInfo.productName}\"`\n const command = '\"$appExe $\\\\\"%1$\\\\\"\"'\n registerFileAssociationsScript.insertMacro(\"APP_ASSOCIATE\", `\"${ext}\" \"${item.name || ext}\" \"${item.description || \"\"}\" ${icon} ${commandText} ${command}`)\n }\n }\n scriptGenerator.macro(\"registerFileAssociations\", registerFileAssociationsScript)\n } else {\n const unregisterFileAssociationsScript = new NsisScriptGenerator()\n for (const item of fileAssociations) {\n for (const ext of asArray(item.ext)) {\n unregisterFileAssociationsScript.insertMacro(\"APP_UNASSOCIATE\", `\"${normalizeExt(ext)}\" \"${item.name || ext}\"`)\n }\n }\n scriptGenerator.macro(\"unregisterFileAssociations\", unregisterFileAssociationsScript)\n }\n }\n\n return scriptGenerator.build() + originalScript\n }\n}\n\nasync function generateForPreCompressed(preCompressedFileExtensions: Array<string>, dir: string, arch: Arch, scriptGenerator: NsisScriptGenerator) {\n const resourcesDir = path.join(dir, \"resources\")\n const dirInfo = await statOrNull(resourcesDir)\n if (dirInfo == null || !dirInfo.isDirectory()) {\n return\n }\n\n const nodeModules = `${path.sep}node_modules`\n const preCompressedAssets = await walk(resourcesDir, (file, stat) => {\n if (stat.isDirectory()) {\n return !file.endsWith(nodeModules)\n } else {\n return preCompressedFileExtensions.some(it => file.endsWith(it))\n }\n })\n\n if (preCompressedAssets.length !== 0) {\n const macro = new NsisScriptGenerator()\n for (const file of preCompressedAssets) {\n macro.file(`$INSTDIR\\\\${path.relative(dir, file).replace(/\\//g, \"\\\\\")}`, file)\n }\n scriptGenerator.macro(`customFiles_${Arch[arch]}`, macro)\n }\n}\n\nasync function ensureNotBusy(outFile: string) {\n function isBusy(wasBusyBefore: boolean): Promise<boolean> {\n return new Promise((resolve, reject) => {\n fs.open(outFile, \"r+\", (error, fd) => {\n try {\n if (error != null && error.code === \"EBUSY\") {\n if (!wasBusyBefore) {\n log.info({}, \"output file is locked for writing (maybe by virus scanner) => waiting for unlock...\")\n }\n resolve(false)\n } else if (fd == null) {\n resolve(true)\n } else {\n fs.close(fd, () => resolve(true))\n }\n } catch (error) {\n reject(error)\n }\n })\n }).then(result => {\n if (result) {\n return true\n } else {\n return new Promise(resolve => setTimeout(resolve, 2000)).then(() => isBusy(true))\n }\n })\n }\n\n await isBusy(false)\n}\n\nasync function createPackageFileInfo(file: string): Promise<PackageFileInfo> {\n return {\n path: file,\n size: (await stat(file)).size,\n sha512: await hashFile(file),\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"NsisTarget.js","sourceRoot":"","sources":["../../../src/targets/nsis/NsisTarget.ts"],"names":[],"mappings":";;;AAAA,wCAAkC;AAClC,+CAA0C;AAC1C,+CAAoK;AACpK,+DAA4H;AAC5H,4CAA8D;AAC9D,iCAA0B;AAC1B,yBAAwB;AACxB,uCAAiD;AACjD,6BAA4B;AAC5B,mDAAiD;AACjD,qCAAmC;AACnC,2GAAsH;AACtH,6DAAsF;AACtF,0CAA0C;AAC1C,0DAAyD;AACzD,4CAAuC;AACvC,qCAAqC;AAErC,wCAAoD;AACpD,oFAAgK;AAChK,8CAAmG;AACnG,yCAA+F;AAC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AC,EAAE,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAA;qBAClC;iBACF;gBAAC,OAAO,KAAK,EAAE;oBACd,MAAM,CAAC,KAAK,CAAC,CAAA;iBACd;YACH,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;YACf,IAAI,MAAM,EAAE;gBACV,OAAO,IAAI,CAAA;aACZ;iBAAM;gBACL,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAA;aAClF;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,MAAM,MAAM,CAAC,KAAK,CAAC,CAAA;AACrB,CAAC;AAED,KAAK,UAAU,qBAAqB,CAAC,IAAY;IAC/C,OAAO;QACL,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,CAAC,MAAM,eAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI;QAC7B,MAAM,EAAE,MAAM,eAAQ,CAAC,IAAI,CAAC;KAC7B,CAAA;AACH,CAAC","sourcesContent":["import { path7za } from \"7zip-bin\"\nimport BluebirdPromise from \"bluebird-lst\"\nimport { Arch, asArray, AsyncTaskManager, exec, executeAppBuilder, getPlatformIconFileName, InvalidConfigurationError, log, spawnAndWrite, use } from \"builder-util\"\nimport { CURRENT_APP_INSTALLER_FILE_NAME, CURRENT_APP_PACKAGE_FILE_NAME, PackageFileInfo, UUID } from \"builder-util-runtime\"\nimport { exists, statOrNull, walk } from \"builder-util/out/fs\"\nimport _debug from \"debug\"\nimport * as fs from \"fs\"\nimport { readFile, stat, unlink } from \"fs-extra\"\nimport * as path from \"path\"\nimport { getBinFromUrl } from \"../../binDownload\"\nimport { Target } from \"../../core\"\nimport { DesktopShortcutCreationPolicy, getEffectiveOptions } from \"../../options/CommonWindowsInstallerConfiguration\"\nimport { computeSafeArtifactNameIfNeeded, normalizeExt } from \"../../platformPackager\"\nimport { hashFile } from \"../../util/hash\"\nimport { isMacOsCatalina } from \"../../util/macosVersion\"\nimport { time } from \"../../util/timer\"\nimport { execWine } from \"../../wine\"\nimport { WinPackager } from \"../../winPackager\"\nimport { archive, ArchiveOptions } from \"../archive\"\nimport { appendBlockmap, configureDifferentialAwareArchiveOptions, createBlockmap, createNsisWebDifferentialUpdateInfo } from \"../differentialUpdateInfoBuilder\"\nimport { getWindowsInstallationAppPackageName, getWindowsInstallationDirName } from \"../targetUtil\"\nimport { addCustomMessageFileInclude, createAddLangsMacro, LangConfigurator } from \"./nsisLang\"\nimport { computeLicensePage } from \"./nsisLicense\"\nimport { NsisOptions, PortableOptions } from \"./nsisOptions\"\nimport { NsisScriptGenerator } from \"./nsisScriptGenerator\"\nimport { AppPackageHelper, nsisTemplatesDir, NSIS_PATH, UninstallerReader, NsisTargetOptions } from \"./nsisUtil\"\n\nconst debug = _debug(\"electron-builder:nsis\")\n\n// noinspection SpellCheckingInspection\nconst ELECTRON_BUILDER_NS_UUID = UUID.parse(\"50e065bc-3134-11e6-9bab-38c9862bdaf3\")\n\n// noinspection SpellCheckingInspection\nconst nsisResourcePathPromise = () => getBinFromUrl(\"nsis-resources\", \"3.4.1\", \"Dqd6g+2buwwvoG1Vyf6BHR1b+25QMmPcwZx40atOT57gH27rkjOei1L0JTldxZu4NFoEmW4kJgZ3DlSWVON3+Q==\")\n\nconst USE_NSIS_BUILT_IN_COMPRESSOR = false\n\nexport class NsisTarget extends Target {\n readonly options: NsisOptions\n\n /** @private */\n readonly archs: Map<Arch, string> = new Map()\n\n constructor(readonly packager: WinPackager, readonly outDir: string, targetName: string, protected readonly packageHelper: AppPackageHelper) {\n super(targetName)\n\n this.packageHelper.refCount++\n\n this.options =\n targetName === \"portable\"\n ? Object.create(null)\n : {\n preCompressedFileExtensions: [\".avi\", \".mov\", \".m4v\", \".mp4\", \".m4p\", \".qt\", \".mkv\", \".webm\", \".vmdk\"],\n ...this.packager.config.nsis,\n }\n\n if (targetName !== \"nsis\") {\n Object.assign(this.options, (this.packager.config as any)[targetName === \"nsis-web\" ? \"nsisWeb\" : targetName])\n }\n\n const deps = packager.info.metadata.dependencies\n if (deps != null && deps[\"electron-squirrel-startup\"] != null) {\n log.warn('\"electron-squirrel-startup\" dependency is not required for NSIS')\n }\n\n NsisTargetOptions.resolve(this.options)\n }\n\n build(appOutDir: string, arch: Arch) {\n this.archs.set(arch, appOutDir)\n return Promise.resolve()\n }\n\n get isBuildDifferentialAware() {\n return !this.isPortable && this.options.differentialPackage !== false\n }\n\n private getPreCompressedFileExtensions(): Array<string> | null {\n const result = this.isWebInstaller ? null : this.options.preCompressedFileExtensions\n return result == null ? null : asArray(result).map(it => (it.startsWith(\".\") ? it : `.${it}`))\n }\n\n /** @private */\n async buildAppPackage(appOutDir: string, arch: Arch): Promise<PackageFileInfo> {\n const options = this.options\n const packager = this.packager\n\n const isBuildDifferentialAware = this.isBuildDifferentialAware\n const format = !isBuildDifferentialAware && options.useZip ? \"zip\" : \"7z\"\n const archiveFile = path.join(this.outDir, `${packager.appInfo.sanitizedName}-${packager.appInfo.version}-${Arch[arch]}.nsis.${format}`)\n const preCompressedFileExtensions = this.getPreCompressedFileExtensions()\n const archiveOptions: ArchiveOptions = {\n withoutDir: true,\n compression: packager.compression,\n excluded: preCompressedFileExtensions == null ? null : preCompressedFileExtensions.map(it => `*${it}`),\n }\n\n const timer = time(`nsis package, ${Arch[arch]}`)\n await archive(format, archiveFile, appOutDir, isBuildDifferentialAware ? configureDifferentialAwareArchiveOptions(archiveOptions) : archiveOptions)\n timer.end()\n\n if (isBuildDifferentialAware && this.isWebInstaller) {\n const data = await appendBlockmap(archiveFile)\n return {\n ...data,\n path: archiveFile,\n }\n } else {\n return await createPackageFileInfo(archiveFile)\n }\n }\n\n protected get installerFilenamePattern(): string {\n // tslint:disable:no-invalid-template-strings\n return \"${productName} \" + (this.isPortable ? \"\" : \"Setup \") + \"${version}.${ext}\"\n }\n\n private get isPortable() {\n return this.name === \"portable\"\n }\n\n async finishBuild(): Promise<any> {\n try {\n const { pattern } = this.packager.artifactPatternConfig(this.options, this.installerFilenamePattern)\n const builds = new Set([this.archs])\n if (pattern.includes(\"${arch}\") && this.archs.size > 1) {\n ;[...this.archs].forEach(([arch, appOutDir]) => builds.add(new Map().set(arch, appOutDir)))\n }\n const doBuildArchs = builds.values()\n for (const archs of doBuildArchs) {\n await this.buildInstaller(archs)\n }\n } finally {\n await this.packageHelper.finishBuild()\n }\n }\n\n private async buildInstaller(archs: Map<Arch, string>): Promise<any> {\n const primaryArch = archs.size === 1 ? archs.keys().next().value : null\n const packager = this.packager\n const appInfo = packager.appInfo\n const options = this.options\n const installerFilename = packager.expandArtifactNamePattern(\n options,\n \"exe\",\n primaryArch,\n this.installerFilenamePattern,\n false,\n this.packager.platformSpecificBuildOptions.defaultArch\n )\n const oneClick = options.oneClick !== false\n const installerPath = path.join(this.outDir, installerFilename)\n\n const logFields: any = {\n target: this.name,\n file: log.filePath(installerPath),\n archs: Array.from(archs.keys())\n .map(it => Arch[it])\n .join(\", \"),\n }\n const isPerMachine = options.perMachine === true\n if (!this.isPortable) {\n logFields.oneClick = oneClick\n logFields.perMachine = isPerMachine\n }\n\n await packager.info.callArtifactBuildStarted(\n {\n targetPresentableName: this.name,\n file: installerPath,\n arch: primaryArch,\n },\n logFields\n )\n\n const guid = options.guid || UUID.v5(appInfo.id, ELECTRON_BUILDER_NS_UUID)\n const uninstallAppKey = guid.replace(/\\\\/g, \" - \")\n const defines: any = {\n APP_ID: appInfo.id,\n APP_GUID: guid,\n // Windows bug - entry in Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall cannot have \\ symbols (dir)\n UNINSTALL_APP_KEY: uninstallAppKey,\n PRODUCT_NAME: appInfo.productName,\n PRODUCT_FILENAME: appInfo.productFilename,\n APP_FILENAME: getWindowsInstallationDirName(appInfo, !oneClick || isPerMachine),\n APP_DESCRIPTION: appInfo.description,\n VERSION: appInfo.version,\n\n PROJECT_DIR: packager.projectDir,\n BUILD_RESOURCES_DIR: packager.info.buildResourcesDir,\n\n APP_PACKAGE_NAME: getWindowsInstallationAppPackageName(appInfo.name),\n }\n if (options.customNsisBinary?.debugLogging) {\n defines.ENABLE_LOGGING_ELECTRON_BUILDER = null\n }\n if (uninstallAppKey !== guid) {\n defines.UNINSTALL_REGISTRY_KEY_2 = `Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Uninstall\\\\${guid}`\n }\n\n const commands: any = {\n OutFile: `\"${installerPath}\"`,\n VIProductVersion: appInfo.getVersionInWeirdWindowsForm(),\n VIAddVersionKey: this.computeVersionKey(),\n Unicode: this.isUnicodeEnabled,\n }\n\n const isPortable = this.isPortable\n const iconPath = (isPortable ? null : await packager.getResource(options.installerIcon, \"installerIcon.ico\")) || (await packager.getIconPath())\n if (iconPath != null) {\n if (isPortable) {\n commands.Icon = `\"${iconPath}\"`\n } else {\n defines.MUI_ICON = iconPath\n defines.MUI_UNICON = iconPath\n }\n }\n\n const packageFiles: { [arch: string]: PackageFileInfo } = {}\n let estimatedSize = 0\n if (this.isPortable && options.useZip) {\n for (const [arch, dir] of archs.entries()) {\n defines[arch === Arch.x64 ? \"APP_DIR_64\" : arch === Arch.arm64 ? \"APP_DIR_ARM64\" : \"APP_DIR_32\"] = dir\n }\n } else if (USE_NSIS_BUILT_IN_COMPRESSOR && archs.size === 1) {\n defines.APP_BUILD_DIR = archs.get(archs.keys().next().value)\n } else {\n await BluebirdPromise.map(archs.keys(), async arch => {\n const fileInfo = await this.packageHelper.packArch(arch, this)\n const file = fileInfo.path\n const defineKey = arch === Arch.x64 ? \"APP_64\" : arch === Arch.arm64 ? \"APP_ARM64\" : \"APP_32\"\n defines[defineKey] = file\n defines[`${defineKey}_NAME`] = path.basename(file)\n // nsis expect a hexadecimal string\n defines[`${defineKey}_HASH`] = Buffer.from(fileInfo.sha512, \"base64\").toString(\"hex\").toUpperCase()\n\n if (this.isWebInstaller) {\n await packager.dispatchArtifactCreated(file, this, arch)\n packageFiles[Arch[arch]] = fileInfo\n }\n\n const archiveInfo = (await exec(path7za, [\"l\", file])).trim()\n // after adding blockmap data will be \"Warnings: 1\" in the end of output\n const match = /(\\d+)\\s+\\d+\\s+\\d+\\s+files/.exec(archiveInfo)\n if (match == null) {\n log.warn({ output: archiveInfo }, \"cannot compute size of app package\")\n } else {\n estimatedSize += parseInt(match[1], 10)\n }\n })\n }\n\n this.configureDefinesForAllTypeOfInstaller(defines)\n if (isPortable) {\n const { unpackDirName, requestExecutionLevel, splashImage } = options as PortableOptions\n defines.REQUEST_EXECUTION_LEVEL = requestExecutionLevel || \"user\"\n\n // https://github.com/electron-userland/electron-builder/issues/5764\n if (typeof unpackDirName === \"string\" || !unpackDirName) {\n defines.UNPACK_DIR_NAME = unpackDirName || (await executeAppBuilder([\"ksuid\"]))\n }\n\n if (splashImage != null) {\n defines.SPLASH_IMAGE = path.resolve(packager.projectDir, splashImage)\n }\n } else {\n await this.configureDefines(oneClick, defines)\n }\n\n if (estimatedSize !== 0) {\n // in kb\n defines.ESTIMATED_SIZE = Math.round(estimatedSize / 1024)\n }\n\n if (packager.compression === \"store\") {\n commands.SetCompress = \"off\"\n } else {\n // difference - 33.540 vs 33.601, only 61 KB (but zip is faster to decompress)\n // do not use /SOLID - \"With solid compression, files are uncompressed to temporary file before they are copied to their final destination\",\n // it is not good for portable installer (where built-in NSIS compression is used). http://forums.winamp.com/showpost.php?p=2982902&postcount=6\n commands.SetCompressor = \"zlib\"\n if (!this.isWebInstaller) {\n defines.COMPRESS = \"auto\"\n }\n }\n\n debug(defines)\n debug(commands)\n\n if (packager.packagerOptions.effectiveOptionComputed != null && (await packager.packagerOptions.effectiveOptionComputed([defines, commands]))) {\n return\n }\n\n // prepare short-version variants of defines and commands, to make an uninstaller that doesn't differ much from the previous one\n const definesUninstaller: any = { ...defines }\n const commandsUninstaller: any = { ...commands }\n if (appInfo.shortVersion != null) {\n definesUninstaller.VERSION = appInfo.shortVersion\n commandsUninstaller.VIProductVersion = appInfo.shortVersionWindows\n commandsUninstaller.VIAddVersionKey = this.computeVersionKey(true)\n }\n\n const sharedHeader = await this.computeCommonInstallerScriptHeader()\n const script = isPortable\n ? await readFile(path.join(nsisTemplatesDir, \"portable.nsi\"), \"utf8\")\n : await this.computeScriptAndSignUninstaller(definesUninstaller, commandsUninstaller, installerPath, sharedHeader, archs)\n\n // copy outfile name into main options, as the computeScriptAndSignUninstaller function was kind enough to add important data to temporary defines.\n defines.UNINSTALLER_OUT_FILE = definesUninstaller.UNINSTALLER_OUT_FILE\n\n await this.executeMakensis(defines, commands, sharedHeader + (await this.computeFinalScript(script, true, archs)))\n await Promise.all<any>([packager.sign(installerPath), defines.UNINSTALLER_OUT_FILE == null ? Promise.resolve() : unlink(defines.UNINSTALLER_OUT_FILE)])\n\n const safeArtifactName = computeSafeArtifactNameIfNeeded(installerFilename, () => this.generateGitHubInstallerName())\n let updateInfo: any\n if (this.isWebInstaller) {\n updateInfo = createNsisWebDifferentialUpdateInfo(installerPath, packageFiles)\n } else if (this.isBuildDifferentialAware) {\n updateInfo = await createBlockmap(installerPath, this, packager, safeArtifactName)\n }\n\n if (updateInfo != null && isPerMachine && oneClick) {\n updateInfo.isAdminRightsRequired = true\n }\n\n await packager.info.callArtifactBuildCompleted({\n file: installerPath,\n updateInfo,\n target: this,\n packager,\n arch: primaryArch,\n safeArtifactName,\n isWriteUpdateInfo: !this.isPortable,\n })\n }\n\n protected generateGitHubInstallerName() {\n const appInfo = this.packager.appInfo\n const classifier = appInfo.name.toLowerCase() === appInfo.name ? \"setup-\" : \"Setup-\"\n return `${appInfo.name}-${this.isPortable ? \"\" : classifier}${appInfo.version}.exe`\n }\n\n private get isUnicodeEnabled() {\n return this.options.unicode !== false\n }\n\n get isWebInstaller(): boolean {\n return false\n }\n\n private async computeScriptAndSignUninstaller(defines: any, commands: any, installerPath: string, sharedHeader: string, archs: Map<Arch, string>) {\n const packager = this.packager\n const customScriptPath = await packager.getResource(this.options.script, \"installer.nsi\")\n const script = await readFile(customScriptPath || path.join(nsisTemplatesDir, \"installer.nsi\"), \"utf8\")\n\n if (customScriptPath != null) {\n log.info({ reason: \"custom NSIS script is used\" }, \"uninstaller is not signed by electron-builder\")\n return script\n }\n\n // https://github.com/electron-userland/electron-builder/issues/2103\n // it is more safe and reliable to write uninstaller to our out dir\n const uninstallerPath = path.join(this.outDir, `__uninstaller-${this.name}-${this.packager.appInfo.sanitizedName}.exe`)\n const isWin = process.platform === \"win32\"\n defines.BUILD_UNINSTALLER = null\n defines.UNINSTALLER_OUT_FILE = isWin ? uninstallerPath : path.win32.join(\"Z:\", uninstallerPath)\n await this.executeMakensis(defines, commands, sharedHeader + (await this.computeFinalScript(script, false, archs)))\n\n // http://forums.winamp.com/showthread.php?p=3078545\n if (isMacOsCatalina()) {\n try {\n await UninstallerReader.exec(installerPath, uninstallerPath)\n } catch (error: any) {\n log.warn(`packager.vm is used: ${error.message}`)\n\n const vm = await packager.vm.value\n await vm.exec(installerPath, [])\n // Parallels VM can exit after command execution, but NSIS continue to be running\n let i = 0\n while (!(await exists(uninstallerPath)) && i++ < 100) {\n // noinspection JSUnusedLocalSymbols\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n await new Promise((resolve, _reject) => setTimeout(resolve, 300))\n }\n }\n } else {\n await execWine(installerPath, null, [], { env: { __COMPAT_LAYER: \"RunAsInvoker\" } })\n }\n await packager.sign(uninstallerPath, \" Signing NSIS uninstaller\")\n\n delete defines.BUILD_UNINSTALLER\n // platform-specific path, not wine\n defines.UNINSTALLER_OUT_FILE = uninstallerPath\n return script\n }\n\n private computeVersionKey(short = false) {\n // Error: invalid VIProductVersion format, should be X.X.X.X\n // so, we must strip beta\n const localeId = this.options.language || \"1033\"\n const appInfo = this.packager.appInfo\n const versionKey = [\n `/LANG=${localeId} ProductName \"${appInfo.productName}\"`,\n `/LANG=${localeId} ProductVersion \"${appInfo.version}\"`,\n `/LANG=${localeId} LegalCopyright \"${appInfo.copyright}\"`,\n `/LANG=${localeId} FileDescription \"${appInfo.description}\"`,\n `/LANG=${localeId} FileVersion \"${appInfo.buildVersion}\"`,\n ]\n if (short) {\n versionKey[1] = `/LANG=${localeId} ProductVersion \"${appInfo.shortVersion}\"`\n versionKey[4] = `/LANG=${localeId} FileVersion \"${appInfo.shortVersion}\"`\n }\n use(this.packager.platformSpecificBuildOptions.legalTrademarks, it => versionKey.push(`/LANG=${localeId} LegalTrademarks \"${it}\"`))\n use(appInfo.companyName, it => versionKey.push(`/LANG=${localeId} CompanyName \"${it}\"`))\n return versionKey\n }\n\n protected configureDefines(oneClick: boolean, defines: any): Promise<any> {\n const packager = this.packager\n const options = this.options\n\n const asyncTaskManager = new AsyncTaskManager(packager.info.cancellationToken)\n\n if (oneClick) {\n defines.ONE_CLICK = null\n\n if (options.runAfterFinish !== false) {\n defines.RUN_AFTER_FINISH = null\n }\n\n asyncTaskManager.add(async () => {\n const installerHeaderIcon = await packager.getResource(options.installerHeaderIcon, \"installerHeaderIcon.ico\")\n if (installerHeaderIcon != null) {\n defines.HEADER_ICO = installerHeaderIcon\n }\n })\n } else {\n if (options.runAfterFinish === false) {\n defines.HIDE_RUN_AFTER_FINISH = null\n }\n\n asyncTaskManager.add(async () => {\n const installerHeader = await packager.getResource(options.installerHeader, \"installerHeader.bmp\")\n if (installerHeader != null) {\n defines.MUI_HEADERIMAGE = null\n defines.MUI_HEADERIMAGE_RIGHT = null\n defines.MUI_HEADERIMAGE_BITMAP = installerHeader\n }\n })\n\n asyncTaskManager.add(async () => {\n const bitmap = (await packager.getResource(options.installerSidebar, \"installerSidebar.bmp\")) || \"${NSISDIR}\\\\Contrib\\\\Graphics\\\\Wizard\\\\nsis3-metro.bmp\"\n defines.MUI_WELCOMEFINISHPAGE_BITMAP = bitmap\n defines.MUI_UNWELCOMEFINISHPAGE_BITMAP = (await packager.getResource(options.uninstallerSidebar, \"uninstallerSidebar.bmp\")) || bitmap\n })\n\n if (options.allowElevation !== false) {\n defines.MULTIUSER_INSTALLMODE_ALLOW_ELEVATION = null\n }\n }\n\n if (options.perMachine === true) {\n defines.INSTALL_MODE_PER_ALL_USERS = null\n }\n\n if (!oneClick || options.perMachine === true) {\n defines.INSTALL_MODE_PER_ALL_USERS_REQUIRED = null\n }\n\n if (options.allowToChangeInstallationDirectory) {\n if (oneClick) {\n throw new InvalidConfigurationError(\"allowToChangeInstallationDirectory makes sense only for assisted installer (please set oneClick to false)\")\n }\n defines.allowToChangeInstallationDirectory = null\n }\n\n const commonOptions = getEffectiveOptions(options, packager)\n\n if (commonOptions.menuCategory != null) {\n defines.MENU_FILENAME = commonOptions.menuCategory\n }\n\n defines.SHORTCUT_NAME = commonOptions.shortcutName\n\n if (options.deleteAppDataOnUninstall) {\n defines.DELETE_APP_DATA_ON_UNINSTALL = null\n }\n\n asyncTaskManager.add(async () => {\n const uninstallerIcon = await packager.getResource(options.uninstallerIcon, \"uninstallerIcon.ico\")\n if (uninstallerIcon != null) {\n // we don't need to copy MUI_UNICON (defaults to app icon), so, we have 2 defines\n defines.UNINSTALLER_ICON = uninstallerIcon\n defines.MUI_UNICON = uninstallerIcon\n }\n })\n\n defines.UNINSTALL_DISPLAY_NAME = packager.expandMacro(options.uninstallDisplayName || \"${productName} ${version}\", null, {}, false)\n if (commonOptions.isCreateDesktopShortcut === DesktopShortcutCreationPolicy.NEVER) {\n defines.DO_NOT_CREATE_DESKTOP_SHORTCUT = null\n }\n if (commonOptions.isCreateDesktopShortcut === DesktopShortcutCreationPolicy.ALWAYS) {\n defines.RECREATE_DESKTOP_SHORTCUT = null\n }\n if (!commonOptions.isCreateStartMenuShortcut) {\n defines.DO_NOT_CREATE_START_MENU_SHORTCUT = null\n }\n\n if (options.displayLanguageSelector === true) {\n defines.DISPLAY_LANG_SELECTOR = null\n }\n\n return asyncTaskManager.awaitTasks()\n }\n\n private configureDefinesForAllTypeOfInstaller(defines: any) {\n const appInfo = this.packager.appInfo\n const companyName = appInfo.companyName\n if (companyName != null) {\n defines.COMPANY_NAME = companyName\n }\n\n // electron uses product file name as app data, define it as well to remove on uninstall\n if (defines.APP_FILENAME !== appInfo.productFilename) {\n defines.APP_PRODUCT_FILENAME = appInfo.productFilename\n }\n\n if (this.isWebInstaller) {\n defines.APP_PACKAGE_STORE_FILE = `${appInfo.updaterCacheDirName}\\\\${CURRENT_APP_PACKAGE_FILE_NAME}`\n } else {\n defines.APP_INSTALLER_STORE_FILE = `${appInfo.updaterCacheDirName}\\\\${CURRENT_APP_INSTALLER_FILE_NAME}`\n }\n\n if (!this.isWebInstaller && defines.APP_BUILD_DIR == null) {\n const options = this.options\n if (options.useZip) {\n defines.ZIP_COMPRESSION = null\n }\n\n defines.COMPRESSION_METHOD = options.useZip ? \"zip\" : \"7z\"\n }\n }\n\n private async executeMakensis(defines: any, commands: any, script: string) {\n const args: Array<string> = this.options.warningsAsErrors === false ? [] : [\"-WX\"]\n args.push(\"-INPUTCHARSET\", \"UTF8\")\n for (const name of Object.keys(defines)) {\n const value = defines[name]\n if (value == null) {\n args.push(`-D${name}`)\n } else {\n args.push(`-D${name}=${value}`)\n }\n }\n\n for (const name of Object.keys(commands)) {\n const value = commands[name]\n if (Array.isArray(value)) {\n for (const c of value) {\n args.push(`-X${name} ${c}`)\n }\n } else {\n args.push(`-X${name} ${value}`)\n }\n }\n\n args.push(\"-\")\n\n if (this.packager.debugLogger.isEnabled) {\n this.packager.debugLogger.add(\"nsis.script\", script)\n }\n\n const nsisPath = await NSIS_PATH()\n const command = path.join(\n nsisPath,\n process.platform === \"darwin\" ? \"mac\" : process.platform === \"win32\" ? \"Bin\" : \"linux\",\n process.platform === \"win32\" ? \"makensis.exe\" : \"makensis\"\n )\n\n // if (process.platform === \"win32\") {\n // fix for an issue caused by virus scanners, locking the file during write\n // https://github.com/electron-userland/electron-builder/issues/5005\n await ensureNotBusy(commands[\"OutFile\"].replace(/\"/g, \"\"))\n // }\n\n await spawnAndWrite(command, args, script, {\n // we use NSIS_CONFIG_CONST_DATA_PATH=no to build makensis on Linux, but in any case it doesn't use stubs as MacOS/Windows version, so, we explicitly set NSISDIR\n env: { ...process.env, NSISDIR: nsisPath },\n cwd: nsisTemplatesDir,\n })\n }\n\n private async computeCommonInstallerScriptHeader() {\n const packager = this.packager\n const options = this.options\n const scriptGenerator = new NsisScriptGenerator()\n const langConfigurator = new LangConfigurator(options)\n\n scriptGenerator.include(path.join(nsisTemplatesDir, \"include\", \"StdUtils.nsh\"))\n\n const includeDir = path.join(nsisTemplatesDir, \"include\")\n scriptGenerator.addIncludeDir(includeDir)\n scriptGenerator.flags([\"updated\", \"force-run\", \"keep-shortcuts\", \"no-desktop-shortcut\", \"delete-app-data\", \"allusers\", \"currentuser\"])\n\n createAddLangsMacro(scriptGenerator, langConfigurator)\n\n const taskManager = new AsyncTaskManager(packager.info.cancellationToken)\n\n const pluginArch = this.isUnicodeEnabled ? \"x86-unicode\" : \"x86-ansi\"\n taskManager.add(async () => {\n scriptGenerator.addPluginDir(pluginArch, path.join(await nsisResourcePathPromise(), \"plugins\", pluginArch))\n })\n\n taskManager.add(async () => {\n const userPluginDir = path.join(packager.info.buildResourcesDir, pluginArch)\n const stat = await statOrNull(userPluginDir)\n if (stat != null && stat.isDirectory()) {\n scriptGenerator.addPluginDir(pluginArch, userPluginDir)\n }\n })\n\n taskManager.addTask(addCustomMessageFileInclude(\"messages.yml\", packager, scriptGenerator, langConfigurator))\n\n if (!this.isPortable) {\n if (options.oneClick === false) {\n taskManager.addTask(addCustomMessageFileInclude(\"assistedMessages.yml\", packager, scriptGenerator, langConfigurator))\n }\n\n taskManager.add(async () => {\n const customInclude = await packager.getResource(this.options.include, \"installer.nsh\")\n if (customInclude != null) {\n scriptGenerator.addIncludeDir(packager.info.buildResourcesDir)\n scriptGenerator.include(customInclude)\n }\n })\n }\n\n await taskManager.awaitTasks()\n return scriptGenerator.build()\n }\n\n private async computeFinalScript(originalScript: string, isInstaller: boolean, archs: Map<Arch, string>) {\n const packager = this.packager\n const options = this.options\n const langConfigurator = new LangConfigurator(options)\n\n const scriptGenerator = new NsisScriptGenerator()\n const taskManager = new AsyncTaskManager(packager.info.cancellationToken)\n\n if (isInstaller) {\n // http://stackoverflow.com/questions/997456/nsis-license-file-based-on-language-selection\n taskManager.add(() => computeLicensePage(packager, options, scriptGenerator, langConfigurator.langs))\n }\n\n await taskManager.awaitTasks()\n\n if (this.isPortable) {\n return scriptGenerator.build() + originalScript\n }\n\n const preCompressedFileExtensions = this.getPreCompressedFileExtensions()\n if (preCompressedFileExtensions != null && preCompressedFileExtensions.length !== 0) {\n for (const [arch, dir] of archs.entries()) {\n await generateForPreCompressed(preCompressedFileExtensions, dir, arch, scriptGenerator)\n }\n }\n\n const fileAssociations = packager.fileAssociations\n if (fileAssociations.length !== 0) {\n scriptGenerator.include(path.join(path.join(nsisTemplatesDir, \"include\"), \"FileAssociation.nsh\"))\n if (isInstaller) {\n const registerFileAssociationsScript = new NsisScriptGenerator()\n for (const item of fileAssociations) {\n const extensions = asArray(item.ext).map(normalizeExt)\n for (const ext of extensions) {\n const customIcon = await packager.getResource(getPlatformIconFileName(item.icon, false), `${extensions[0]}.ico`)\n let installedIconPath = \"$appExe,0\"\n if (customIcon != null) {\n installedIconPath = `$INSTDIR\\\\resources\\\\${path.basename(customIcon)}`\n registerFileAssociationsScript.file(installedIconPath, customIcon)\n }\n\n const icon = `\"${installedIconPath}\"`\n const commandText = `\"Open with ${packager.appInfo.productName}\"`\n const command = '\"$appExe $\\\\\"%1$\\\\\"\"'\n registerFileAssociationsScript.insertMacro(\"APP_ASSOCIATE\", `\"${ext}\" \"${item.name || ext}\" \"${item.description || \"\"}\" ${icon} ${commandText} ${command}`)\n }\n }\n scriptGenerator.macro(\"registerFileAssociations\", registerFileAssociationsScript)\n } else {\n const unregisterFileAssociationsScript = new NsisScriptGenerator()\n for (const item of fileAssociations) {\n for (const ext of asArray(item.ext)) {\n unregisterFileAssociationsScript.insertMacro(\"APP_UNASSOCIATE\", `\"${normalizeExt(ext)}\" \"${item.name || ext}\"`)\n }\n }\n scriptGenerator.macro(\"unregisterFileAssociations\", unregisterFileAssociationsScript)\n }\n }\n\n return scriptGenerator.build() + originalScript\n }\n}\n\nasync function generateForPreCompressed(preCompressedFileExtensions: Array<string>, dir: string, arch: Arch, scriptGenerator: NsisScriptGenerator) {\n const resourcesDir = path.join(dir, \"resources\")\n const dirInfo = await statOrNull(resourcesDir)\n if (dirInfo == null || !dirInfo.isDirectory()) {\n return\n }\n\n const nodeModules = `${path.sep}node_modules`\n const preCompressedAssets = await walk(resourcesDir, (file, stat) => {\n if (stat.isDirectory()) {\n return !file.endsWith(nodeModules)\n } else {\n return preCompressedFileExtensions.some(it => file.endsWith(it))\n }\n })\n\n if (preCompressedAssets.length !== 0) {\n const macro = new NsisScriptGenerator()\n for (const file of preCompressedAssets) {\n macro.file(`$INSTDIR\\\\${path.relative(dir, file).replace(/\\//g, \"\\\\\")}`, file)\n }\n scriptGenerator.macro(`customFiles_${Arch[arch]}`, macro)\n }\n}\n\nasync function ensureNotBusy(outFile: string) {\n function isBusy(wasBusyBefore: boolean): Promise<boolean> {\n return new Promise((resolve, reject) => {\n fs.open(outFile, \"r+\", (error, fd) => {\n try {\n if (error != null && error.code === \"EBUSY\") {\n if (!wasBusyBefore) {\n log.info({}, \"output file is locked for writing (maybe by virus scanner) => waiting for unlock...\")\n }\n resolve(false)\n } else if (fd == null) {\n resolve(true)\n } else {\n fs.close(fd, () => resolve(true))\n }\n } catch (error) {\n reject(error)\n }\n })\n }).then(result => {\n if (result) {\n return true\n } else {\n return new Promise(resolve => setTimeout(resolve, 2000)).then(() => isBusy(true))\n }\n })\n }\n\n await isBusy(false)\n}\n\nasync function createPackageFileInfo(file: string): Promise<PackageFileInfo> {\n return {\n path: file,\n size: (await stat(file)).size,\n sha512: await hashFile(file),\n }\n}\n"]}
|
|
@@ -2,20 +2,24 @@ import { TargetSpecificOptions } from "../../core";
|
|
|
2
2
|
import { CommonWindowsInstallerConfiguration } from "../..";
|
|
3
3
|
interface CustomNsisBinary {
|
|
4
4
|
/**
|
|
5
|
-
* @private
|
|
6
5
|
* @default https://github.com/electron-userland/electron-builder-binaries/releases/download
|
|
7
6
|
*/
|
|
8
7
|
readonly url: string | null;
|
|
9
8
|
/**
|
|
10
|
-
* @private
|
|
11
9
|
* @default VKMiizYdmNdJOWpRGz4trl4lD++BvYP2irAXpMilheUP0pc93iKlWAoP843Vlraj8YG19CVn0j+dCo/hURz9+Q==
|
|
12
10
|
*/
|
|
13
11
|
readonly checksum?: string | null;
|
|
14
12
|
/**
|
|
15
|
-
* @private
|
|
16
13
|
* @default 3.0.4.1
|
|
17
14
|
*/
|
|
18
15
|
readonly version?: string | null;
|
|
16
|
+
/**
|
|
17
|
+
* Whether or not to enable NSIS logging for debugging.
|
|
18
|
+
* Note: Requires a debug-enabled NSIS build.
|
|
19
|
+
* electron-builder's included `makensis` does not natively support debug-enabled NSIS installers currently, you must supply your own via `customNsisBinary?: CustomNsisBinary`
|
|
20
|
+
* In your custom nsis scripts, you can leverage this functionality via `LogSet` and `LogText`
|
|
21
|
+
*/
|
|
22
|
+
readonly debugLogging?: boolean | null;
|
|
19
23
|
}
|
|
20
24
|
export interface CommonNsisOptions {
|
|
21
25
|
/**
|
|
@@ -38,17 +42,9 @@ export interface CommonNsisOptions {
|
|
|
38
42
|
*/
|
|
39
43
|
readonly useZip?: boolean;
|
|
40
44
|
/**
|
|
41
|
-
*
|
|
45
|
+
* Allows you to provide your own `makensis`, such as one with support for debug logging via LogSet and LogText. (Logging also requires option `debugLogging = true`)
|
|
42
46
|
*/
|
|
43
47
|
readonly customNsisBinary?: CustomNsisBinary | null;
|
|
44
|
-
/**
|
|
45
|
-
* Whether or not to enable NSIS logging for debugging.
|
|
46
|
-
* Note: Requires a debug-enabled NSIS build.
|
|
47
|
-
* electron-builder's included `makensis` only supports building debug-enabled NSIS installers on Windows currently
|
|
48
|
-
* https://github.com/electron-userland/electron-builder/issues/5119#issuecomment-811353612
|
|
49
|
-
* @private
|
|
50
|
-
*/
|
|
51
|
-
readonly debugLogging?: boolean | null;
|
|
52
48
|
}
|
|
53
49
|
export interface NsisOptions extends CommonNsisOptions, CommonWindowsInstallerConfiguration, TargetSpecificOptions {
|
|
54
50
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nsisOptions.js","sourceRoot":"","sources":["../../../src/targets/nsis/nsisOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { TargetSpecificOptions } from \"../../core\"\nimport { CommonWindowsInstallerConfiguration } from \"../..\"\n\ninterface CustomNsisBinary {\n /**\n * @private\n * @default https://github.com/electron-userland/electron-builder-binaries/releases/download\n */\n\n readonly url: string | null\n\n /**\n * @private\n * @default VKMiizYdmNdJOWpRGz4trl4lD++BvYP2irAXpMilheUP0pc93iKlWAoP843Vlraj8YG19CVn0j+dCo/hURz9+Q==\n */\n\n readonly checksum?: string | null\n\n /**\n * @private\n * @default 3.0.4.1\n */\n\n readonly version?: string | null\n}\nexport interface CommonNsisOptions {\n /**\n * Whether to create [Unicode installer](http://nsis.sourceforge.net/Docs/Chapter1.html#intro-unicode).\n * @default true\n */\n readonly unicode?: boolean\n\n /**\n * See [GUID vs Application Name](../configuration/nsis#guid-vs-application-name).\n */\n readonly guid?: string | null\n\n /**\n * If `warningsAsErrors` is `true` (default): NSIS will treat warnings as errors. If `warningsAsErrors` is `false`: NSIS will allow warnings.\n * @default true\n */\n readonly warningsAsErrors?: boolean\n\n /**\n * @private\n * @default false\n */\n readonly useZip?: boolean\n\n /**\n * @private\n */\n readonly customNsisBinary?: CustomNsisBinary | null\n\n /**\n * Whether or not to enable NSIS logging for debugging.\n * Note: Requires a debug-enabled NSIS build.\n * electron-builder's included `makensis` only supports building debug-enabled NSIS installers on Windows currently\n * https://github.com/electron-userland/electron-builder/issues/5119#issuecomment-811353612\n * @private\n */\n readonly debugLogging?: boolean | null\n}\n\nexport interface NsisOptions extends CommonNsisOptions, CommonWindowsInstallerConfiguration, TargetSpecificOptions {\n /**\n * Whether to create one-click installer or assisted.\n * @default true\n */\n readonly oneClick?: boolean\n\n /**\n * Whether to show install mode installer page (choice per-machine or per-user) for assisted installer. Or whether installation always per all users (per-machine).\n *\n * If `oneClick` is `true` (default): Whether to install per all users (per-machine).\n *\n * If `oneClick` is `false` and `perMachine` is `true`: no install mode installer page, always install per-machine.\n *\n * If `oneClick` is `false` and `perMachine` is `false` (default): install mode installer page.\n * @default false\n */\n readonly perMachine?: boolean\n\n /**\n * *assisted installer only.* Allow requesting for elevation. If false, user will have to restart installer with elevated permissions.\n * @default true\n */\n readonly allowElevation?: boolean\n\n /**\n * *assisted installer only.* Whether to allow user to change installation directory.\n * @default false\n */\n readonly allowToChangeInstallationDirectory?: boolean\n\n /**\n * The path to installer icon, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory.\n * Defaults to `build/installerIcon.ico` or application icon.\n */\n readonly installerIcon?: string | null\n /**\n * The path to uninstaller icon, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory.\n * Defaults to `build/uninstallerIcon.ico` or application icon.\n */\n readonly uninstallerIcon?: string | null\n /**\n * *assisted installer only.* `MUI_HEADERIMAGE`, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory.\n * @default build/installerHeader.bmp\n */\n readonly installerHeader?: string | null\n /**\n * *one-click installer only.* The path to header icon (above the progress bar), relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory.\n * Defaults to `build/installerHeaderIcon.ico` or application icon.\n */\n readonly installerHeaderIcon?: string | null\n /**\n * *assisted installer only.* `MUI_WELCOMEFINISHPAGE_BITMAP`, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory.\n * Defaults to `build/installerSidebar.bmp` or `${NSISDIR}\\\\Contrib\\\\Graphics\\\\Wizard\\\\nsis3-metro.bmp`. Image size 164 × 314 pixels.\n */\n readonly installerSidebar?: string | null\n /**\n * *assisted installer only.* `MUI_UNWELCOMEFINISHPAGE_BITMAP`, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory.\n * Defaults to `installerSidebar` option or `build/uninstallerSidebar.bmp` or `build/installerSidebar.bmp` or `${NSISDIR}\\\\Contrib\\\\Graphics\\\\Wizard\\\\nsis3-metro.bmp`\n */\n readonly uninstallerSidebar?: string | null\n /**\n * The uninstaller display name in the control panel.\n * @default ${productName} ${version}\n */\n readonly uninstallDisplayName?: string\n\n /**\n * The path to NSIS include script to customize installer. Defaults to `build/installer.nsh`. See [Custom NSIS script](#custom-nsis-script).\n */\n readonly include?: string | null\n /**\n * The path to NSIS script to customize installer. Defaults to `build/installer.nsi`. See [Custom NSIS script](#custom-nsis-script).\n */\n readonly script?: string | null\n\n /**\n * The path to EULA license file. Defaults to `license.txt` or `eula.txt` (or uppercase variants). In addition to `txt, `rtf` and `html` supported (don't forget to use `target=\"_blank\"` for links).\n *\n * Multiple license files in different languages are supported — use lang postfix (e.g. `_de`, `_ru`)). For example, create files `license_de.txt` and `license_en.txt` in the build resources.\n * If OS language is german, `license_de.txt` will be displayed. See map of [language code to name](https://github.com/meikidd/iso-639-1/blob/master/src/data.js).\n *\n * Appropriate license file will be selected by user OS language.\n */\n readonly license?: string | null\n\n /**\n * The [artifact file name template](/configuration/configuration#artifact-file-name-template). Defaults to `${productName} Setup ${version}.${ext}`.\n */\n readonly artifactName?: string | null\n\n /**\n * *one-click installer only.* Whether to delete app data on uninstall.\n * @default false\n */\n readonly deleteAppDataOnUninstall?: boolean\n\n /**\n * @private\n */\n differentialPackage?: boolean\n\n /**\n * Whether to display a language selection dialog. Not recommended (by default will be detected using OS language).\n * @default false\n */\n readonly displayLanguageSelector?: boolean\n /**\n * The installer languages (e.g. `en_US`, `de_DE`). Change only if you understand what do you do and for what.\n */\n readonly installerLanguages?: Array<string> | string | null\n /**\n * [LCID Dec](https://msdn.microsoft.com/en-au/goglobal/bb964664.aspx), defaults to `1033`(`English - United States`).\n */\n readonly language?: string | null\n /**\n * Whether to create multi-language installer. Defaults to `unicode` option value.\n */\n readonly multiLanguageInstaller?: boolean\n /**\n * Whether to pack the elevate executable (required for electron-updater if per-machine installer used or can be used in the future). Ignored if `perMachine` is set to `true`.\n * @default true\n */\n readonly packElevateHelper?: boolean\n\n /**\n * The file extension of files that will be not compressed. Applicable only for `extraResources` and `extraFiles` files.\n * @default [\".avi\", \".mov\", \".m4v\", \".mp4\", \".m4p\", \".qt\", \".mkv\", \".webm\", \".vmdk\"]\n */\n readonly preCompressedFileExtensions?: Array<string> | string | null\n}\n\n/**\n * Portable options.\n */\nexport interface PortableOptions extends TargetSpecificOptions, CommonNsisOptions {\n /**\n * The [requested execution level](http://nsis.sourceforge.net/Reference/RequestExecutionLevel) for Windows.\n * @default user\n */\n readonly requestExecutionLevel?: \"user\" | \"highest\" | \"admin\"\n\n /**\n * The unpack directory for the portable app resources.\n *\n * If set to a string, it will be the name in [TEMP](https://www.askvg.com/where-does-windows-store-temporary-files-and-how-to-change-temp-folder-location/) directory\n * If set explicitly to `false`, it will use the Windows temp directory ($PLUGINSDIR) that is unique to each launch of the portable application.\n *\n * Defaults to [uuid](https://github.com/segmentio/ksuid) of build (changed on each build of portable executable).\n */\n readonly unpackDirName?: string | boolean\n\n /**\n * The image to show while the portable executable is extracting. This image must be a bitmap (`.bmp`) image.\n */\n readonly splashImage?: string | null\n}\n\n/**\n * Web Installer options.\n */\nexport interface NsisWebOptions extends NsisOptions {\n /**\n * The application package download URL. Optional — by default computed using publish configuration.\n *\n * URL like `https://example.com/download/latest` allows web installer to be version independent (installer will download latest application package).\n * Please note — it is [full URL](https://github.com/electron-userland/electron-builder/issues/1810#issuecomment-317650878).\n *\n * Custom `X-Arch` http header is set to `32` or `64`.\n */\n readonly appPackageUrl?: string | null\n\n /**\n * The [artifact file name template](/configuration/configuration#artifact-file-name-template). Defaults to `${productName} Web Setup ${version}.${ext}`.\n */\n readonly artifactName?: string | null\n}\n"]}
|
|
1
|
+
{"version":3,"file":"nsisOptions.js","sourceRoot":"","sources":["../../../src/targets/nsis/nsisOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { TargetSpecificOptions } from \"../../core\"\nimport { CommonWindowsInstallerConfiguration } from \"../..\"\n\ninterface CustomNsisBinary {\n /**\n * @default https://github.com/electron-userland/electron-builder-binaries/releases/download\n */\n readonly url: string | null\n\n /**\n * @default VKMiizYdmNdJOWpRGz4trl4lD++BvYP2irAXpMilheUP0pc93iKlWAoP843Vlraj8YG19CVn0j+dCo/hURz9+Q==\n */\n readonly checksum?: string | null\n\n /**\n * @default 3.0.4.1\n */\n readonly version?: string | null\n\n /**\n * Whether or not to enable NSIS logging for debugging.\n * Note: Requires a debug-enabled NSIS build.\n * electron-builder's included `makensis` does not natively support debug-enabled NSIS installers currently, you must supply your own via `customNsisBinary?: CustomNsisBinary`\n * In your custom nsis scripts, you can leverage this functionality via `LogSet` and `LogText`\n */\n readonly debugLogging?: boolean | null\n}\nexport interface CommonNsisOptions {\n /**\n * Whether to create [Unicode installer](http://nsis.sourceforge.net/Docs/Chapter1.html#intro-unicode).\n * @default true\n */\n readonly unicode?: boolean\n\n /**\n * See [GUID vs Application Name](../configuration/nsis#guid-vs-application-name).\n */\n readonly guid?: string | null\n\n /**\n * If `warningsAsErrors` is `true` (default): NSIS will treat warnings as errors. If `warningsAsErrors` is `false`: NSIS will allow warnings.\n * @default true\n */\n readonly warningsAsErrors?: boolean\n\n /**\n * @private\n * @default false\n */\n readonly useZip?: boolean\n\n /**\n * Allows you to provide your own `makensis`, such as one with support for debug logging via LogSet and LogText. (Logging also requires option `debugLogging = true`)\n */\n readonly customNsisBinary?: CustomNsisBinary | null\n}\n\nexport interface NsisOptions extends CommonNsisOptions, CommonWindowsInstallerConfiguration, TargetSpecificOptions {\n /**\n * Whether to create one-click installer or assisted.\n * @default true\n */\n readonly oneClick?: boolean\n\n /**\n * Whether to show install mode installer page (choice per-machine or per-user) for assisted installer. Or whether installation always per all users (per-machine).\n *\n * If `oneClick` is `true` (default): Whether to install per all users (per-machine).\n *\n * If `oneClick` is `false` and `perMachine` is `true`: no install mode installer page, always install per-machine.\n *\n * If `oneClick` is `false` and `perMachine` is `false` (default): install mode installer page.\n * @default false\n */\n readonly perMachine?: boolean\n\n /**\n * *assisted installer only.* Allow requesting for elevation. If false, user will have to restart installer with elevated permissions.\n * @default true\n */\n readonly allowElevation?: boolean\n\n /**\n * *assisted installer only.* Whether to allow user to change installation directory.\n * @default false\n */\n readonly allowToChangeInstallationDirectory?: boolean\n\n /**\n * The path to installer icon, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory.\n * Defaults to `build/installerIcon.ico` or application icon.\n */\n readonly installerIcon?: string | null\n /**\n * The path to uninstaller icon, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory.\n * Defaults to `build/uninstallerIcon.ico` or application icon.\n */\n readonly uninstallerIcon?: string | null\n /**\n * *assisted installer only.* `MUI_HEADERIMAGE`, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory.\n * @default build/installerHeader.bmp\n */\n readonly installerHeader?: string | null\n /**\n * *one-click installer only.* The path to header icon (above the progress bar), relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory.\n * Defaults to `build/installerHeaderIcon.ico` or application icon.\n */\n readonly installerHeaderIcon?: string | null\n /**\n * *assisted installer only.* `MUI_WELCOMEFINISHPAGE_BITMAP`, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory.\n * Defaults to `build/installerSidebar.bmp` or `${NSISDIR}\\\\Contrib\\\\Graphics\\\\Wizard\\\\nsis3-metro.bmp`. Image size 164 × 314 pixels.\n */\n readonly installerSidebar?: string | null\n /**\n * *assisted installer only.* `MUI_UNWELCOMEFINISHPAGE_BITMAP`, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory.\n * Defaults to `installerSidebar` option or `build/uninstallerSidebar.bmp` or `build/installerSidebar.bmp` or `${NSISDIR}\\\\Contrib\\\\Graphics\\\\Wizard\\\\nsis3-metro.bmp`\n */\n readonly uninstallerSidebar?: string | null\n /**\n * The uninstaller display name in the control panel.\n * @default ${productName} ${version}\n */\n readonly uninstallDisplayName?: string\n\n /**\n * The path to NSIS include script to customize installer. Defaults to `build/installer.nsh`. See [Custom NSIS script](#custom-nsis-script).\n */\n readonly include?: string | null\n /**\n * The path to NSIS script to customize installer. Defaults to `build/installer.nsi`. See [Custom NSIS script](#custom-nsis-script).\n */\n readonly script?: string | null\n\n /**\n * The path to EULA license file. Defaults to `license.txt` or `eula.txt` (or uppercase variants). In addition to `txt, `rtf` and `html` supported (don't forget to use `target=\"_blank\"` for links).\n *\n * Multiple license files in different languages are supported — use lang postfix (e.g. `_de`, `_ru`)). For example, create files `license_de.txt` and `license_en.txt` in the build resources.\n * If OS language is german, `license_de.txt` will be displayed. See map of [language code to name](https://github.com/meikidd/iso-639-1/blob/master/src/data.js).\n *\n * Appropriate license file will be selected by user OS language.\n */\n readonly license?: string | null\n\n /**\n * The [artifact file name template](/configuration/configuration#artifact-file-name-template). Defaults to `${productName} Setup ${version}.${ext}`.\n */\n readonly artifactName?: string | null\n\n /**\n * *one-click installer only.* Whether to delete app data on uninstall.\n * @default false\n */\n readonly deleteAppDataOnUninstall?: boolean\n\n /**\n * @private\n */\n differentialPackage?: boolean\n\n /**\n * Whether to display a language selection dialog. Not recommended (by default will be detected using OS language).\n * @default false\n */\n readonly displayLanguageSelector?: boolean\n /**\n * The installer languages (e.g. `en_US`, `de_DE`). Change only if you understand what do you do and for what.\n */\n readonly installerLanguages?: Array<string> | string | null\n /**\n * [LCID Dec](https://msdn.microsoft.com/en-au/goglobal/bb964664.aspx), defaults to `1033`(`English - United States`).\n */\n readonly language?: string | null\n /**\n * Whether to create multi-language installer. Defaults to `unicode` option value.\n */\n readonly multiLanguageInstaller?: boolean\n /**\n * Whether to pack the elevate executable (required for electron-updater if per-machine installer used or can be used in the future). Ignored if `perMachine` is set to `true`.\n * @default true\n */\n readonly packElevateHelper?: boolean\n\n /**\n * The file extension of files that will be not compressed. Applicable only for `extraResources` and `extraFiles` files.\n * @default [\".avi\", \".mov\", \".m4v\", \".mp4\", \".m4p\", \".qt\", \".mkv\", \".webm\", \".vmdk\"]\n */\n readonly preCompressedFileExtensions?: Array<string> | string | null\n}\n\n/**\n * Portable options.\n */\nexport interface PortableOptions extends TargetSpecificOptions, CommonNsisOptions {\n /**\n * The [requested execution level](http://nsis.sourceforge.net/Reference/RequestExecutionLevel) for Windows.\n * @default user\n */\n readonly requestExecutionLevel?: \"user\" | \"highest\" | \"admin\"\n\n /**\n * The unpack directory for the portable app resources.\n *\n * If set to a string, it will be the name in [TEMP](https://www.askvg.com/where-does-windows-store-temporary-files-and-how-to-change-temp-folder-location/) directory\n * If set explicitly to `false`, it will use the Windows temp directory ($PLUGINSDIR) that is unique to each launch of the portable application.\n *\n * Defaults to [uuid](https://github.com/segmentio/ksuid) of build (changed on each build of portable executable).\n */\n readonly unpackDirName?: string | boolean\n\n /**\n * The image to show while the portable executable is extracting. This image must be a bitmap (`.bmp`) image.\n */\n readonly splashImage?: string | null\n}\n\n/**\n * Web Installer options.\n */\nexport interface NsisWebOptions extends NsisOptions {\n /**\n * The application package download URL. Optional — by default computed using publish configuration.\n *\n * URL like `https://example.com/download/latest` allows web installer to be version independent (installer will download latest application package).\n * Please note — it is [full URL](https://github.com/electron-userland/electron-builder/issues/1810#issuecomment-317650878).\n *\n * Custom `X-Arch` http header is set to `32` or `64`.\n */\n readonly appPackageUrl?: string | null\n\n /**\n * The [artifact file name template](/configuration/configuration#artifact-file-name-template). Defaults to `${productName} Web Setup ${version}.${ext}`.\n */\n readonly artifactName?: string | null\n}\n"]}
|
|
@@ -11,3 +11,4 @@ export declare class StageDir {
|
|
|
11
11
|
export declare function createStageDir(target: Target, packager: PlatformPackager<any>, arch: Arch): Promise<StageDir>;
|
|
12
12
|
export declare function createStageDirPath(target: Target, packager: PlatformPackager<any>, arch: Arch): Promise<string>;
|
|
13
13
|
export declare function getWindowsInstallationDirName(appInfo: AppInfo, isTryToUseProductName: boolean): string;
|
|
14
|
+
export declare function getWindowsInstallationAppPackageName(appName: string): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getWindowsInstallationDirName = exports.createStageDirPath = exports.createStageDir = exports.StageDir = void 0;
|
|
3
|
+
exports.getWindowsInstallationAppPackageName = exports.getWindowsInstallationDirName = exports.createStageDirPath = exports.createStageDir = exports.StageDir = void 0;
|
|
4
4
|
const path = require("path");
|
|
5
5
|
const builder_util_1 = require("builder-util");
|
|
6
6
|
const fs = require("fs/promises");
|
|
@@ -39,4 +39,9 @@ function getWindowsInstallationDirName(appInfo, isTryToUseProductName) {
|
|
|
39
39
|
return isTryToUseProductName && /^[-_+0-9a-zA-Z .]+$/.test(appInfo.productFilename) ? appInfo.productFilename : appInfo.sanitizedName;
|
|
40
40
|
}
|
|
41
41
|
exports.getWindowsInstallationDirName = getWindowsInstallationDirName;
|
|
42
|
+
// https://github.com/electron-userland/electron-builder/issues/6747
|
|
43
|
+
function getWindowsInstallationAppPackageName(appName) {
|
|
44
|
+
return appName.replace(/\//g, "\\");
|
|
45
|
+
}
|
|
46
|
+
exports.getWindowsInstallationAppPackageName = getWindowsInstallationAppPackageName;
|
|
42
47
|
//# sourceMappingURL=targetUtil.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"targetUtil.js","sourceRoot":"","sources":["../../src/targets/targetUtil.ts"],"names":[],"mappings":";;;AAAA,6BAA4B;AAE5B,+CAA0C;AAE1C,kCAAiC;AAEjC,MAAa,QAAQ;IACnB,YAAqB,GAAW;QAAX,QAAG,GAAH,GAAG,CAAQ;IAAG,CAAC;IAEpC,WAAW,CAAC,IAAY;QACtB,OAAO,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,GAAG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AAa,CAAA;AACvI,CAAC;AAFD,sEAEC","sourcesContent":["import * as path from \"path\"\nimport { Target, AppInfo } from \"../\"\nimport { Arch, debug } from \"builder-util\"\nimport { PlatformPackager } from \"../platformPackager\"\nimport * as fs from \"fs/promises\"\n\nexport class StageDir {\n constructor(readonly dir: string) {}\n\n getTempFile(name: string) {\n return this.dir + path.sep + name\n }\n\n cleanup() {\n if (!debug.enabled || process.env.ELECTRON_BUILDER_REMOVE_STAGE_EVEN_IF_DEBUG === \"true\") {\n return fs.rm(this.dir, { recursive: true, force: true })\n }\n return Promise.resolve()\n }\n\n toString() {\n return this.dir\n }\n}\n\nexport async function createStageDir(target: Target, packager: PlatformPackager<any>, arch: Arch): Promise<StageDir> {\n return new StageDir(await createStageDirPath(target, packager, arch))\n}\n\nexport async function createStageDirPath(target: Target, packager: PlatformPackager<any>, arch: Arch): Promise<string> {\n const tempDir = packager.info.stageDirPathCustomizer(target, packager, arch)\n await fs.rm(tempDir, { recursive: true, force: true })\n await fs.mkdir(tempDir, { recursive: true })\n return tempDir\n}\n\n// https://github.com/electron-userland/electron-builder/issues/3100\n// https://github.com/electron-userland/electron-builder/commit/2539cfba20dc639128e75c5b786651b652bb4b78\nexport function getWindowsInstallationDirName(appInfo: AppInfo, isTryToUseProductName: boolean): string {\n return isTryToUseProductName && /^[-_+0-9a-zA-Z .]+$/.test(appInfo.productFilename) ? appInfo.productFilename : appInfo.sanitizedName\n}\n"]}
|
|
1
|
+
{"version":3,"file":"targetUtil.js","sourceRoot":"","sources":["../../src/targets/targetUtil.ts"],"names":[],"mappings":";;;AAAA,6BAA4B;AAE5B,+CAA0C;AAE1C,kCAAiC;AAEjC,MAAa,QAAQ;IACnB,YAAqB,GAAW;QAAX,QAAG,GAAH,GAAG,CAAQ;IAAG,CAAC;IAEpC,WAAW,CAAC,IAAY;QACtB,OAAO,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,GAAG,IAAI,CAAA;IACnC,CAAC;IAED,OAAO;QACL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,oEAAoE;AACpE,SAAgB,oCAAoC,CAAC,OAAe;IAClE,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;AACrC,CAAC;AAFD,oFAEC","sourcesContent":["import * as path from \"path\"\nimport { Target, AppInfo } from \"../\"\nimport { Arch, debug } from \"builder-util\"\nimport { PlatformPackager } from \"../platformPackager\"\nimport * as fs from \"fs/promises\"\n\nexport class StageDir {\n constructor(readonly dir: string) {}\n\n getTempFile(name: string) {\n return this.dir + path.sep + name\n }\n\n cleanup() {\n if (!debug.enabled || process.env.ELECTRON_BUILDER_REMOVE_STAGE_EVEN_IF_DEBUG === \"true\") {\n return fs.rm(this.dir, { recursive: true, force: true })\n }\n return Promise.resolve()\n }\n\n toString() {\n return this.dir\n }\n}\n\nexport async function createStageDir(target: Target, packager: PlatformPackager<any>, arch: Arch): Promise<StageDir> {\n return new StageDir(await createStageDirPath(target, packager, arch))\n}\n\nexport async function createStageDirPath(target: Target, packager: PlatformPackager<any>, arch: Arch): Promise<string> {\n const tempDir = packager.info.stageDirPathCustomizer(target, packager, arch)\n await fs.rm(tempDir, { recursive: true, force: true })\n await fs.mkdir(tempDir, { recursive: true })\n return tempDir\n}\n\n// https://github.com/electron-userland/electron-builder/issues/3100\n// https://github.com/electron-userland/electron-builder/commit/2539cfba20dc639128e75c5b786651b652bb4b78\nexport function getWindowsInstallationDirName(appInfo: AppInfo, isTryToUseProductName: boolean): string {\n return isTryToUseProductName && /^[-_+0-9a-zA-Z .]+$/.test(appInfo.productFilename) ? appInfo.productFilename : appInfo.sanitizedName\n}\n\n// https://github.com/electron-userland/electron-builder/issues/6747\nexport function getWindowsInstallationAppPackageName(appName: string): string {\n return appName.replace(/\\//g, \"\\\\\")\n}\n"]}
|
package/out/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PACKAGE_VERSION = "23.0.
|
|
1
|
+
export declare const PACKAGE_VERSION = "23.0.6";
|
package/out/version.js
CHANGED
package/out/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG,QAAQ,CAAA","sourcesContent":["export const PACKAGE_VERSION = \"23.0.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG,QAAQ,CAAA","sourcesContent":["export const PACKAGE_VERSION = \"23.0.6\"\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "app-builder-lib",
|
|
3
3
|
"description": "electron-builder lib",
|
|
4
|
-
"version": "23.0.
|
|
4
|
+
"version": "23.0.6",
|
|
5
5
|
"main": "out/index.js",
|
|
6
6
|
"files": [
|
|
7
7
|
"out",
|
|
@@ -49,17 +49,17 @@
|
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"7zip-bin": "~5.1.1",
|
|
51
51
|
"@develar/schema-utils": "~2.6.5",
|
|
52
|
-
"@electron/universal": "1.2.
|
|
52
|
+
"@electron/universal": "1.2.1",
|
|
53
53
|
"@malept/flatpak-bundler": "^0.4.0",
|
|
54
54
|
"async-exit-hook": "^2.0.1",
|
|
55
55
|
"bluebird-lst": "^1.0.9",
|
|
56
|
-
"builder-util": "23.0.
|
|
57
|
-
"builder-util-runtime": "9.0.
|
|
56
|
+
"builder-util": "23.0.6",
|
|
57
|
+
"builder-util-runtime": "9.0.1",
|
|
58
58
|
"chromium-pickle-js": "^0.2.0",
|
|
59
59
|
"debug": "^4.3.2",
|
|
60
60
|
"ejs": "^3.1.6",
|
|
61
61
|
"electron-osx-sign": "^0.6.0",
|
|
62
|
-
"electron-publish": "23.0.
|
|
62
|
+
"electron-publish": "23.0.6",
|
|
63
63
|
"form-data": "^4.0.0",
|
|
64
64
|
"fs-extra": "^10.0.0",
|
|
65
65
|
"hosted-git-info": "^4.0.2",
|
|
@@ -101,8 +101,8 @@
|
|
|
101
101
|
"@types/is-ci": "3.0.0",
|
|
102
102
|
"@types/js-yaml": "4.0.3",
|
|
103
103
|
"@types/semver": "7.3.8",
|
|
104
|
-
"dmg-builder": "23.0.
|
|
105
|
-
"electron-builder-squirrel-windows": "23.0.
|
|
104
|
+
"dmg-builder": "23.0.6",
|
|
105
|
+
"electron-builder-squirrel-windows": "23.0.6"
|
|
106
106
|
},
|
|
107
107
|
"//": "electron-builder-squirrel-windows and dmg-builder added as dev dep for tests (as otherwise `require` doesn't work using Yarn 2)",
|
|
108
108
|
"typings": "./out/index.d.ts"
|
package/scheme.json
CHANGED
|
@@ -419,6 +419,13 @@
|
|
|
419
419
|
"string"
|
|
420
420
|
]
|
|
421
421
|
},
|
|
422
|
+
"debugLogging": {
|
|
423
|
+
"description": "Whether or not to enable NSIS logging for debugging.\nNote: Requires a debug-enabled NSIS build.\nelectron-builder's included `makensis` does not natively support debug-enabled NSIS installers currently, you must supply your own via `customNsisBinary?: CustomNsisBinary`\nIn your custom nsis scripts, you can leverage this functionality via `LogSet` and `LogText`",
|
|
424
|
+
"type": [
|
|
425
|
+
"null",
|
|
426
|
+
"boolean"
|
|
427
|
+
]
|
|
428
|
+
},
|
|
422
429
|
"url": {
|
|
423
430
|
"default": "https://github.com/electron-userland/electron-builder-binaries/releases/download",
|
|
424
431
|
"type": [
|
|
@@ -3646,14 +3653,8 @@
|
|
|
3646
3653
|
{
|
|
3647
3654
|
"type": "null"
|
|
3648
3655
|
}
|
|
3649
|
-
]
|
|
3650
|
-
|
|
3651
|
-
"debugLogging": {
|
|
3652
|
-
"description": "Whether or not to enable NSIS logging for debugging.\nNote: Requires a debug-enabled NSIS build.\nelectron-builder's included `makensis` only supports building debug-enabled NSIS installers on Windows currently\nhttps://github.com/electron-userland/electron-builder/issues/5119#issuecomment-811353612",
|
|
3653
|
-
"type": [
|
|
3654
|
-
"null",
|
|
3655
|
-
"boolean"
|
|
3656
|
-
]
|
|
3656
|
+
],
|
|
3657
|
+
"description": "Allows you to provide your own `makensis`, such as one with support for debug logging via LogSet and LogText. (Logging also requires option `debugLogging = true`)"
|
|
3657
3658
|
},
|
|
3658
3659
|
"deleteAppDataOnUninstall": {
|
|
3659
3660
|
"default": false,
|
|
@@ -3970,14 +3971,8 @@
|
|
|
3970
3971
|
{
|
|
3971
3972
|
"type": "null"
|
|
3972
3973
|
}
|
|
3973
|
-
]
|
|
3974
|
-
|
|
3975
|
-
"debugLogging": {
|
|
3976
|
-
"description": "Whether or not to enable NSIS logging for debugging.\nNote: Requires a debug-enabled NSIS build.\nelectron-builder's included `makensis` only supports building debug-enabled NSIS installers on Windows currently\nhttps://github.com/electron-userland/electron-builder/issues/5119#issuecomment-811353612",
|
|
3977
|
-
"type": [
|
|
3978
|
-
"null",
|
|
3979
|
-
"boolean"
|
|
3980
|
-
]
|
|
3974
|
+
],
|
|
3975
|
+
"description": "Allows you to provide your own `makensis`, such as one with support for debug logging via LogSet and LogText. (Logging also requires option `debugLogging = true`)"
|
|
3981
3976
|
},
|
|
3982
3977
|
"deleteAppDataOnUninstall": {
|
|
3983
3978
|
"default": false,
|
|
@@ -4245,7 +4240,22 @@
|
|
|
4245
4240
|
"type": "object"
|
|
4246
4241
|
},
|
|
4247
4242
|
"OutgoingHttpHeaders": {
|
|
4248
|
-
"additionalProperties":
|
|
4243
|
+
"additionalProperties": {
|
|
4244
|
+
"anyOf": [
|
|
4245
|
+
{
|
|
4246
|
+
"items": {
|
|
4247
|
+
"type": "string"
|
|
4248
|
+
},
|
|
4249
|
+
"type": "array"
|
|
4250
|
+
},
|
|
4251
|
+
{
|
|
4252
|
+
"type": [
|
|
4253
|
+
"string",
|
|
4254
|
+
"number"
|
|
4255
|
+
]
|
|
4256
|
+
}
|
|
4257
|
+
]
|
|
4258
|
+
},
|
|
4249
4259
|
"type": "object"
|
|
4250
4260
|
},
|
|
4251
4261
|
"PkgBackgroundOptions": {
|
|
@@ -4410,7 +4420,7 @@
|
|
|
4410
4420
|
"type": "null"
|
|
4411
4421
|
}
|
|
4412
4422
|
],
|
|
4413
|
-
"description": "Identifies applications that must be closed before the package is installed
|
|
4423
|
+
"description": "Identifies applications that must be closed before the package is installed.\n\nCorresponds to [must-close](https://developer.apple.com/library/archive/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html#//apple_ref/doc/uid/TP40005370-CH100-SW77)."
|
|
4414
4424
|
},
|
|
4415
4425
|
"overwriteAction": {
|
|
4416
4426
|
"anyOf": [
|
|
@@ -4560,14 +4570,8 @@
|
|
|
4560
4570
|
{
|
|
4561
4571
|
"type": "null"
|
|
4562
4572
|
}
|
|
4563
|
-
]
|
|
4564
|
-
|
|
4565
|
-
"debugLogging": {
|
|
4566
|
-
"description": "Whether or not to enable NSIS logging for debugging.\nNote: Requires a debug-enabled NSIS build.\nelectron-builder's included `makensis` only supports building debug-enabled NSIS installers on Windows currently\nhttps://github.com/electron-userland/electron-builder/issues/5119#issuecomment-811353612",
|
|
4567
|
-
"type": [
|
|
4568
|
-
"null",
|
|
4569
|
-
"boolean"
|
|
4570
|
-
]
|
|
4573
|
+
],
|
|
4574
|
+
"description": "Allows you to provide your own `makensis`, such as one with support for debug logging via LogSet and LogText. (Logging also requires option `debugLogging = true`)"
|
|
4571
4575
|
},
|
|
4572
4576
|
"guid": {
|
|
4573
4577
|
"description": "See [GUID vs Application Name](../configuration/nsis#guid-vs-application-name).",
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
# NSIS
|
|
2
2
|
|
|
3
|
+
⚠️ **It is developer documentation.** If your are looking for usage guide, see [user documentation](https://electron.build/configuration/nsis).
|
|
4
|
+
|
|
5
|
+
NSIS stands for Nullsoft Scriptable Install System. electron-builder utilizes a [customized version](https://github.com/electron-userland/electron-builder-binaries) of it and uses `NsisMultiUser` plugin to handle installation for single user or all users on the computer.
|
|
6
|
+
|
|
7
|
+
## Some links
|
|
3
8
|
http://www.mathiaswestin.net/2012/09/how-to-make-per-user-installation-with.html
|
|
4
9
|
|
|
5
10
|
https://msdn.microsoft.com/en-us/library/windows/desktop/dd378457(v=vs.85).aspx#FOLDERID_UserProgramFiles
|
|
@@ -12,7 +17,13 @@ http://stackoverflow.com/questions/2565215/checking-if-the-application-is-runnin
|
|
|
12
17
|
|
|
13
18
|
One-click installer: http://forums.winamp.com/showthread.php?t=300479
|
|
14
19
|
|
|
15
|
-
|
|
20
|
+
## Localization (l10n)
|
|
21
|
+
|
|
22
|
+
For translators, the strings to be displayed are included in [`assistedMessages.yml`](https://github.com/electron-userland/electron-builder/blob/master/packages/app-builder-lib/templates/nsis/assistedMessages.yml) and [`messages.yml`]https://github.com/electron-userland/electron-builder/blob/master/packages/app-builder-lib/templates/nsis/messages.yml).
|
|
23
|
+
|
|
24
|
+
As for other strings in NSIS, head to [electron-userland/electron-builder-binaries](https://github.com/electron-userland/electron-builder-binaries) or the upstream repository on [Sorceforge](https://sourceforge.net/p/nsis/code/HEAD/tree/).
|
|
25
|
+
|
|
26
|
+
## GUID
|
|
16
27
|
See [docs](https://electron.build/configuration/nsis).
|
|
17
28
|
|
|
18
29
|
We use UUID v5 to generate sha-1 name-based UUID.
|
|
@@ -21,7 +32,7 @@ http://stackoverflow.com/questions/3029994/convert-uri-to-guid
|
|
|
21
32
|
https://alexandrebrisebois.wordpress.com/2013/11/14/create-predictable-guids-for-your-windows-azure-table-storage-entities/
|
|
22
33
|
https://github.com/Squirrel/Squirrel.Windows/pull/658
|
|
23
34
|
|
|
24
|
-
|
|
35
|
+
## Compression
|
|
25
36
|
|
|
26
37
|
NSIS LZMA compression is slower and worse compared to external `7za` compression. Slower because `7za` is multi-threaded, worse because LZMA codec implementation is outdated and BCJ2 filter is not enabled.
|
|
27
38
|
Difference for test app — 4 MB (before: 36.3 after: 32.8).
|
|
@@ -31,7 +31,7 @@ chooseUninstallationOptions:
|
|
|
31
31
|
hu_HU: Eltávolítási opciók kiválasztása
|
|
32
32
|
pt_BR: Escolha uma opção de desinstalação
|
|
33
33
|
zh_CN: 卸载选项
|
|
34
|
-
zh_TW:
|
|
34
|
+
zh_TW: 解除安裝選項
|
|
35
35
|
tr_TR: Kaldırma Ayarlarını Seçin
|
|
36
36
|
sv_SE: Välj alternativ för avinstallation
|
|
37
37
|
pl_PL: Wybierz opcje dezinstalacji
|
|
@@ -75,7 +75,7 @@ whoShouldThisApplicationBeInstalledFor:
|
|
|
75
75
|
hu_HU: Kinek legyen ez az alkalmazás telepítve?
|
|
76
76
|
pt_BR: Para quem esta aplicação deve ser instalada?
|
|
77
77
|
zh_CN: 为哪位用户安装该应用?
|
|
78
|
-
zh_TW:
|
|
78
|
+
zh_TW: 需要為哪位使用者安裝該應用程式?
|
|
79
79
|
tr_TR: Bu Uygulama Kimler için Kurulsun?
|
|
80
80
|
sv_SE: Vem ska den här applikationen installeras för?
|
|
81
81
|
pl_PL: Dla kogo zainstalować tę aplikację?
|
|
@@ -97,7 +97,7 @@ selectUserMode:
|
|
|
97
97
|
hu_HU: Válaszd ki, hogy a szoftver elérhető legyen-e minden felhasználó számára, vagy csak neked
|
|
98
98
|
pt_BR: Por favor, selecione se este software deve estar disponível apenas para você ou para todos usuários
|
|
99
99
|
zh_CN: 请选择为当前用户还是所有用户安装该软件
|
|
100
|
-
zh_TW:
|
|
100
|
+
zh_TW: 請選擇為目前使用者還是所有使用者安裝該軟體
|
|
101
101
|
tr_TR: Lütfen bu yazılımı tüm kullanıcılar için mi yoksa sadece kendiniz mi kullanmak istediğinizi seçin
|
|
102
102
|
sv_SE: Välj om du vill göra den här mjukvaran tillgänglig för alla användare eller bara för dig
|
|
103
103
|
pl_PL: Wybierz, czy to oprogramowanie ma być dostępne dla wszystkich użytkowników, czy tylko dla Ciebie
|
|
@@ -119,7 +119,7 @@ whichInstallationRemove:
|
|
|
119
119
|
hu_HU: Ez a szoftver számítógépenként (minden felhasználó) és felhasználónként is telepítve van.\nMelyik telepítést szeretnéd eltávolítani?
|
|
120
120
|
pt_BR: Este software é instalado por máquina (todos os usuários) e por usuário. Qual instalação você deseja remover?
|
|
121
121
|
zh_CN: 该软件已为所有用户和当前用户安装.\n您希望移除哪个安装?
|
|
122
|
-
zh_TW:
|
|
122
|
+
zh_TW: 該軟體已為所有使用者和目前使用者安裝。\n您希望移除哪一個?
|
|
123
123
|
tr_TR: Bu yazılım hem makine başına (tüm kullanıcılar) hem de kullanıcı başına yüklenir.\nKaldırmak istediğiniz kurulum?
|
|
124
124
|
sv_SE: Den här mjukvaran är installerad både ”per dator” (alla användare) och ”per användare”.\nVilken installation vill du ta bort?
|
|
125
125
|
pl_PL: To oprogramowanie zostało zainstalowane zarówno dla urządzenia (wszyscy użytkownicy), jak i dla użytkownika.\nKtórą instalację chcesz usunąć?
|
|
@@ -141,7 +141,7 @@ freshInstallForAll:
|
|
|
141
141
|
hu_HU: Új telepítés minden felhasználó számára. (Az adminisztrátor hitelesítő adataira lesz szükség.)
|
|
142
142
|
pt_BR: Instalação limpa para todos os usuários. (irá solicitar credenciais de administrador)
|
|
143
143
|
zh_CN: 为所有用户进行全新安装. (需要管理员资格)
|
|
144
|
-
zh_TW:
|
|
144
|
+
zh_TW: 為所有使用者進行全新安裝 (需要系統管理員權限)
|
|
145
145
|
tr_TR: Tüm kullanıcılar için yeni yükleme. (yönetici kimlik bilgilerini soracaktır)
|
|
146
146
|
sv_SE: Ny installation för alla användare. (kommer att begära adminbehörighet)
|
|
147
147
|
pl_PL: Nowa instalacja dla wszystkich użytkowników (potrzebne będą dane administratora).
|
|
@@ -162,7 +162,7 @@ freshInstallForCurrent:
|
|
|
162
162
|
hu_HU: Új telepítés csak a jelenlegi felhasználó számára.
|
|
163
163
|
pt_BR: Instalação limpa somente para o usuário atual.
|
|
164
164
|
zh_CN: 仅为当前用户进行全新安装.
|
|
165
|
-
zh_TW:
|
|
165
|
+
zh_TW: 僅為目前使用者進行全新安裝
|
|
166
166
|
tr_TR: Sadece mevcut kullanıcı için yeni yükleme.
|
|
167
167
|
sv_SE: Ny installation endast för den aktuella användaren.
|
|
168
168
|
pl_PL: Nowa instalacja wyłącznie dla obecnego użytkownika.
|
|
@@ -206,7 +206,7 @@ forAll:
|
|
|
206
206
|
hu_HU: Bárki számára, aki ezt a számítógépet használja (minden felhasználó)
|
|
207
207
|
pt_BR: Para todos que usam esta máquina (&todos os usuários)
|
|
208
208
|
zh_CN: 为使用这台电脑的任何人安装 (所有用户)
|
|
209
|
-
zh_TW: 為使用這台電腦的任何人安裝 (
|
|
209
|
+
zh_TW: 為使用這台電腦的任何人安裝 (所有使用者)
|
|
210
210
|
tr_TR: Bu bilgisayarı kullanan herkes (ve tüm kullanıcılar)
|
|
211
211
|
sv_SE: Alla som använder den här datorn (alla användare)
|
|
212
212
|
pl_PL: Każdy korzystający z tego komputera (wszyscy użytkownicy)
|
|
@@ -228,7 +228,7 @@ loginWithAdminAccount:
|
|
|
228
228
|
hu_HU: A folytatáshoz adminisztrátori jogokkal rendelkező fiókkal kell bejelentkezned...
|
|
229
229
|
pt_BR: Você precisa realizar o login com uma conta que é membro do grupo de administração para continuar...
|
|
230
230
|
zh_CN: 您需要用属于管理员群组的用户账户登录来继续...
|
|
231
|
-
zh_TW:
|
|
231
|
+
zh_TW: 您需要以具系統管理員身分的帳號登入才能繼續...
|
|
232
232
|
tr_TR: Devam etmek için yönetici grubunun üyesi olan bir hesapla giriş yapmanız gerekiyor..
|
|
233
233
|
sv_SE: Du måste logga in med ett konto som är medlem i admingruppen för att fortsätta...
|
|
234
234
|
pl_PL: Musisz się zalogować za pomocą konta będącego członkiem grupy administratora, by kontynuować...
|
|
@@ -249,7 +249,7 @@ perUserInstallExists:
|
|
|
249
249
|
hu_HU: Már van egy felhasználónkénti telepítés.
|
|
250
250
|
pt_BR: Já existe uma instalação por usuário.
|
|
251
251
|
zh_CN: 已经存在一个安装到当前用户的安装.
|
|
252
|
-
zh_TW:
|
|
252
|
+
zh_TW: 已經為目前使用者安裝過該軟體
|
|
253
253
|
tr_TR: Her kullanıcı için zaten bir kurulum var.
|
|
254
254
|
sv_SE: Det finns redan en ”per användare”-installation.
|
|
255
255
|
pl_PL: Instalacja dla użytkownika już istnieje.
|
|
@@ -270,7 +270,7 @@ perUserInstall:
|
|
|
270
270
|
hu_HU: Van felhasználónkénti telepítés.
|
|
271
271
|
pt_BR: Existe uma instalação por usuário.
|
|
272
272
|
zh_CN: 存在一个安装到当前用户的安装.
|
|
273
|
-
zh_TW:
|
|
273
|
+
zh_TW: 存在一個對目前使用者的安裝
|
|
274
274
|
tr_TR: Kullanıcı başına bir kurulum var.
|
|
275
275
|
sv_SE: Det finns en ”per användare”-installation.
|
|
276
276
|
pl_PL: Instalacja dla użytkownika istnieje.
|
|
@@ -291,7 +291,7 @@ perMachineInstallExists:
|
|
|
291
291
|
hu_HU: Már van egy számítógépenkénti telepítés.
|
|
292
292
|
pt_BR: Já existe uma instalação por máquina.
|
|
293
293
|
zh_CN: 已经存在一个安装到所有用户的安装.
|
|
294
|
-
zh_TW:
|
|
294
|
+
zh_TW: 已經為所有使用者安裝過該軟體
|
|
295
295
|
tr_TR: Zaten makine başına bir kurulum var.
|
|
296
296
|
sv_SE: Det finns redan en ”per dator”-installation.
|
|
297
297
|
pl_PL: Instalacja dla urządzenia już istnieje.
|
|
@@ -312,7 +312,7 @@ perMachineInstall:
|
|
|
312
312
|
hu_HU: Van számítógépenkénti telepítés.
|
|
313
313
|
pt_BR: Existe uma instalação por máquina.
|
|
314
314
|
zh_CN: 存在一个安装到所有用户的安装.
|
|
315
|
-
zh_TW:
|
|
315
|
+
zh_TW: 存在一個對所有使用者的安裝
|
|
316
316
|
tr_TR: Makine başına bir yükleme var.
|
|
317
317
|
sv_SE: Det finns en ”per dator”-installation.
|
|
318
318
|
pl_PL: Instalacja dla urządzenia istnieje.
|
|
@@ -333,7 +333,7 @@ reinstallUpgrade:
|
|
|
333
333
|
hu_HU: Újratelepít/frissít.
|
|
334
334
|
pt_BR: Irá reinstalar/atualizar.
|
|
335
335
|
zh_CN: 即将重新安装/升级.
|
|
336
|
-
zh_TW:
|
|
336
|
+
zh_TW: 即將重新安裝/升級
|
|
337
337
|
tr_TR: Yeniden yükleme/yükseltme
|
|
338
338
|
sv_SE: Kommer att ominstallera/uppgradera.
|
|
339
339
|
pl_PL: Nastąpi ponowna instalacja/aktualizacja.
|
|
@@ -354,7 +354,7 @@ uninstall:
|
|
|
354
354
|
hu_HU: Eltávolít.
|
|
355
355
|
pt_BR: Irá desinstalar.
|
|
356
356
|
zh_CN: 即将卸载.
|
|
357
|
-
zh_TW:
|
|
357
|
+
zh_TW: 即將解除安裝
|
|
358
358
|
tr_TR: Kaldıralacak.
|
|
359
359
|
sv_SE: Kommer att avinstallera.
|
|
360
360
|
pl_PL: Nastąpi dezinstalacja.
|
|
@@ -102,14 +102,15 @@ Name "${PRODUCT_NAME}"
|
|
|
102
102
|
|
|
103
103
|
!define LogSet "!insertmacro LogSetMacro"
|
|
104
104
|
!macro LogSetMacro SETTING
|
|
105
|
-
!ifdef
|
|
105
|
+
!ifdef ENABLE_LOGGING_ELECTRON_BUILDER
|
|
106
|
+
SetOutPath $INSTDIR
|
|
106
107
|
LogSet ${SETTING}
|
|
107
108
|
!endif
|
|
108
109
|
!macroend
|
|
109
110
|
|
|
110
|
-
!define LogText "!insertmacro
|
|
111
|
-
!macro
|
|
112
|
-
!ifdef
|
|
111
|
+
!define LogText "!insertmacro LogTextMacroEB"
|
|
112
|
+
!macro LogTextMacroEB INPUT_TEXT
|
|
113
|
+
!ifdef ENABLE_LOGGING_ELECTRON_BUILDER
|
|
113
114
|
LogText ${INPUT_TEXT}
|
|
114
115
|
!endif
|
|
115
116
|
!macroend
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
${nsProcess::FindProcess} "${_FILE}" ${_ERR}
|
|
41
41
|
!else
|
|
42
42
|
# find process owned by current user
|
|
43
|
-
nsExec::Exec `cmd /c tasklist /FI "USERNAME eq %USERNAME%" /FI "IMAGENAME eq ${_FILE}" | find "${_FILE}"`
|
|
43
|
+
nsExec::Exec `cmd /c tasklist /FI "USERNAME eq %USERNAME%" /FI "IMAGENAME eq ${_FILE}" | %SYSTEMROOT%\System32\find.exe "${_FILE}"`
|
|
44
44
|
Pop ${_ERR}
|
|
45
45
|
!endif
|
|
46
46
|
!macroend
|
|
@@ -14,7 +14,7 @@ win7Required:
|
|
|
14
14
|
pl: Windows 7 lub nowszy jest wymagany
|
|
15
15
|
pt_BR: Requer Windows 7 ou superior
|
|
16
16
|
zh_CN: 需要 Windows 7 或以上系统
|
|
17
|
-
zh_TW: 需要 Windows 7
|
|
17
|
+
zh_TW: 需要 Windows 7 或更新的系統
|
|
18
18
|
tr_TR: Windows 7 ve üstü gereklidir
|
|
19
19
|
sv_SE: Windows 7 eller högre krävs
|
|
20
20
|
no: Windows 7 og over er nødvendig
|
|
@@ -36,7 +36,7 @@ x64WinRequired:
|
|
|
36
36
|
pl: Windows 64-bitowy jest wymagany
|
|
37
37
|
pt_BR: Requer Windows 64 bits
|
|
38
38
|
zh_CN: 需要 64 位 Windows 系统
|
|
39
|
-
zh_TW: 需要 64
|
|
39
|
+
zh_TW: 需要 64 位元 Windows 系統
|
|
40
40
|
tr_TR: 64 bit Windows gerekli
|
|
41
41
|
sv_SE: 64-bitars Windows krävs
|
|
42
42
|
no: 64-biters Windows er nødvendig
|
|
@@ -58,7 +58,7 @@ appRunning:
|
|
|
58
58
|
pl: "${PRODUCT_NAME} jest otwarty. Aby zamknąć kliknij na OK."
|
|
59
59
|
pt_BR: "${PRODUCT_NAME} está em execução.\nClique em OK para fechar."
|
|
60
60
|
zh_CN: "${PRODUCT_NAME} 正在运行.\n点击“确定”关闭."
|
|
61
|
-
zh_TW: "${PRODUCT_NAME}
|
|
61
|
+
zh_TW: "${PRODUCT_NAME} 正在執行。\n按一下「確定」來關閉。"
|
|
62
62
|
tr_TR: "${PRODUCT_NAME} çalışıyor.\nKapatmak için Tamam'ı tıklayın."
|
|
63
63
|
sv_SE: "${PRODUCT_NAME} körs. \nKlicka på OK för att stänga det."
|
|
64
64
|
no: "${PRODUCT_NAME} kjører. \nKlikk OK for å lukke det."
|
|
@@ -97,7 +97,7 @@ appCannotBeClosed:
|
|
|
97
97
|
sv: "${PRODUCT_NAME} går inte att stängas. \nVänligen stäng det manuellt och klicka på Försök igen för att fortsätta."
|
|
98
98
|
tr: "${PRODUCT_NAME} kapatılamaz. \nLütfen elle kapatın ve devam etmek için Tekrar'a tıklayın"
|
|
99
99
|
zh_CN: "${PRODUCT_NAME} 无法关闭。\n请手动关闭它,然后单击重试以继续。"
|
|
100
|
-
zh_TW: "${PRODUCT_NAME} 無法關閉。\n
|
|
100
|
+
zh_TW: "${PRODUCT_NAME} 無法關閉。\n請手動關閉它,然後按一下重試以繼續。"
|
|
101
101
|
installing:
|
|
102
102
|
en: Installing, please wait...
|
|
103
103
|
de: Installation läuft, bitte warten...
|
|
@@ -134,7 +134,7 @@ areYouSureToUninstall:
|
|
|
134
134
|
pl: Czy na pewno chcesz odinstalować ${PRODUCT_NAME}?
|
|
135
135
|
pt_BR: Tem certeza que deseja desinstalar ${PRODUCT_NAME}?
|
|
136
136
|
zh_CN: 确定卸载 ${PRODUCT_NAME} 吗?
|
|
137
|
-
zh_TW:
|
|
137
|
+
zh_TW: 確定解除安裝 ${PRODUCT_NAME} 嗎?
|
|
138
138
|
tr_TR: ${PRODUCT_NAME} kaldırmak istediğinize Eminmisiniz?
|
|
139
139
|
sv_SE: Är du säker på att du vill avinstallera ${PRODUCT_NAME}?
|
|
140
140
|
no: Er du sikker på at du vil avinstallere ${PRODUCT_NAME}?
|