app-builder-lib 26.0.0-alpha.8 → 26.0.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/asar/asarUtil.js +14 -3
- package/out/asar/asarUtil.js.map +1 -1
- package/out/asar/integrity.d.ts +4 -1
- package/out/asar/integrity.js +37 -8
- package/out/asar/integrity.js.map +1 -1
- package/out/codeSign/windowsCodeSign.d.ts +0 -2
- package/out/codeSign/windowsCodeSign.js +1 -33
- package/out/codeSign/windowsCodeSign.js.map +1 -1
- package/out/codeSign/windowsSignAzureManager.js +2 -3
- package/out/codeSign/windowsSignAzureManager.js.map +1 -1
- package/out/codeSign/windowsSignToolManager.js +13 -17
- package/out/codeSign/windowsSignToolManager.js.map +1 -1
- package/out/index.d.ts +1 -1
- package/out/index.js.map +1 -1
- package/out/macPackager.d.ts +3 -3
- package/out/macPackager.js +24 -13
- package/out/macPackager.js.map +1 -1
- package/out/options/AppXOptions.d.ts +26 -0
- package/out/options/AppXOptions.js.map +1 -1
- package/out/options/FileAssociation.d.ts +1 -1
- package/out/options/FileAssociation.js.map +1 -1
- package/out/options/macOptions.d.ts +3 -10
- package/out/options/macOptions.js.map +1 -1
- package/out/options/winOptions.d.ts +2 -62
- package/out/options/winOptions.js.map +1 -1
- package/out/platformPackager.d.ts +15 -1
- package/out/platformPackager.js +27 -8
- package/out/platformPackager.js.map +1 -1
- package/out/targets/AppxTarget.js +6 -1
- package/out/targets/AppxTarget.js.map +1 -1
- package/out/targets/FpmTarget.js +1 -1
- package/out/targets/FpmTarget.js.map +1 -1
- package/out/targets/nsis/NsisTarget.d.ts +4 -3
- package/out/targets/nsis/NsisTarget.js +23 -10
- package/out/targets/nsis/NsisTarget.js.map +1 -1
- package/out/targets/nsis/WebInstallerTarget.d.ts +3 -1
- package/out/targets/nsis/WebInstallerTarget.js +8 -2
- package/out/targets/nsis/WebInstallerTarget.js.map +1 -1
- package/out/targets/nsis/nsisOptions.d.ts +6 -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/out/vm/PwshVm.d.ts +6 -0
- package/out/vm/PwshVm.js +25 -0
- package/out/vm/PwshVm.js.map +1 -0
- package/out/vm/vm.d.ts +4 -0
- package/out/vm/vm.js +42 -3
- package/out/vm/vm.js.map +1 -1
- package/out/winPackager.js +4 -5
- package/out/winPackager.js.map +1 -1
- package/package.json +9 -9
- package/scheme.json +21 -142
|
@@ -176,6 +176,12 @@ export interface NsisOptions extends CommonNsisOptions, CommonWindowsInstallerCo
|
|
|
176
176
|
* @default [".avi", ".mov", ".m4v", ".mp4", ".m4p", ".qt", ".mkv", ".webm", ".vmdk"]
|
|
177
177
|
*/
|
|
178
178
|
readonly preCompressedFileExtensions?: Array<string> | string | null;
|
|
179
|
+
/**
|
|
180
|
+
* Disable building an universal installer of the archs specified in the target configuration
|
|
181
|
+
* *Not supported for nsis-web*
|
|
182
|
+
* @default true
|
|
183
|
+
*/
|
|
184
|
+
readonly buildUniversalInstaller?: boolean;
|
|
179
185
|
}
|
|
180
186
|
/**
|
|
181
187
|
* Portable options.
|
|
@@ -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\nexport interface 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](./nsis.md#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 * Whether to set per-machine or per-user installation as default selection on the install mode installer page.\n *\n * @default false\n */\n readonly selectPerMachineByDefault?: 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](./contents.md#extraresources) 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](./contents.md#extraresources) 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](./contents.md#extraresources) 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](./contents.md#extraresources) 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](./contents.md#extraresources) 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](./contents.md#extraresources) 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.md#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.md#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\nexport interface 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](./nsis.md#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 * Whether to set per-machine or per-user installation as default selection on the install mode installer page.\n *\n * @default false\n */\n readonly selectPerMachineByDefault?: 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](./contents.md#extraresources) 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](./contents.md#extraresources) 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](./contents.md#extraresources) 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](./contents.md#extraresources) 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](./contents.md#extraresources) 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](./contents.md#extraresources) 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.md#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 * Disable building an universal installer of the archs specified in the target configuration\n * *Not supported for nsis-web*\n * @default true\n */\n readonly buildUniversalInstaller?: boolean\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.md#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 = "26.0.0
|
|
1
|
+
export declare const PACKAGE_VERSION = "26.0.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,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG,QAAQ,CAAA","sourcesContent":["export const PACKAGE_VERSION = \"26.0.0\"\n"]}
|
package/out/vm/PwshVm.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PwshVmManager = void 0;
|
|
4
|
+
const lazy_val_1 = require("lazy-val");
|
|
5
|
+
const vm_1 = require("./vm");
|
|
6
|
+
const builder_util_1 = require("builder-util");
|
|
7
|
+
class PwshVmManager extends vm_1.VmManager {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this.powershellCommand = new lazy_val_1.Lazy(async () => {
|
|
11
|
+
builder_util_1.log.info(null, "checking for `pwsh` for powershell");
|
|
12
|
+
if (await vm_1.isPwshAvailable.value) {
|
|
13
|
+
return "pwsh";
|
|
14
|
+
}
|
|
15
|
+
const errorMessage = `unable to find \`pwsh\`, please install per instructions linked in logs`;
|
|
16
|
+
builder_util_1.log.error({
|
|
17
|
+
mac: "https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-macos",
|
|
18
|
+
linux: "https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-linux",
|
|
19
|
+
}, errorMessage);
|
|
20
|
+
throw new Error(errorMessage);
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.PwshVmManager = PwshVmManager;
|
|
25
|
+
//# sourceMappingURL=PwshVm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PwshVm.js","sourceRoot":"","sources":["../../src/vm/PwshVm.ts"],"names":[],"mappings":";;;AAAA,uCAA+B;AAC/B,6BAAiD;AACjD,+CAAkC;AAElC,MAAa,aAAc,SAAQ,cAAS;IAC1C;QACE,KAAK,EAAE,CAAA;QAGA,sBAAiB,GAAG,IAAI,eAAI,CAAS,KAAK,IAAI,EAAE;YACvD,kBAAG,CAAC,IAAI,CAAC,IAAI,EAAE,oCAAoC,CAAC,CAAA;YACpD,IAAI,MAAM,oBAAe,CAAC,KAAK,EAAE,CAAC;gBAChC,OAAO,MAAM,CAAA;YACf,CAAC;YACD,MAAM,YAAY,GAAG,yEAAyE,CAAA;YAC9F,kBAAG,CAAC,KAAK,CACP;gBACE,GAAG,EAAE,+FAA+F;gBACpG,KAAK,EAAE,+FAA+F;aACvG,EACD,YAAY,CACb,CAAA;YACD,MAAM,IAAI,KAAK,CAAC,YAAY,CAAC,CAAA;QAC/B,CAAC,CAAC,CAAA;IAhBF,CAAC;CAiBF;AApBD,sCAoBC","sourcesContent":["import { Lazy } from \"lazy-val\"\nimport { isPwshAvailable, VmManager } from \"./vm\"\nimport { log } from \"builder-util\"\n\nexport class PwshVmManager extends VmManager {\n constructor() {\n super()\n }\n\n readonly powershellCommand = new Lazy<string>(async () => {\n log.info(null, \"checking for `pwsh` for powershell\")\n if (await isPwshAvailable.value) {\n return \"pwsh\"\n }\n const errorMessage = `unable to find \\`pwsh\\`, please install per instructions linked in logs`\n log.error(\n {\n mac: \"https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-macos\",\n linux: \"https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-linux\",\n },\n errorMessage\n )\n throw new Error(errorMessage)\n })\n}\n"]}
|
package/out/vm/vm.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { DebugLogger, ExtraSpawnOptions } from "builder-util";
|
|
2
2
|
import { ExecFileOptions, SpawnOptions } from "child_process";
|
|
3
|
+
import { Lazy } from "lazy-val";
|
|
3
4
|
export declare class VmManager {
|
|
4
5
|
get pathSep(): string;
|
|
5
6
|
exec(file: string, args: Array<string>, options?: ExecFileOptions, isLogOutIfDebug?: boolean): Promise<string>;
|
|
6
7
|
spawn(file: string, args: Array<string>, options?: SpawnOptions, extraOptions?: ExtraSpawnOptions): Promise<any>;
|
|
7
8
|
toVmFile(file: string): string;
|
|
9
|
+
readonly powershellCommand: Lazy<string>;
|
|
8
10
|
}
|
|
9
11
|
export declare function getWindowsVm(debugLogger: DebugLogger): Promise<VmManager>;
|
|
12
|
+
export declare const isPwshAvailable: Lazy<boolean>;
|
|
13
|
+
export declare const isCommandAvailable: (command: string, args: string[]) => Promise<boolean>;
|
package/out/vm/vm.js
CHANGED
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VmManager = void 0;
|
|
3
|
+
exports.isCommandAvailable = exports.isPwshAvailable = exports.VmManager = void 0;
|
|
4
4
|
exports.getWindowsVm = getWindowsVm;
|
|
5
5
|
const builder_util_1 = require("builder-util");
|
|
6
|
+
const lazy_val_1 = require("lazy-val");
|
|
6
7
|
const path = require("path");
|
|
7
8
|
class VmManager {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.powershellCommand = new lazy_val_1.Lazy(() => {
|
|
11
|
+
return this.exec("powershell.exe", ["-NoProfile", "-NonInteractive", "-Command", `Get-Command pwsh.exe`])
|
|
12
|
+
.then(() => {
|
|
13
|
+
builder_util_1.log.info(null, "identified pwsh.exe");
|
|
14
|
+
return "pwsh.exe";
|
|
15
|
+
})
|
|
16
|
+
.catch(() => {
|
|
17
|
+
builder_util_1.log.info(null, "unable to find pwsh.exe, falling back to powershell.exe");
|
|
18
|
+
return "powershell.exe";
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
}
|
|
8
22
|
get pathSep() {
|
|
9
23
|
return path.sep;
|
|
10
24
|
}
|
|
@@ -21,11 +35,36 @@ class VmManager {
|
|
|
21
35
|
exports.VmManager = VmManager;
|
|
22
36
|
async function getWindowsVm(debugLogger) {
|
|
23
37
|
const parallelsVmModule = await Promise.resolve().then(() => require("./ParallelsVm"));
|
|
24
|
-
|
|
38
|
+
let vmList = [];
|
|
39
|
+
try {
|
|
40
|
+
vmList = (await parallelsVmModule.parseVmList(debugLogger)).filter(it => ["win-10", "win-11"].includes(it.os));
|
|
41
|
+
}
|
|
42
|
+
catch (_error) {
|
|
43
|
+
if ((await exports.isPwshAvailable.value) && (await isWineAvailable.value)) {
|
|
44
|
+
const vmModule = await Promise.resolve().then(() => require("./PwshVm"));
|
|
45
|
+
return new vmModule.PwshVmManager();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
25
48
|
if (vmList.length === 0) {
|
|
26
|
-
throw new builder_util_1.InvalidConfigurationError("Cannot find suitable Parallels Desktop virtual machine (Windows 10 is required)");
|
|
49
|
+
throw new builder_util_1.InvalidConfigurationError("Cannot find suitable Parallels Desktop virtual machine (Windows 10 is required) and cannot access `pwsh` and `wine` locally");
|
|
27
50
|
}
|
|
28
51
|
// prefer running or suspended vm
|
|
29
52
|
return new parallelsVmModule.ParallelsVmManager(vmList.find(it => it.state === "running") || vmList.find(it => it.state === "suspended") || vmList[0]);
|
|
30
53
|
}
|
|
54
|
+
const isWineAvailable = new lazy_val_1.Lazy(async () => {
|
|
55
|
+
return (0, exports.isCommandAvailable)("wine", ["--version"]);
|
|
56
|
+
});
|
|
57
|
+
exports.isPwshAvailable = new lazy_val_1.Lazy(async () => {
|
|
58
|
+
return (0, exports.isCommandAvailable)("pwsh", ["--version"]);
|
|
59
|
+
});
|
|
60
|
+
const isCommandAvailable = async (command, args) => {
|
|
61
|
+
try {
|
|
62
|
+
await (0, builder_util_1.exec)(command, args);
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
exports.isCommandAvailable = isCommandAvailable;
|
|
31
70
|
//# sourceMappingURL=vm.js.map
|
package/out/vm/vm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vm.js","sourceRoot":"","sources":["../../src/vm/vm.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"vm.js","sourceRoot":"","sources":["../../src/vm/vm.ts"],"names":[],"mappings":";;;AAmCA,oCAiBC;AApDD,+CAA0G;AAE1G,uCAA+B;AAC/B,6BAA4B;AAE5B,MAAa,SAAS;IAAtB;QAiBW,sBAAiB,GAAG,IAAI,eAAI,CAAC,GAAG,EAAE;YACzC,OAAO,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,YAAY,EAAE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O9B","sourcesContent":["import { DebugLogger, exec, ExtraSpawnOptions, InvalidConfigurationError, log, spawn } from \"builder-util\"\nimport { ExecFileOptions, SpawnOptions } from \"child_process\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { ParallelsVm } from \"./ParallelsVm\"\nexport class VmManager {\n get pathSep(): string {\n return path.sep\n }\n\n exec(file: string, args: Array<string>, options?: ExecFileOptions, isLogOutIfDebug = true): Promise<string> {\n return exec(file, args, options, isLogOutIfDebug)\n }\n\n spawn(file: string, args: Array<string>, options?: SpawnOptions, extraOptions?: ExtraSpawnOptions): Promise<any> {\n return spawn(file, args, options, extraOptions)\n }\n\n toVmFile(file: string): string {\n return file\n }\n\n readonly powershellCommand = new Lazy(() => {\n return this.exec(\"powershell.exe\", [\"-NoProfile\", \"-NonInteractive\", \"-Command\", `Get-Command pwsh.exe`])\n .then(() => {\n log.info(null, \"identified pwsh.exe\")\n return \"pwsh.exe\"\n })\n .catch(() => {\n log.info(null, \"unable to find pwsh.exe, falling back to powershell.exe\")\n return \"powershell.exe\"\n })\n })\n}\n\nexport async function getWindowsVm(debugLogger: DebugLogger): Promise<VmManager> {\n const parallelsVmModule = await import(\"./ParallelsVm\")\n let vmList: ParallelsVm[] = []\n try {\n vmList = (await parallelsVmModule.parseVmList(debugLogger)).filter(it => [\"win-10\", \"win-11\"].includes(it.os))\n } catch (_error) {\n if ((await isPwshAvailable.value) && (await isWineAvailable.value)) {\n const vmModule = await import(\"./PwshVm\")\n return new vmModule.PwshVmManager()\n }\n }\n if (vmList.length === 0) {\n throw new InvalidConfigurationError(\"Cannot find suitable Parallels Desktop virtual machine (Windows 10 is required) and cannot access `pwsh` and `wine` locally\")\n }\n\n // prefer running or suspended vm\n return new parallelsVmModule.ParallelsVmManager(vmList.find(it => it.state === \"running\") || vmList.find(it => it.state === \"suspended\") || vmList[0])\n}\n\nconst isWineAvailable = new Lazy(async () => {\n return isCommandAvailable(\"wine\", [\"--version\"])\n})\n\nexport const isPwshAvailable = new Lazy(async () => {\n return isCommandAvailable(\"pwsh\", [\"--version\"])\n})\n\nexport const isCommandAvailable = async (command: string, args: string[]) => {\n try {\n await exec(command, args)\n return true\n } catch {\n return false\n }\n}\n"]}
|
package/out/winPackager.js
CHANGED
|
@@ -99,7 +99,7 @@ class WinPackager extends platformPackager_1.PlatformPackager {
|
|
|
99
99
|
}
|
|
100
100
|
doGetCscPassword() {
|
|
101
101
|
var _a;
|
|
102
|
-
return (0, platformPackager_1.chooseNotNull)((0, platformPackager_1.chooseNotNull)((
|
|
102
|
+
return (0, platformPackager_1.chooseNotNull)((0, platformPackager_1.chooseNotNull)((_a = this.platformSpecificBuildOptions.signtoolOptions) === null || _a === void 0 ? void 0 : _a.certificatePassword, process.env.WIN_CSC_KEY_PASSWORD), super.doGetCscPassword());
|
|
103
103
|
}
|
|
104
104
|
async sign(file) {
|
|
105
105
|
const signOptions = {
|
|
@@ -159,8 +159,8 @@ class WinPackager extends platformPackager_1.PlatformPackager {
|
|
|
159
159
|
hash.update(config.electronVersion || "no electronVersion");
|
|
160
160
|
hash.update(JSON.stringify(this.platformSpecificBuildOptions));
|
|
161
161
|
hash.update(JSON.stringify(args));
|
|
162
|
-
hash.update((
|
|
163
|
-
hash.update((
|
|
162
|
+
hash.update(((_a = this.platformSpecificBuildOptions.signtoolOptions) === null || _a === void 0 ? void 0 : _a.certificateSha1) || "no certificateSha1");
|
|
163
|
+
hash.update(((_b = this.platformSpecificBuildOptions.signtoolOptions) === null || _b === void 0 ? void 0 : _b.certificateSubjectName) || "no subjectName");
|
|
164
164
|
buildCacheManager = new cacheManager_1.BuildCacheManager(outDir, file, arch);
|
|
165
165
|
if (await buildCacheManager.copyIfValid(await (0, cacheManager_1.digest)(hash, files))) {
|
|
166
166
|
timer.end();
|
|
@@ -185,9 +185,8 @@ class WinPackager extends platformPackager_1.PlatformPackager {
|
|
|
185
185
|
}
|
|
186
186
|
shouldSignFile(file) {
|
|
187
187
|
var _a;
|
|
188
|
-
const shouldSignDll = this.platformSpecificBuildOptions.signDlls === true && file.endsWith(".dll");
|
|
189
188
|
const shouldSignExplicit = !!((_a = this.platformSpecificBuildOptions.signExts) === null || _a === void 0 ? void 0 : _a.some(ext => file.endsWith(ext)));
|
|
190
|
-
return
|
|
189
|
+
return shouldSignExplicit || file.endsWith(".exe");
|
|
191
190
|
}
|
|
192
191
|
createTransformerForExtraFiles(packContext) {
|
|
193
192
|
if (this.platformSpecificBuildOptions.signAndEditExecutable === false) {
|
package/out/winPackager.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"winPackager.js","sourceRoot":"","sources":["../src/winPackager.ts"],"names":[],"mappings":";;;AAAA,+CAAkI;AAClI,mCAAmC;AACnC,0CAAqC;AACrC,8BAA6B;AAC7B,uCAA+B;AAC/B,6BAA4B;AAC5B,gEAA4E;AAC5E,gFAA4E;AAC5E,8EAAkH;AAElH,iCAAqD;AAGrD,yDAAoE;AAIpE,0DAAsD;AACtD,sDAA6E;AAC7E,0EAAsE;AACtE,2DAA4D;AAC5D,sDAA+D;AAC/D,wCAAkD;AAClD,wCAAmC;AACnC,gCAAiD;AACjD,iCAAiC;AAGjC,MAAa,WAAY,SAAQ,mCAAsC;IAgBrE,IAAI,8BAA8B;QAChC,OAAO,IAAI,CAAC,4BAA4B,CAAC,yBAAyB,KAAK,KAAK,CAAA;IAC9E,CAAC;IAED,YAAY,IAAc;QACxB,KAAK,CAAC,IAAI,EAAE,eAAQ,CAAC,OAAO,CAAC,CAAA;QApB/B,cAAS,GAAG,IAAI,eAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAA;QAE/C,OAAE,GAAG,IAAI,eAAI,CAAY,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,cAAS,EAAE,CAAC,CAAC,CAAC,CAAC,IAAA,iBAA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,WAAW,EAAE,MAAM,CAAC,EAClC,IAAI,CAAC,4BAA4B,CAAC,uBAAuB,CAC1D,CAAA;YACH,CAAC;iBAAM,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;gBACrC,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAA;YACzD,CAAC;QACH,CAAC;QAED,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,IAAI,CAAA;QACb,CAAC;QAED,MAAM,YAAY,GAAG,CAAC,QAAkB,EAAE,EAAE;YAC1C,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,GAAG,QAAQ,CAAC,CAAA;YAC5D,OAAO,IAAA,mBAAI,EAAC,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAA;QACtF,CAAC,CAAA;QACD,MAAM,WAAW,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,YAAY,CAAC,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA;QACxH,KAAK,MAAM,IAAI,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;YACvC,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACvB,CAAC;QAED,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AA9PD,kCA8PC","sourcesContent":["import { Arch, CopyFileTransformer, executeAppBuilder, FileTransformer, InvalidConfigurationError, use, walk } from \"builder-util\"\nimport { createHash } from \"crypto\"\nimport { readdir } from \"fs/promises\"\nimport * as isCI from \"is-ci\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { signWindows, WindowsSignOptions } from \"./codeSign/windowsCodeSign\"\nimport { WindowsSignAzureManager } from \"./codeSign/windowsSignAzureManager\"\nimport { FileCodeSigningInfo, getSignVendorPath, WindowsSignToolManager } from \"./codeSign/windowsSignToolManager\"\nimport { AfterPackContext } from \"./configuration\"\nimport { DIR_TARGET, Platform, Target } from \"./core\"\nimport { RequestedExecutionLevel, WindowsConfiguration } from \"./options/winOptions\"\nimport { Packager } from \"./packager\"\nimport { chooseNotNull, PlatformPackager } from \"./platformPackager\"\nimport AppXTarget from \"./targets/AppxTarget\"\nimport MsiTarget from \"./targets/MsiTarget\"\nimport MsiWrappedTarget from \"./targets/MsiWrappedTarget\"\nimport { NsisTarget } from \"./targets/nsis/NsisTarget\"\nimport { AppPackageHelper, CopyElevateHelper } from \"./targets/nsis/nsisUtil\"\nimport { WebInstallerTarget } from \"./targets/nsis/WebInstallerTarget\"\nimport { createCommonTarget } from \"./targets/targetFactory\"\nimport { BuildCacheManager, digest } from \"./util/cacheManager\"\nimport { isBuildCacheEnabled } from \"./util/flags\"\nimport { time } from \"./util/timer\"\nimport { getWindowsVm, VmManager } from \"./vm/vm\"\nimport { execWine } from \"./wine\"\nimport { SignManager } from \"./codeSign/signManager\"\n\nexport class WinPackager extends PlatformPackager<WindowsConfiguration> {\n _iconPath = new Lazy(() => this.getOrConvertIcon(\"ico\"))\n\n readonly vm = new Lazy<VmManager>(() => (process.platform === \"win32\" ? Promise.resolve(new VmManager()) : getWindowsVm(this.debugLogger)))\n\n readonly signingManager = new Lazy(async () => {\n let manager: SignManager\n if (this.platformSpecificBuildOptions.azureSignOptions != null) {\n manager = new WindowsSignAzureManager(this)\n } else {\n manager = new WindowsSignToolManager(this)\n }\n await manager.initialize()\n return manager\n })\n\n get isForceCodeSigningVerification(): boolean {\n return this.platformSpecificBuildOptions.verifyUpdateCodeSignature !== false\n }\n\n constructor(info: Packager) {\n super(info, Platform.WINDOWS)\n }\n\n get defaultTarget(): Array<string> {\n return [\"nsis\"]\n }\n\n createTargets(targets: Array<string>, mapper: (name: string, factory: (outDir: string) => Target) => void): void {\n let copyElevateHelper: CopyElevateHelper | null\n const getCopyElevateHelper = () => {\n if (copyElevateHelper == null) {\n copyElevateHelper = new CopyElevateHelper()\n }\n return copyElevateHelper\n }\n\n let helper: AppPackageHelper | null\n const getHelper = () => {\n if (helper == null) {\n helper = new AppPackageHelper(getCopyElevateHelper())\n }\n return helper\n }\n\n for (const name of targets) {\n if (name === DIR_TARGET) {\n continue\n }\n\n if (name === \"nsis\" || name === \"portable\") {\n mapper(name, outDir => new NsisTarget(this, outDir, name, getHelper()))\n } else if (name === \"nsis-web\") {\n // package file format differs from nsis target\n mapper(name, outDir => new WebInstallerTarget(this, path.join(outDir, name), name, new AppPackageHelper(getCopyElevateHelper())))\n } else {\n const targetClass: typeof NsisTarget | typeof AppXTarget | typeof MsiTarget | typeof MsiWrappedTarget | null = (() => {\n switch (name) {\n case \"squirrel\":\n try {\n return require(\"electron-builder-squirrel-windows\").default\n } catch (e: any) {\n throw new InvalidConfigurationError(`Module electron-builder-squirrel-windows must be installed in addition to build Squirrel.Windows: ${e.stack || e}`)\n }\n\n case \"appx\":\n return require(\"./targets/AppxTarget\").default\n\n case \"msi\":\n return require(\"./targets/MsiTarget\").default\n\n case \"msiwrapped\":\n return require(\"./targets/MsiWrappedTarget\").default\n\n default:\n return null\n }\n })()\n\n mapper(name, outDir => (targetClass === null ? createCommonTarget(name, outDir, this) : new (targetClass as any)(this, outDir, name)))\n }\n }\n }\n\n getIconPath() {\n return this._iconPath.value\n }\n\n doGetCscPassword(): string | undefined | null {\n return chooseNotNull(\n chooseNotNull(\n chooseNotNull(this.platformSpecificBuildOptions.signtoolOptions?.certificatePassword, this.platformSpecificBuildOptions.certificatePassword),\n process.env.WIN_CSC_KEY_PASSWORD\n ),\n super.doGetCscPassword()\n )\n }\n\n async sign(file: string): Promise<boolean> {\n const signOptions: WindowsSignOptions = {\n path: file,\n options: this.platformSpecificBuildOptions,\n }\n\n const didSignSuccessfully = await signWindows(signOptions, this)\n if (!didSignSuccessfully && this.forceCodeSigning) {\n throw new InvalidConfigurationError(\n `App is not signed and \"forceCodeSigning\" is set to true, please ensure that code signing configuration is correct, please see https://electron.build/code-signing`\n )\n }\n return didSignSuccessfully\n }\n\n async signAndEditResources(file: string, arch: Arch, outDir: string, internalName?: string | null, requestedExecutionLevel?: RequestedExecutionLevel | null) {\n const appInfo = this.appInfo\n\n const files: Array<string> = []\n\n const args = [\n file,\n \"--set-version-string\",\n \"FileDescription\",\n appInfo.productName,\n \"--set-version-string\",\n \"ProductName\",\n appInfo.productName,\n \"--set-version-string\",\n \"LegalCopyright\",\n appInfo.copyright,\n \"--set-file-version\",\n appInfo.shortVersion || appInfo.buildVersion,\n \"--set-product-version\",\n appInfo.shortVersionWindows || appInfo.getVersionInWeirdWindowsForm(),\n ]\n\n if (internalName != null) {\n args.push(\"--set-version-string\", \"InternalName\", internalName, \"--set-version-string\", \"OriginalFilename\", \"\")\n }\n\n if (requestedExecutionLevel != null && requestedExecutionLevel !== \"asInvoker\") {\n args.push(\"--set-requested-execution-level\", requestedExecutionLevel)\n }\n\n use(appInfo.companyName, it => args.push(\"--set-version-string\", \"CompanyName\", it))\n use(this.platformSpecificBuildOptions.legalTrademarks, it => args.push(\"--set-version-string\", \"LegalTrademarks\", it))\n const iconPath = await this.getIconPath()\n use(iconPath, it => {\n files.push(it)\n args.push(\"--set-icon\", it)\n })\n\n const config = this.config\n const cscInfoForCacheDigest = !isBuildCacheEnabled() || isCI || config.electronDist != null ? null : await (await this.signingManager.value).cscInfo.value\n let buildCacheManager: BuildCacheManager | null = null\n // resources editing doesn't change executable for the same input and executed quickly - no need to complicate\n if (cscInfoForCacheDigest != null) {\n const cscFile = (cscInfoForCacheDigest as FileCodeSigningInfo).file\n if (cscFile != null) {\n files.push(cscFile)\n }\n\n const timer = time(\"executable cache\")\n const hash = createHash(\"sha512\")\n hash.update(config.electronVersion || \"no electronVersion\")\n hash.update(JSON.stringify(this.platformSpecificBuildOptions))\n hash.update(JSON.stringify(args))\n hash.update(chooseNotNull(this.platformSpecificBuildOptions.signtoolOptions?.certificateSha1, this.platformSpecificBuildOptions.certificateSha1) || \"no certificateSha1\")\n hash.update(\n chooseNotNull(this.platformSpecificBuildOptions.signtoolOptions?.certificateSubjectName, this.platformSpecificBuildOptions.certificateSubjectName) || \"no subjectName\"\n )\n\n buildCacheManager = new BuildCacheManager(outDir, file, arch)\n if (await buildCacheManager.copyIfValid(await digest(hash, files))) {\n timer.end()\n return\n }\n timer.end()\n }\n\n const timer = time(\"wine&sign\")\n // rcedit crashed of executed using wine, resourcehacker works\n if (process.platform === \"win32\" || process.platform === \"darwin\") {\n await executeAppBuilder([\"rcedit\", \"--args\", JSON.stringify(args)], undefined /* child-process */, {}, 3 /* retry three times */)\n } else if (this.info.framework.name === \"electron\") {\n const vendorPath = await getSignVendorPath()\n await execWine(path.join(vendorPath, \"rcedit-ia32.exe\"), path.join(vendorPath, \"rcedit-x64.exe\"), args)\n }\n\n await this.sign(file)\n timer.end()\n\n if (buildCacheManager != null) {\n await buildCacheManager.save()\n }\n }\n\n private shouldSignFile(file: string): boolean {\n const shouldSignDll = this.platformSpecificBuildOptions.signDlls === true && file.endsWith(\".dll\")\n const shouldSignExplicit = !!this.platformSpecificBuildOptions.signExts?.some(ext => file.endsWith(ext))\n return shouldSignDll || shouldSignExplicit || file.endsWith(\".exe\")\n }\n\n protected createTransformerForExtraFiles(packContext: AfterPackContext): FileTransformer | null {\n if (this.platformSpecificBuildOptions.signAndEditExecutable === false) {\n return null\n }\n\n return file => {\n if (this.shouldSignFile(file)) {\n const parentDir = path.dirname(file)\n if (parentDir !== packContext.appOutDir) {\n return new CopyFileTransformer(file => this.sign(file))\n }\n }\n return null\n }\n }\n\n protected async signApp(packContext: AfterPackContext, isAsar: boolean): Promise<boolean> {\n const exeFileName = `${this.appInfo.productFilename}.exe`\n if (this.platformSpecificBuildOptions.signAndEditExecutable === false) {\n return false\n }\n\n const files = await readdir(packContext.appOutDir)\n for (const file of files) {\n if (file === exeFileName) {\n await this.signAndEditResources(\n path.join(packContext.appOutDir, exeFileName),\n packContext.arch,\n packContext.outDir,\n path.basename(exeFileName, \".exe\"),\n this.platformSpecificBuildOptions.requestedExecutionLevel\n )\n } else if (this.shouldSignFile(file)) {\n await this.sign(path.join(packContext.appOutDir, file))\n }\n }\n\n if (!isAsar) {\n return true\n }\n\n const filesPromise = (filepath: string[]) => {\n const outDir = path.join(packContext.appOutDir, ...filepath)\n return walk(outDir, (file, stat) => stat.isDirectory() || this.shouldSignFile(file))\n }\n const filesToSign = await Promise.all([filesPromise([\"resources\", \"app.asar.unpacked\"]), filesPromise([\"swiftshader\"])])\n for (const file of filesToSign.flat(1)) {\n await this.sign(file)\n }\n\n return true\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"winPackager.js","sourceRoot":"","sources":["../src/winPackager.ts"],"names":[],"mappings":";;;AAAA,+CAAkI;AAClI,mCAAmC;AACnC,0CAAqC;AACrC,8BAA6B;AAC7B,uCAA+B;AAC/B,6BAA4B;AAC5B,gEAA4E;AAC5E,gFAA4E;AAC5E,8EAAkH;AAElH,iCAAqD;AAGrD,yDAAoE;AAIpE,0DAAsD;AACtD,sDAA6E;AAC7E,0EAAsE;AACtE,2DAA4D;AAC5D,sDAA+D;AAC/D,wCAAkD;AAClD,wCAAmC;AACnC,gCAAiD;AACjD,iCAAiC;AAGjC,MAAa,WAAY,SAAQ,mCAAsC;IAgBrE,IAAI,8BAA8B;QAChC,OAAO,IAAI,CAAC,4BAA4B,CAAC,yBAAyB,KAAK,KAAK,CAAA;IAC9E,CAAC;IAED,YAAY,IAAc;QACxB,KAAK,CAAC,IAAI,EAAE,eAAQ,CAAC,OAAO,CAAC,CAAA;QApB/B,cAAS,GAAG,IAAI,eAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAA;QAE/C,OAAE,GAAG,IA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E,CAAC;gBACrC,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAA;YACzD,CAAC;QACH,CAAC;QAED,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,IAAI,CAAA;QACb,CAAC;QAED,MAAM,YAAY,GAAG,CAAC,QAAkB,EAAE,EAAE;YAC1C,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,GAAG,QAAQ,CAAC,CAAA;YAC5D,OAAO,IAAA,mBAAI,EAAC,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAA;QACtF,CAAC,CAAA;QACD,MAAM,WAAW,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,YAAY,CAAC,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA;QACxH,KAAK,MAAM,IAAI,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;YACvC,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACvB,CAAC;QAED,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AArPD,kCAqPC","sourcesContent":["import { Arch, CopyFileTransformer, executeAppBuilder, FileTransformer, InvalidConfigurationError, use, walk } from \"builder-util\"\nimport { createHash } from \"crypto\"\nimport { readdir } from \"fs/promises\"\nimport * as isCI from \"is-ci\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { signWindows, WindowsSignOptions } from \"./codeSign/windowsCodeSign\"\nimport { WindowsSignAzureManager } from \"./codeSign/windowsSignAzureManager\"\nimport { FileCodeSigningInfo, getSignVendorPath, WindowsSignToolManager } from \"./codeSign/windowsSignToolManager\"\nimport { AfterPackContext } from \"./configuration\"\nimport { DIR_TARGET, Platform, Target } from \"./core\"\nimport { RequestedExecutionLevel, WindowsConfiguration } from \"./options/winOptions\"\nimport { Packager } from \"./packager\"\nimport { chooseNotNull, PlatformPackager } from \"./platformPackager\"\nimport AppXTarget from \"./targets/AppxTarget\"\nimport MsiTarget from \"./targets/MsiTarget\"\nimport MsiWrappedTarget from \"./targets/MsiWrappedTarget\"\nimport { NsisTarget } from \"./targets/nsis/NsisTarget\"\nimport { AppPackageHelper, CopyElevateHelper } from \"./targets/nsis/nsisUtil\"\nimport { WebInstallerTarget } from \"./targets/nsis/WebInstallerTarget\"\nimport { createCommonTarget } from \"./targets/targetFactory\"\nimport { BuildCacheManager, digest } from \"./util/cacheManager\"\nimport { isBuildCacheEnabled } from \"./util/flags\"\nimport { time } from \"./util/timer\"\nimport { getWindowsVm, VmManager } from \"./vm/vm\"\nimport { execWine } from \"./wine\"\nimport { SignManager } from \"./codeSign/signManager\"\n\nexport class WinPackager extends PlatformPackager<WindowsConfiguration> {\n _iconPath = new Lazy(() => this.getOrConvertIcon(\"ico\"))\n\n readonly vm = new Lazy<VmManager>(() => (process.platform === \"win32\" ? Promise.resolve(new VmManager()) : getWindowsVm(this.debugLogger)))\n\n readonly signingManager = new Lazy(async () => {\n let manager: SignManager\n if (this.platformSpecificBuildOptions.azureSignOptions != null) {\n manager = new WindowsSignAzureManager(this)\n } else {\n manager = new WindowsSignToolManager(this)\n }\n await manager.initialize()\n return manager\n })\n\n get isForceCodeSigningVerification(): boolean {\n return this.platformSpecificBuildOptions.verifyUpdateCodeSignature !== false\n }\n\n constructor(info: Packager) {\n super(info, Platform.WINDOWS)\n }\n\n get defaultTarget(): Array<string> {\n return [\"nsis\"]\n }\n\n createTargets(targets: Array<string>, mapper: (name: string, factory: (outDir: string) => Target) => void): void {\n let copyElevateHelper: CopyElevateHelper | null\n const getCopyElevateHelper = () => {\n if (copyElevateHelper == null) {\n copyElevateHelper = new CopyElevateHelper()\n }\n return copyElevateHelper\n }\n\n let helper: AppPackageHelper | null\n const getHelper = () => {\n if (helper == null) {\n helper = new AppPackageHelper(getCopyElevateHelper())\n }\n return helper\n }\n\n for (const name of targets) {\n if (name === DIR_TARGET) {\n continue\n }\n\n if (name === \"nsis\" || name === \"portable\") {\n mapper(name, outDir => new NsisTarget(this, outDir, name, getHelper()))\n } else if (name === \"nsis-web\") {\n // package file format differs from nsis target\n mapper(name, outDir => new WebInstallerTarget(this, path.join(outDir, name), name, new AppPackageHelper(getCopyElevateHelper())))\n } else {\n const targetClass: typeof NsisTarget | typeof AppXTarget | typeof MsiTarget | typeof MsiWrappedTarget | null = (() => {\n switch (name) {\n case \"squirrel\":\n try {\n return require(\"electron-builder-squirrel-windows\").default\n } catch (e: any) {\n throw new InvalidConfigurationError(`Module electron-builder-squirrel-windows must be installed in addition to build Squirrel.Windows: ${e.stack || e}`)\n }\n\n case \"appx\":\n return require(\"./targets/AppxTarget\").default\n\n case \"msi\":\n return require(\"./targets/MsiTarget\").default\n\n case \"msiwrapped\":\n return require(\"./targets/MsiWrappedTarget\").default\n\n default:\n return null\n }\n })()\n\n mapper(name, outDir => (targetClass === null ? createCommonTarget(name, outDir, this) : new (targetClass as any)(this, outDir, name)))\n }\n }\n }\n\n getIconPath() {\n return this._iconPath.value\n }\n\n doGetCscPassword(): string | undefined | null {\n return chooseNotNull(chooseNotNull(this.platformSpecificBuildOptions.signtoolOptions?.certificatePassword, process.env.WIN_CSC_KEY_PASSWORD), super.doGetCscPassword())\n }\n\n async sign(file: string): Promise<boolean> {\n const signOptions: WindowsSignOptions = {\n path: file,\n options: this.platformSpecificBuildOptions,\n }\n\n const didSignSuccessfully = await signWindows(signOptions, this)\n if (!didSignSuccessfully && this.forceCodeSigning) {\n throw new InvalidConfigurationError(\n `App is not signed and \"forceCodeSigning\" is set to true, please ensure that code signing configuration is correct, please see https://electron.build/code-signing`\n )\n }\n return didSignSuccessfully\n }\n\n async signAndEditResources(file: string, arch: Arch, outDir: string, internalName?: string | null, requestedExecutionLevel?: RequestedExecutionLevel | null) {\n const appInfo = this.appInfo\n\n const files: Array<string> = []\n\n const args = [\n file,\n \"--set-version-string\",\n \"FileDescription\",\n appInfo.productName,\n \"--set-version-string\",\n \"ProductName\",\n appInfo.productName,\n \"--set-version-string\",\n \"LegalCopyright\",\n appInfo.copyright,\n \"--set-file-version\",\n appInfo.shortVersion || appInfo.buildVersion,\n \"--set-product-version\",\n appInfo.shortVersionWindows || appInfo.getVersionInWeirdWindowsForm(),\n ]\n\n if (internalName != null) {\n args.push(\"--set-version-string\", \"InternalName\", internalName, \"--set-version-string\", \"OriginalFilename\", \"\")\n }\n\n if (requestedExecutionLevel != null && requestedExecutionLevel !== \"asInvoker\") {\n args.push(\"--set-requested-execution-level\", requestedExecutionLevel)\n }\n\n use(appInfo.companyName, it => args.push(\"--set-version-string\", \"CompanyName\", it))\n use(this.platformSpecificBuildOptions.legalTrademarks, it => args.push(\"--set-version-string\", \"LegalTrademarks\", it))\n const iconPath = await this.getIconPath()\n use(iconPath, it => {\n files.push(it)\n args.push(\"--set-icon\", it)\n })\n\n const config = this.config\n const cscInfoForCacheDigest = !isBuildCacheEnabled() || isCI || config.electronDist != null ? null : await (await this.signingManager.value).cscInfo.value\n let buildCacheManager: BuildCacheManager | null = null\n // resources editing doesn't change executable for the same input and executed quickly - no need to complicate\n if (cscInfoForCacheDigest != null) {\n const cscFile = (cscInfoForCacheDigest as FileCodeSigningInfo).file\n if (cscFile != null) {\n files.push(cscFile)\n }\n\n const timer = time(\"executable cache\")\n const hash = createHash(\"sha512\")\n hash.update(config.electronVersion || \"no electronVersion\")\n hash.update(JSON.stringify(this.platformSpecificBuildOptions))\n hash.update(JSON.stringify(args))\n hash.update(this.platformSpecificBuildOptions.signtoolOptions?.certificateSha1 || \"no certificateSha1\")\n hash.update(this.platformSpecificBuildOptions.signtoolOptions?.certificateSubjectName || \"no subjectName\")\n\n buildCacheManager = new BuildCacheManager(outDir, file, arch)\n if (await buildCacheManager.copyIfValid(await digest(hash, files))) {\n timer.end()\n return\n }\n timer.end()\n }\n\n const timer = time(\"wine&sign\")\n // rcedit crashed of executed using wine, resourcehacker works\n if (process.platform === \"win32\" || process.platform === \"darwin\") {\n await executeAppBuilder([\"rcedit\", \"--args\", JSON.stringify(args)], undefined /* child-process */, {}, 3 /* retry three times */)\n } else if (this.info.framework.name === \"electron\") {\n const vendorPath = await getSignVendorPath()\n await execWine(path.join(vendorPath, \"rcedit-ia32.exe\"), path.join(vendorPath, \"rcedit-x64.exe\"), args)\n }\n\n await this.sign(file)\n timer.end()\n\n if (buildCacheManager != null) {\n await buildCacheManager.save()\n }\n }\n\n private shouldSignFile(file: string): boolean {\n const shouldSignExplicit = !!this.platformSpecificBuildOptions.signExts?.some(ext => file.endsWith(ext))\n return shouldSignExplicit || file.endsWith(\".exe\")\n }\n\n protected createTransformerForExtraFiles(packContext: AfterPackContext): FileTransformer | null {\n if (this.platformSpecificBuildOptions.signAndEditExecutable === false) {\n return null\n }\n\n return file => {\n if (this.shouldSignFile(file)) {\n const parentDir = path.dirname(file)\n if (parentDir !== packContext.appOutDir) {\n return new CopyFileTransformer(file => this.sign(file))\n }\n }\n return null\n }\n }\n\n protected async signApp(packContext: AfterPackContext, isAsar: boolean): Promise<boolean> {\n const exeFileName = `${this.appInfo.productFilename}.exe`\n if (this.platformSpecificBuildOptions.signAndEditExecutable === false) {\n return false\n }\n\n const files = await readdir(packContext.appOutDir)\n for (const file of files) {\n if (file === exeFileName) {\n await this.signAndEditResources(\n path.join(packContext.appOutDir, exeFileName),\n packContext.arch,\n packContext.outDir,\n path.basename(exeFileName, \".exe\"),\n this.platformSpecificBuildOptions.requestedExecutionLevel\n )\n } else if (this.shouldSignFile(file)) {\n await this.sign(path.join(packContext.appOutDir, file))\n }\n }\n\n if (!isAsar) {\n return true\n }\n\n const filesPromise = (filepath: string[]) => {\n const outDir = path.join(packContext.appOutDir, ...filepath)\n return walk(outDir, (file, stat) => stat.isDirectory() || this.shouldSignFile(file))\n }\n const filesToSign = await Promise.all([filesPromise([\"resources\", \"app.asar.unpacked\"]), filesPromise([\"swiftshader\"])])\n for (const file of filesToSign.flat(1)) {\n await this.sign(file)\n }\n\n return true\n }\n}\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": "26.0.0
|
|
4
|
+
"version": "26.0.0",
|
|
5
5
|
"main": "out/index.js",
|
|
6
6
|
"files": [
|
|
7
7
|
"out",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@develar/schema-utils": "~2.6.5",
|
|
50
50
|
"@electron/fuses": "^1.8.0",
|
|
51
|
-
"@electron/asar": "3.2.
|
|
51
|
+
"@electron/asar": "3.2.18",
|
|
52
52
|
"@electron/notarize": "2.5.0",
|
|
53
53
|
"@electron/osx-sign": "1.3.1",
|
|
54
54
|
"@electron/rebuild": "3.7.0",
|
|
@@ -75,9 +75,9 @@
|
|
|
75
75
|
"semver": "^7.3.8",
|
|
76
76
|
"tar": "^6.1.12",
|
|
77
77
|
"temp-file": "^3.4.0",
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"builder-util
|
|
78
|
+
"electron-publish": "26.0.0",
|
|
79
|
+
"builder-util-runtime": "9.3.0",
|
|
80
|
+
"builder-util": "26.0.0"
|
|
81
81
|
},
|
|
82
82
|
"///": "babel in devDependencies for proton tests",
|
|
83
83
|
"devDependencies": {
|
|
@@ -108,12 +108,12 @@
|
|
|
108
108
|
"@types/semver": "7.3.8",
|
|
109
109
|
"@types/tar": "^6.1.3",
|
|
110
110
|
"toml": "^3.0.0",
|
|
111
|
-
"
|
|
112
|
-
"
|
|
111
|
+
"electron-builder-squirrel-windows": "26.0.0",
|
|
112
|
+
"dmg-builder": "26.0.0"
|
|
113
113
|
},
|
|
114
114
|
"peerDependencies": {
|
|
115
|
-
"dmg-builder": "26.0.0
|
|
116
|
-
"electron-builder-squirrel-windows": "26.0.0
|
|
115
|
+
"dmg-builder": "26.0.0",
|
|
116
|
+
"electron-builder-squirrel-windows": "26.0.0"
|
|
117
117
|
},
|
|
118
118
|
"//": "electron-builder-squirrel-windows and dmg-builder added as dev dep for tests (as otherwise `require` doesn't work using Yarn 2)",
|
|
119
119
|
"typings": "./out/index.d.ts"
|