app-builder-lib 23.5.1 → 23.6.0
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 +1 -1
- package/out/options/pkgOptions.js.map +1 -1
- package/out/targets/nsis/Defines.d.ts +1 -0
- package/out/targets/nsis/Defines.js.map +1 -1
- package/out/targets/nsis/NsisTarget.js +3 -0
- package/out/targets/nsis/NsisTarget.js.map +1 -1
- package/out/targets/nsis/nsisOptions.d.ts +5 -0
- package/out/targets/nsis/nsisOptions.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 +5 -5
- package/scheme.json +11 -1
- package/templates/nsis/assistedInstaller.nsh +5 -3
|
@@ -52,7 +52,7 @@ export interface PkgOptions extends TargetSpecificOptions {
|
|
|
52
52
|
*/
|
|
53
53
|
readonly identity?: string | null;
|
|
54
54
|
/**
|
|
55
|
-
* The path to EULA license file. Defaults to `license.txt` or `eula.txt` (or uppercase variants). In addition to `txt
|
|
55
|
+
* 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).
|
|
56
56
|
*/
|
|
57
57
|
readonly license?: string | null;
|
|
58
58
|
/**
|
|
@@ -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
|
|
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"]}
|
|
@@ -55,6 +55,7 @@ export declare type Defines = {
|
|
|
55
55
|
INSTALL_MODE_PER_ALL_USERS?: null;
|
|
56
56
|
INSTALL_MODE_PER_ALL_USERS_REQUIRED?: null;
|
|
57
57
|
allowToChangeInstallationDirectory?: null;
|
|
58
|
+
removeDefaultUninstallWelcomePage?: null;
|
|
58
59
|
MENU_FILENAME?: string;
|
|
59
60
|
SHORTCUT_NAME?: string;
|
|
60
61
|
DELETE_APP_DATA_ON_UNINSTALL?: null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Defines.js","sourceRoot":"","sources":["../../../src/targets/nsis/Defines.ts"],"names":[],"mappings":"","sourcesContent":["import { PortableOptions } from \"./nsisOptions\"\nimport { PathLike } from \"fs\"\n/**\n * Parameters declared as environment variables in NSIS scripts.\n * The documentation vaguely explains \"All other electron-builder specific flags (e.g. ONE_CLICK) are still defined.\"\n * Parameters with null values in TypeScript can be treated as Boolean values using \"!Ifdef\" in NSIS Script.\n */\nexport type Defines = {\n APP_ID: string\n APP_GUID: unknown\n UNINSTALL_APP_KEY: unknown\n PRODUCT_NAME: string\n PRODUCT_FILENAME: string\n APP_FILENAME: string\n APP_DESCRIPTION: string\n VERSION: string\n\n PROJECT_DIR: string\n BUILD_RESOURCES_DIR: string\n\n APP_PACKAGE_NAME: string\n\n ENABLE_LOGGING_ELECTRON_BUILDER?: null\n UNINSTALL_REGISTRY_KEY_2?: string\n\n MUI_ICON?: unknown\n MUI_UNICON?: unknown\n\n APP_DIR_64?: string\n APP_DIR_ARM64?: string\n APP_DIR_32?: string\n\n APP_BUILD_DIR?: string\n\n APP_64?: string\n APP_ARM64?: string\n APP_32?: string\n\n APP_64_NAME?: string\n APP_ARM64_NAME?: string\n APP_32_NAME?: string\n\n APP_64_HASH?: string\n APP_ARM64_HASH?: string\n APP_32_HASH?: string\n\n REQUEST_EXECUTION_LEVEL?: PortableOptions[\"requestExecutionLevel\"]\n\n UNPACK_DIR_NAME?: string | false\n\n SPLASH_IMAGE?: unknown\n\n ESTIMATED_SIZE?: number\n\n COMPRESS?: \"auto\"\n\n BUILD_UNINSTALLER?: null\n UNINSTALLER_OUT_FILE?: PathLike\n\n ONE_CLICK?: null\n RUN_AFTER_FINISH?: null\n HEADER_ICO?: string\n HIDE_RUN_AFTER_FINISH?: null\n\n MUI_HEADERIMAGE?: null\n MUI_HEADERIMAGE_RIGHT?: null\n MUI_HEADERIMAGE_BITMAP?: string\n\n MUI_WELCOMEFINISHPAGE_BITMAP?: string\n MUI_UNWELCOMEFINISHPAGE_BITMAP?: string\n\n MULTIUSER_INSTALLMODE_ALLOW_ELEVATION?: null\n\n INSTALL_MODE_PER_ALL_USERS?: null\n INSTALL_MODE_PER_ALL_USERS_REQUIRED?: null\n\n allowToChangeInstallationDirectory?: null\n\n MENU_FILENAME?: string\n\n SHORTCUT_NAME?: string\n\n DELETE_APP_DATA_ON_UNINSTALL?: null\n\n UNINSTALLER_ICON?: string\n UNINSTALL_DISPLAY_NAME?: string\n\n RECREATE_DESKTOP_SHORTCUT?: null\n\n DO_NOT_CREATE_DESKTOP_SHORTCUT?: null\n\n DO_NOT_CREATE_START_MENU_SHORTCUT?: null\n\n DISPLAY_LANG_SELECTOR?: null\n\n COMPANY_NAME?: string\n\n APP_PRODUCT_FILENAME?: string\n\n APP_PACKAGE_STORE_FILE?: string\n\n APP_INSTALLER_STORE_FILE?: string\n\n ZIP_COMPRESSION?: null\n\n COMPRESSION_METHOD?: \"zip\" | \"7z\"\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Defines.js","sourceRoot":"","sources":["../../../src/targets/nsis/Defines.ts"],"names":[],"mappings":"","sourcesContent":["import { PortableOptions } from \"./nsisOptions\"\nimport { PathLike } from \"fs\"\n/**\n * Parameters declared as environment variables in NSIS scripts.\n * The documentation vaguely explains \"All other electron-builder specific flags (e.g. ONE_CLICK) are still defined.\"\n * Parameters with null values in TypeScript can be treated as Boolean values using \"!Ifdef\" in NSIS Script.\n */\nexport type Defines = {\n APP_ID: string\n APP_GUID: unknown\n UNINSTALL_APP_KEY: unknown\n PRODUCT_NAME: string\n PRODUCT_FILENAME: string\n APP_FILENAME: string\n APP_DESCRIPTION: string\n VERSION: string\n\n PROJECT_DIR: string\n BUILD_RESOURCES_DIR: string\n\n APP_PACKAGE_NAME: string\n\n ENABLE_LOGGING_ELECTRON_BUILDER?: null\n UNINSTALL_REGISTRY_KEY_2?: string\n\n MUI_ICON?: unknown\n MUI_UNICON?: unknown\n\n APP_DIR_64?: string\n APP_DIR_ARM64?: string\n APP_DIR_32?: string\n\n APP_BUILD_DIR?: string\n\n APP_64?: string\n APP_ARM64?: string\n APP_32?: string\n\n APP_64_NAME?: string\n APP_ARM64_NAME?: string\n APP_32_NAME?: string\n\n APP_64_HASH?: string\n APP_ARM64_HASH?: string\n APP_32_HASH?: string\n\n REQUEST_EXECUTION_LEVEL?: PortableOptions[\"requestExecutionLevel\"]\n\n UNPACK_DIR_NAME?: string | false\n\n SPLASH_IMAGE?: unknown\n\n ESTIMATED_SIZE?: number\n\n COMPRESS?: \"auto\"\n\n BUILD_UNINSTALLER?: null\n UNINSTALLER_OUT_FILE?: PathLike\n\n ONE_CLICK?: null\n RUN_AFTER_FINISH?: null\n HEADER_ICO?: string\n HIDE_RUN_AFTER_FINISH?: null\n\n MUI_HEADERIMAGE?: null\n MUI_HEADERIMAGE_RIGHT?: null\n MUI_HEADERIMAGE_BITMAP?: string\n\n MUI_WELCOMEFINISHPAGE_BITMAP?: string\n MUI_UNWELCOMEFINISHPAGE_BITMAP?: string\n\n MULTIUSER_INSTALLMODE_ALLOW_ELEVATION?: null\n\n INSTALL_MODE_PER_ALL_USERS?: null\n INSTALL_MODE_PER_ALL_USERS_REQUIRED?: null\n\n allowToChangeInstallationDirectory?: null\n\n removeDefaultUninstallWelcomePage?: null\n\n MENU_FILENAME?: string\n\n SHORTCUT_NAME?: string\n\n DELETE_APP_DATA_ON_UNINSTALL?: null\n\n UNINSTALLER_ICON?: string\n UNINSTALL_DISPLAY_NAME?: string\n\n RECREATE_DESKTOP_SHORTCUT?: null\n\n DO_NOT_CREATE_DESKTOP_SHORTCUT?: null\n\n DO_NOT_CREATE_START_MENU_SHORTCUT?: null\n\n DISPLAY_LANG_SELECTOR?: null\n\n COMPANY_NAME?: string\n\n APP_PRODUCT_FILENAME?: string\n\n APP_PACKAGE_STORE_FILE?: string\n\n APP_INSTALLER_STORE_FILE?: string\n\n ZIP_COMPRESSION?: null\n\n COMPRESSION_METHOD?: \"zip\" | \"7z\"\n}\n"]}
|
|
@@ -416,6 +416,9 @@ class NsisTarget extends core_1.Target {
|
|
|
416
416
|
}
|
|
417
417
|
defines.allowToChangeInstallationDirectory = null;
|
|
418
418
|
}
|
|
419
|
+
if (options.removeDefaultUninstallWelcomePage) {
|
|
420
|
+
defines.removeDefaultUninstallWelcomePage = null;
|
|
421
|
+
}
|
|
419
422
|
const commonOptions = CommonWindowsInstallerConfiguration_1.getEffectiveOptions(options, packager);
|
|
420
423
|
if (commonOptions.menuCategory != null) {
|
|
421
424
|
defines.MENU_FILENAME = commonOptions.menuCategory;
|
|
@@ -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,8CAAmG;AAGnG,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,GAAG,EAAE,CAAC,2BAAa,CAAC,gBAAgB,EAAE,OAAO,EAAE,0FAA0F,CAAC,CAAA;AAE1K,MAAM,4BAA4B,GAAG,KAAK,CAAA;AAE1C,MAAa,UAAW,SAAQ,aAAM;IAMpC,YAAqB,QAAqB,EAAW,MAAc,EAAE,UAAkB,EAAqB,aAA+B;QACzI,KAAK,CAAC,UAAU,CAAC,CAAA;QADE,aAAQ,GAAR,QAAQ,CAAa;QAAW,WAAM,GAAN,MAAM,CAAQ;QAAyC,kBAAa,GAAb,aAAa,CAAkB;QAH3I,eAAe;QACN,UAAK,GAAsB,IAAI,GAAG,EAAE,CAAA;QAK3C,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAA;QAE7B,IAAI,CAAC,OAAO;YACV,UAAU,KAAK,UAAU;gBACvB,CAAC,CAAC,MAAM,CAAC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AAO;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 { Commands } from \"./Commands\"\nimport { Defines } from \"./Defines\"\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(): boolean {\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(): boolean {\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\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: Defines = {\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: Commands = {\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 // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n const defineNameKey = `${defineKey}_NAME` as \"APP_64_NAME\" | \"APP_ARM64_NAME\" | \"APP_32_NAME\"\n defines[defineNameKey] = path.basename(file)\n // nsis expect a hexadecimal string\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n const defineHashKey = `${defineKey}_HASH` as \"APP_64_HASH\" | \"APP_ARM64_HASH\" | \"APP_32_HASH\"\n defines[defineHashKey] = 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 = { ...defines }\n const commandsUninstaller = { ...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 || options.packElevateHelper)) {\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(): string {\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(): boolean {\n return this.options.unicode !== false\n }\n\n get isWebInstaller(): boolean {\n return false\n }\n\n private async computeScriptAndSignUninstaller(defines: Defines, commands: Commands, installerPath: string, sharedHeader: string, archs: Map<Arch, string>): Promise<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: Defines): 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: Defines): void {\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: Defines, commands: Commands, script: string): Promise<void> {\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 as keyof Defines]\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 as keyof Commands]\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(): Promise<string> {\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>): Promise<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): Promise<void> {\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): Promise<void> {\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,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skManager, 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 { Commands } from \"./Commands\"\nimport { Defines } from \"./Defines\"\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(): boolean {\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(): boolean {\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\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: Defines = {\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: Commands = {\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 // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n const defineNameKey = `${defineKey}_NAME` as \"APP_64_NAME\" | \"APP_ARM64_NAME\" | \"APP_32_NAME\"\n defines[defineNameKey] = path.basename(file)\n // nsis expect a hexadecimal string\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n const defineHashKey = `${defineKey}_HASH` as \"APP_64_HASH\" | \"APP_ARM64_HASH\" | \"APP_32_HASH\"\n defines[defineHashKey] = 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 = { ...defines }\n const commandsUninstaller = { ...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 || options.packElevateHelper)) {\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(): string {\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(): boolean {\n return this.options.unicode !== false\n }\n\n get isWebInstaller(): boolean {\n return false\n }\n\n private async computeScriptAndSignUninstaller(defines: Defines, commands: Commands, installerPath: string, sharedHeader: string, archs: Map<Arch, string>): Promise<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: Defines): 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 if (options.removeDefaultUninstallWelcomePage) {\n defines.removeDefaultUninstallWelcomePage = 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: Defines): void {\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: Defines, commands: Commands, script: string): Promise<void> {\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 as keyof Defines]\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 as keyof Commands]\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(): Promise<string> {\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>): Promise<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): Promise<void> {\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): Promise<void> {\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"]}
|
|
@@ -73,6 +73,11 @@ export interface NsisOptions extends CommonNsisOptions, CommonWindowsInstallerCo
|
|
|
73
73
|
* @default false
|
|
74
74
|
*/
|
|
75
75
|
readonly allowToChangeInstallationDirectory?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* *assisted installer only.* remove the default uninstall welcome page.
|
|
78
|
+
* @default false
|
|
79
|
+
*/
|
|
80
|
+
readonly removeDefaultUninstallWelcomePage?: boolean;
|
|
76
81
|
/**
|
|
77
82
|
* The path to installer icon, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory.
|
|
78
83
|
* Defaults to `build/installerIcon.ico` or application icon.
|
|
@@ -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 * @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"]}
|
|
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 * *assisted installer only.* remove the default uninstall welcome page.\n * @default false\n */\n readonly removeDefaultUninstallWelcomePage?: 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"]}
|
package/out/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PACKAGE_VERSION = "23.
|
|
1
|
+
export declare const PACKAGE_VERSION = "23.6.0";
|
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.
|
|
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.6.0\"\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.
|
|
4
|
+
"version": "23.6.0",
|
|
5
5
|
"main": "out/index.js",
|
|
6
6
|
"files": [
|
|
7
7
|
"out",
|
|
@@ -53,13 +53,13 @@
|
|
|
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.
|
|
56
|
+
"builder-util": "23.6.0",
|
|
57
57
|
"builder-util-runtime": "9.1.1",
|
|
58
58
|
"chromium-pickle-js": "^0.2.0",
|
|
59
59
|
"debug": "^4.3.4",
|
|
60
60
|
"ejs": "^3.1.7",
|
|
61
61
|
"electron-osx-sign": "^0.6.0",
|
|
62
|
-
"electron-publish": "23.
|
|
62
|
+
"electron-publish": "23.6.0",
|
|
63
63
|
"form-data": "^4.0.0",
|
|
64
64
|
"fs-extra": "^10.1.0",
|
|
65
65
|
"hosted-git-info": "^4.1.0",
|
|
@@ -103,8 +103,8 @@
|
|
|
103
103
|
"@types/js-yaml": "4.0.3",
|
|
104
104
|
"@types/semver": "7.3.8",
|
|
105
105
|
"@types/tar": "^6.1.1",
|
|
106
|
-
"dmg-builder": "23.
|
|
107
|
-
"electron-builder-squirrel-windows": "23.
|
|
106
|
+
"dmg-builder": "23.6.0",
|
|
107
|
+
"electron-builder-squirrel-windows": "23.6.0"
|
|
108
108
|
},
|
|
109
109
|
"//": "electron-builder-squirrel-windows and dmg-builder added as dev dep for tests (as otherwise `require` doesn't work using Yarn 2)",
|
|
110
110
|
"typings": "./out/index.d.ts"
|
package/scheme.json
CHANGED
|
@@ -3914,6 +3914,11 @@
|
|
|
3914
3914
|
}
|
|
3915
3915
|
]
|
|
3916
3916
|
},
|
|
3917
|
+
"removeDefaultUninstallWelcomePage": {
|
|
3918
|
+
"default": false,
|
|
3919
|
+
"description": "*assisted installer only.* remove the default uninstall welcome page.",
|
|
3920
|
+
"type": "boolean"
|
|
3921
|
+
},
|
|
3917
3922
|
"runAfterFinish": {
|
|
3918
3923
|
"default": true,
|
|
3919
3924
|
"description": "Whether to run the installed application after finish. For assisted installer corresponding checkbox will be removed.",
|
|
@@ -4232,6 +4237,11 @@
|
|
|
4232
4237
|
}
|
|
4233
4238
|
]
|
|
4234
4239
|
},
|
|
4240
|
+
"removeDefaultUninstallWelcomePage": {
|
|
4241
|
+
"default": false,
|
|
4242
|
+
"description": "*assisted installer only.* remove the default uninstall welcome page.",
|
|
4243
|
+
"type": "boolean"
|
|
4244
|
+
},
|
|
4235
4245
|
"runAfterFinish": {
|
|
4236
4246
|
"default": true,
|
|
4237
4247
|
"description": "Whether to run the installed application after finish. For assisted installer corresponding checkbox will be removed.",
|
|
@@ -4450,7 +4460,7 @@
|
|
|
4450
4460
|
]
|
|
4451
4461
|
},
|
|
4452
4462
|
"license": {
|
|
4453
|
-
"description": "The path to EULA license file. Defaults to `license.txt` or `eula.txt` (or uppercase variants). In addition to `txt
|
|
4463
|
+
"description": "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).",
|
|
4454
4464
|
"type": [
|
|
4455
4465
|
"null",
|
|
4456
4466
|
"string"
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
${endIf}
|
|
40
40
|
FunctionEnd
|
|
41
41
|
!endif
|
|
42
|
-
|
|
42
|
+
|
|
43
43
|
# after change installation directory and before install start, you can show custom page here.
|
|
44
44
|
!ifmacrodef customPageAfterChangeDir
|
|
45
45
|
!insertmacro customPageAfterChangeDir
|
|
46
46
|
!endif
|
|
47
|
-
|
|
47
|
+
|
|
48
48
|
!insertmacro MUI_PAGE_INSTFILES
|
|
49
49
|
!ifmacrodef customFinishPage
|
|
50
50
|
!insertmacro customFinishPage
|
|
@@ -65,7 +65,9 @@
|
|
|
65
65
|
!insertmacro MUI_PAGE_FINISH
|
|
66
66
|
!endif
|
|
67
67
|
!else
|
|
68
|
-
!
|
|
68
|
+
!ifndef removeDefaultUninstallWelcomePage
|
|
69
|
+
!insertmacro MUI_UNPAGE_WELCOME
|
|
70
|
+
!endif
|
|
69
71
|
!ifndef INSTALL_MODE_PER_ALL_USERS
|
|
70
72
|
!insertmacro PAGE_INSTALL_MODE
|
|
71
73
|
!endif
|