1 | import { TargetSpecificOptions } from "../../core";
|
2 | import { CommonWindowsInstallerConfiguration } from "../..";
|
3 | export interface CommonNsisOptions {
|
4 | /**
|
5 | * Whether to create [Unicode installer](http://nsis.sourceforge.net/Docs/Chapter1.html#intro-unicode).
|
6 | * @default true
|
7 | */
|
8 | readonly unicode?: boolean;
|
9 | /**
|
10 | * See [GUID vs Application Name](../configuration/nsis.md#guid-vs-application-name).
|
11 | */
|
12 | readonly guid?: string | null;
|
13 | /**
|
14 | * If `warningsAsErrors` is `true` (default): NSIS will treat warnings as errors. If `warningsAsErrors` is `false`: NSIS will allow warnings.
|
15 | * @default true
|
16 | */
|
17 | readonly warningsAsErrors?: boolean;
|
18 | /**
|
19 | * @private
|
20 | * @default false
|
21 | */
|
22 | readonly useZip?: boolean;
|
23 | }
|
24 | export interface NsisOptions extends CommonNsisOptions, CommonWindowsInstallerConfiguration, TargetSpecificOptions {
|
25 | /**
|
26 | * Whether to create one-click installer or assisted.
|
27 | * @default true
|
28 | */
|
29 | readonly oneClick?: boolean;
|
30 | /**
|
31 | * 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).
|
32 | *
|
33 | * If `oneClick` is `true` (default): Whether to install per all users (per-machine).
|
34 | *
|
35 | * If `oneClick` is `false` and `perMachine` is `true`: no install mode installer page, always install per-machine.
|
36 | *
|
37 | * If `oneClick` is `false` and `perMachine` is `false` (default): install mode installer page.
|
38 | * @default false
|
39 | */
|
40 | readonly perMachine?: boolean;
|
41 | /**
|
42 | * *assisted installer only.* Allow requesting for elevation. If false, user will have to restart installer with elevated permissions.
|
43 | * @default true
|
44 | */
|
45 | readonly allowElevation?: boolean;
|
46 | /**
|
47 | * *assisted installer only.* Whether to allow user to change installation directory.
|
48 | * @default false
|
49 | */
|
50 | readonly allowToChangeInstallationDirectory?: boolean;
|
51 | /**
|
52 | * The path to installer icon, relative to the [build resources](/configuration/configuration.md#MetadataDirectories-buildResources) or to the project directory.
|
53 | * Defaults to `build/installerIcon.ico` or application icon.
|
54 | */
|
55 | readonly installerIcon?: string | null;
|
56 | /**
|
57 | * The path to uninstaller icon, relative to the [build resources](/configuration/configuration.md#MetadataDirectories-buildResources) or to the project directory.
|
58 | * Defaults to `build/uninstallerIcon.ico` or application icon.
|
59 | */
|
60 | readonly uninstallerIcon?: string | null;
|
61 | /**
|
62 | * *assisted installer only.* `MUI_HEADERIMAGE`, relative to the [build resources](/configuration/configuration.md#MetadataDirectories-buildResources) or to the project directory.
|
63 | * @default build/installerHeader.bmp
|
64 | */
|
65 | readonly installerHeader?: string | null;
|
66 | /**
|
67 | * *one-click installer only.* The path to header icon (above the progress bar), relative to the [build resources](/configuration/configuration.md#MetadataDirectories-buildResources) or to the project directory.
|
68 | * Defaults to `build/installerHeaderIcon.ico` or application icon.
|
69 | */
|
70 | readonly installerHeaderIcon?: string | null;
|
71 | /**
|
72 | * *assisted installer only.* `MUI_WELCOMEFINISHPAGE_BITMAP`, relative to the [build resources](/configuration/configuration.md#MetadataDirectories-buildResources) or to the project directory.
|
73 | * Defaults to `build/installerSidebar.bmp` or `${NSISDIR}\\Contrib\\Graphics\\Wizard\\nsis3-metro.bmp`. Image size 164 × 314 pixels.
|
74 | */
|
75 | readonly installerSidebar?: string | null;
|
76 | /**
|
77 | * *assisted installer only.* `MUI_UNWELCOMEFINISHPAGE_BITMAP`, relative to the [build resources](/configuration/configuration.md#MetadataDirectories-buildResources) or to the project directory.
|
78 | * Defaults to `installerSidebar` option or `build/uninstallerSidebar.bmp` or `build/installerSidebar.bmp` or `${NSISDIR}\\Contrib\\Graphics\\Wizard\\nsis3-metro.bmp`
|
79 | */
|
80 | readonly uninstallerSidebar?: string | null;
|
81 | /**
|
82 | * The uninstaller display name in the control panel.
|
83 | * @default ${productName} ${version}
|
84 | */
|
85 | readonly uninstallDisplayName?: string;
|
86 | /**
|
87 | * The path to NSIS include script to customize installer. Defaults to `build/installer.nsh`. See [Custom NSIS script](#custom-nsis-script).
|
88 | */
|
89 | readonly include?: string | null;
|
90 | /**
|
91 | * The path to NSIS script to customize installer. Defaults to `build/installer.nsi`. See [Custom NSIS script](#custom-nsis-script).
|
92 | */
|
93 | readonly script?: string | null;
|
94 | /**
|
95 | * 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).
|
96 | *
|
97 | * 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.
|
98 | * 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).
|
99 | *
|
100 | * Appropriate license file will be selected by user OS language.
|
101 | */
|
102 | readonly license?: string | null;
|
103 | /**
|
104 | * The [artifact file name template](/configuration/configuration.md#artifact-file-name-template). Defaults to `${productName} Setup ${version}.${ext}`.
|
105 | */
|
106 | readonly artifactName?: string | null;
|
107 | /**
|
108 | * *one-click installer only.* Whether to delete app data on uninstall.
|
109 | * @default false
|
110 | */
|
111 | readonly deleteAppDataOnUninstall?: boolean;
|
112 | /**
|
113 | * Defaults to `true` for web installer (`nsis-web`)
|
114 | */
|
115 | differentialPackage?: boolean;
|
116 | /**
|
117 | * Whether to display a language selection dialog. Not recommended (by default will be detected using OS language).
|
118 | * @default false
|
119 | */
|
120 | readonly displayLanguageSelector?: boolean;
|
121 | /**
|
122 | * The installer languages (e.g. `en_US`, `de_DE`). Change only if you understand what do you do and for what.
|
123 | */
|
124 | readonly installerLanguages?: Array<string> | string | null;
|
125 | /**
|
126 | * [LCID Dec](https://msdn.microsoft.com/en-au/goglobal/bb964664.aspx), defaults to `1033`(`English - United States`).
|
127 | */
|
128 | readonly language?: string | null;
|
129 | /**
|
130 | * Whether to create multi-language installer. Defaults to `unicode` option value.
|
131 | */
|
132 | readonly multiLanguageInstaller?: boolean;
|
133 | /**
|
134 | * 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`.
|
135 | * @default true
|
136 | */
|
137 | readonly packElevateHelper?: boolean;
|
138 | /**
|
139 | * The file extension of files that will be not compressed. Applicable only for `extraResources` and `extraFiles` files.
|
140 | * @default [".avi", ".mov", ".m4v", ".mp4", ".m4p", ".qt", ".mkv", ".webm", ".vmdk"]
|
141 | */
|
142 | readonly preCompressedFileExtensions?: Array<string> | string | null;
|
143 | }
|
144 | /**
|
145 | * Portable options.
|
146 | */
|
147 | export interface PortableOptions extends TargetSpecificOptions, CommonNsisOptions {
|
148 | /**
|
149 | * The [requested execution level](http://nsis.sourceforge.net/Reference/RequestExecutionLevel) for Windows.
|
150 | * @default user
|
151 | */
|
152 | readonly requestExecutionLevel?: "user" | "highest" | "admin";
|
153 | }
|
154 | /**
|
155 | * Web Installer options.
|
156 | */
|
157 | export interface NsisWebOptions extends NsisOptions {
|
158 | /**
|
159 | * The application package download URL. Optional — by default computed using publish configuration.
|
160 | *
|
161 | * URL like `https://example.com/download/latest` allows web installer to be version independent (installer will download latest application package).
|
162 | * Please note — it is [full URL](https://github.com/electron-userland/electron-builder/issues/1810#issuecomment-317650878).
|
163 | *
|
164 | * Custom `X-Arch` http header is set to `32` or `64`.
|
165 | */
|
166 | readonly appPackageUrl?: string | null;
|
167 | /**
|
168 | * The [artifact file name template](/configuration/configuration.md#artifact-file-name-template). Defaults to `${productName} Web Setup ${version}.${ext}`.
|
169 | */
|
170 | readonly artifactName?: string | null;
|
171 | }
|