UNPKG

4.76 kBTypeScriptView Raw
1import { PlatformSpecificBuildOptions, TargetConfigType } from "../index";
2import { CustomWindowsSign } from "../codeSign/windowsCodeSign";
3export interface WindowsConfiguration extends PlatformSpecificBuildOptions {
4 /**
5 * The target package type: list of `nsis`, `nsis-web` (Web installer), `portable` ([portable](/configuration/nsis#portable) app without installation), `appx`, `msi`, `msi-wrapped`, `squirrel`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`.
6 * AppX package can be built only on Windows 10.
7 *
8 * To use Squirrel.Windows please install `electron-builder-squirrel-windows` dependency.
9 *
10 * @default nsis
11 */
12 readonly target?: TargetConfigType;
13 /**
14 * The path to application icon.
15 * @default build/icon.ico
16 */
17 readonly icon?: string | null;
18 /**
19 * The trademarks and registered trademarks.
20 */
21 readonly legalTrademarks?: string | null;
22 /**
23 * Array of signing algorithms used. For AppX `sha256` is always used.
24 * @default ['sha1', 'sha256']
25 */
26 readonly signingHashAlgorithms?: Array<"sha1" | "sha256"> | null;
27 /**
28 * The custom function (or path to file or module id) to sign Windows executable.
29 */
30 readonly sign?: CustomWindowsSign | string | null;
31 /**
32 * The path to the *.pfx certificate you want to sign with. Please use it only if you cannot use env variable `CSC_LINK` (`WIN_CSC_LINK`) for some reason.
33 * Please see [Code Signing](/code-signing).
34 */
35 readonly certificateFile?: string | null;
36 /**
37 * The password to the certificate provided in `certificateFile`. Please use it only if you cannot use env variable `CSC_KEY_PASSWORD` (`WIN_CSC_KEY_PASSWORD`) for some reason.
38 * Please see [Code Signing](/code-signing).
39 */
40 readonly certificatePassword?: string | null;
41 /**
42 * The name of the subject of the signing certificate, which is often labeled with the field name `issued to`. Required only for EV Code Signing and works only on Windows (or on macOS if [Parallels Desktop](https://www.parallels.com/products/desktop/) Windows 10 virtual machines exits).
43 */
44 readonly certificateSubjectName?: string | null;
45 /**
46 * The SHA1 hash of the signing certificate. The SHA1 hash is commonly specified when multiple certificates satisfy the criteria specified by the remaining switches. Works only on Windows (or on macOS if [Parallels Desktop](https://www.parallels.com/products/desktop/) Windows 10 virtual machines exits).
47 */
48 readonly certificateSha1?: string | null;
49 /**
50 * The path to an additional certificate file you want to add to the signature block.
51 */
52 readonly additionalCertificateFile?: string | null;
53 /**
54 * The URL of the RFC 3161 time stamp server.
55 * @default http://timestamp.digicert.com
56 */
57 readonly rfc3161TimeStampServer?: string | null;
58 /**
59 * The URL of the time stamp server.
60 * @default http://timestamp.digicert.com
61 */
62 readonly timeStampServer?: string | null;
63 /**
64 * [The publisher name](https://github.com/electron-userland/electron-builder/issues/1187#issuecomment-278972073), exactly as in your code signed certificate. Several names can be provided.
65 * Defaults to common name from your code signing certificate.
66 */
67 readonly publisherName?: string | Array<string> | null;
68 /**
69 * Whether to verify the signature of an available update before installation.
70 * The [publisher name](#publisherName) will be used for the signature verification.
71 *
72 * @default true
73 */
74 readonly verifyUpdateCodeSignature?: boolean;
75 /**
76 * The [security level](https://msdn.microsoft.com/en-us/library/6ad1fshk.aspx#Anchor_9) at which the application requests to be executed.
77 * Cannot be specified per target, allowed only in the `win`.
78 * @default asInvoker
79 */
80 readonly requestedExecutionLevel?: RequestedExecutionLevel | null;
81 /**
82 * Whether to sign and add metadata to executable. Advanced option.
83 * @default true
84 */
85 readonly signAndEditExecutable?: boolean;
86 /**
87 * Whether to sign DLL files. Advanced option.
88 * @see https://github.com/electron-userland/electron-builder/issues/3101#issuecomment-404212384
89 * @default false
90 * @deprecated Use `signExts` instead for more explicit control
91 */
92 readonly signDlls?: boolean;
93 /**
94 * Explicit file extensions to also sign. Advanced option.
95 * @see https://github.com/electron-userland/electron-builder/issues/7329
96 * @default null
97 */
98 readonly signExts?: string[] | null;
99}
100export type RequestedExecutionLevel = "asInvoker" | "highestAvailable" | "requireAdministrator";