1 | import { PlatformSpecificBuildOptions, TargetConfiguration, TargetSpecificOptions } from "../index";
|
2 | export declare type MacOsTargetName = "default" | "dmg" | "mas" | "mas-dev" | "pkg" | "7z" | "zip" | "tar.xz" | "tar.lz" | "tar.gz" | "tar.bz2" | "dir";
|
3 | export interface MacConfiguration extends PlatformSpecificBuildOptions {
|
4 | /**
|
5 | * The application category type, as shown in the Finder via *View -> Arrange by Application Category* when viewing the Applications directory.
|
6 | *
|
7 | * For example, `"category": "public.app-category.developer-tools"` will set the application category to *Developer Tools*.
|
8 | *
|
9 | * Valid values are listed in [Apple's documentation](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/TP40009250-SW8).
|
10 | */
|
11 | readonly category?: string | null;
|
12 | /**
|
13 | * The target package type: list of `default`, `dmg`, `mas`, `mas-dev`, `pkg`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`. Defaults to `default` (dmg and zip for Squirrel.Mac).
|
14 | */
|
15 | readonly target?: Array<MacOsTargetName | TargetConfiguration> | MacOsTargetName | TargetConfiguration | null;
|
16 | /**
|
17 | * The name of certificate to use when signing. Consider using environment variables [CSC_LINK or CSC_NAME](/code-signing.md) instead of specifying this option.
|
18 | * MAS installer identity is specified in the [mas](mas.md).
|
19 | */
|
20 | readonly identity?: string | null;
|
21 | /**
|
22 | * The path to application icon.
|
23 | * @default build/icon.icns
|
24 | */
|
25 | readonly icon?: string | null;
|
26 | /**
|
27 | * The path to entitlements file for signing the app. `build/entitlements.mac.plist` will be used if exists (it is a recommended way to set).
|
28 | * MAS entitlements is specified in the [mas](mas.md).
|
29 | */
|
30 | readonly entitlements?: string | null;
|
31 | /**
|
32 | * The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mac.inherit.plist` will be used if exists (it is a recommended way to set).
|
33 | * Otherwise [default](https://github.com/electron-userland/electron-osx-sign/blob/master/default.entitlements.darwin.inherit.plist).
|
34 | *
|
35 | * This option only applies when signing with `entitlements` provided.
|
36 | */
|
37 | readonly entitlementsInherit?: string | null;
|
38 | /**
|
39 | * The path to the provisioning profile to use when signing, absolute or relative to the app root.
|
40 | */
|
41 | readonly provisioningProfile?: string | null;
|
42 | /**
|
43 | * The `CFBundleVersion`. Do not use it unless [you need to](https://github.com/electron-userland/electron-builder/issues/565#issuecomment-230678643).
|
44 | */
|
45 | readonly bundleVersion?: string | null;
|
46 | /**
|
47 | * The `CFBundleShortVersionString`. Do not use it unless you need to.
|
48 | */
|
49 | readonly bundleShortVersion?: string | null;
|
50 | /**
|
51 | * The bundle identifier to use in the application helper's plist.
|
52 | * @default ${appBundleIdentifier}.helper
|
53 | */
|
54 | readonly helperBundleId?: string | null;
|
55 | /**
|
56 | * Whether to sign app for development or for distribution.
|
57 | * @default distribution
|
58 | */
|
59 | readonly type?: "distribution" | "development" | null;
|
60 | /**
|
61 | * The extra entries for `Info.plist`.
|
62 | */
|
63 | readonly extendInfo?: any;
|
64 | /**
|
65 | * Paths of any extra binaries that need to be signed.
|
66 | */
|
67 | readonly binaries?: Array<string> | null;
|
68 | /**
|
69 | * The minimum version of macOS required for the app to run. Corresponds to `LSMinimumSystemVersion`.
|
70 | */
|
71 | readonly minimumSystemVersion?: string | null;
|
72 | /**
|
73 | * Path of [requirements file](https://developer.apple.com/library/mac/documentation/Security/Conceptual/CodeSigningGuide/RequirementLang/RequirementLang.html) used in signing. Not applicable for MAS.
|
74 | */
|
75 | readonly requirements?: string | null;
|
76 | /**
|
77 | * The electron-updater compatibility semver range. e.g. `>= 2.16`, `>=1.0.0`. Defaults to `>=1.0.0`
|
78 | *
|
79 | * 1.0.0 latest-mac.json
|
80 | * 2.15.0 path
|
81 | * 2.16.0 files
|
82 | */
|
83 | readonly electronUpdaterCompatibility?: string | null;
|
84 | /**
|
85 | * The electron locales. By default Electron locales used as is.
|
86 | */
|
87 | readonly electronLanguages?: Array<string> | string;
|
88 | /** @private */
|
89 | readonly cscInstallerLink?: string | null;
|
90 | /** @private */
|
91 | readonly cscInstallerKeyPassword?: string | null;
|
92 | }
|
93 | /**
|
94 | * macOS product archive options.
|
95 | */
|
96 | export interface PkgOptions extends TargetSpecificOptions {
|
97 | /**
|
98 | * The scripts directory, relative to `build` (build resources directory).
|
99 | * 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.
|
100 | * Scripts are required to be executable (`chmod +x file`).
|
101 | * @default build/pkg-scripts
|
102 | * @see [Scripting in installer packages](http://macinstallers.blogspot.de/2012/07/scripting-in-installer-packages.html).
|
103 | */
|
104 | readonly scripts?: string | null;
|
105 | /**
|
106 | * should be not documented, only to experiment
|
107 | * @private
|
108 | */
|
109 | readonly productbuild?: Array<string> | null;
|
110 | /**
|
111 | * 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.
|
112 | * 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.
|
113 | * @default /Applications
|
114 | */
|
115 | readonly installLocation?: string | null;
|
116 | /**
|
117 | * 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.
|
118 | *
|
119 | * 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).
|
120 | * @default true
|
121 | */
|
122 | readonly allowAnywhere?: boolean | null;
|
123 | /**
|
124 | * Whether can be installed into the current user’s home directory.
|
125 | * A home directory installation is done as the current user (not as root), and it cannot write outside of the home directory.
|
126 | * If the product cannot be installed in the user’s home directory and be not completely functional from user’s home directory.
|
127 | *
|
128 | * 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).
|
129 | * @default true
|
130 | */
|
131 | readonly allowCurrentUserHome?: boolean | null;
|
132 | /**
|
133 | * 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.
|
134 | *
|
135 | * 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).
|
136 | * @default true
|
137 | */
|
138 | readonly allowRootDirectory?: boolean | null;
|
139 | /**
|
140 | * The name of certificate to use when signing. Consider using environment variables [CSC_LINK or CSC_NAME](../code-signing.md) instead of specifying this option.
|
141 | */
|
142 | readonly identity?: string | null;
|
143 | /**
|
144 | * 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).
|
145 | */
|
146 | readonly license?: string | null;
|
147 | /**
|
148 | * Install bundle over previous version if moved by user?
|
149 | * @default true
|
150 | */
|
151 | readonly isRelocatable?: boolean | null;
|
152 | /**
|
153 | * Don't install bundle if newer version on disk?
|
154 | * @default true
|
155 | */
|
156 | readonly isVersionChecked?: boolean | null;
|
157 | /**
|
158 | * Require identical bundle identifiers at install path?
|
159 | * @default true
|
160 | */
|
161 | readonly hasStrictIdentifier?: boolean | null;
|
162 | /**
|
163 | * Specifies how an existing version of the bundle on disk should be handled when the version in
|
164 | * the package is installed.
|
165 | *
|
166 | * If you specify upgrade, the bundle in the package atomi-cally replaces any version on disk;
|
167 | * this has the effect of deleting old paths that no longer exist in the new version of
|
168 | * the bundle.
|
169 | *
|
170 | * If you specify update, the bundle in the package overwrites the version on disk, and any files
|
171 | * not contained in the package will be left intact; this is appropriate when you are delivering
|
172 | * an update-only package.
|
173 | *
|
174 | * Another effect of update is that the package bundle will not be installed at all if there is
|
175 | * not already a version on disk; this allows a package to deliver an update for an app that
|
176 | * the user might have deleted.
|
177 | *
|
178 | * @default upgrade
|
179 | */
|
180 | readonly overwriteAction?: "upgrade" | "update" | null;
|
181 | }
|
182 | export interface DmgOptions extends TargetSpecificOptions {
|
183 | /**
|
184 | * The path to background image (default: `build/background.tiff` or `build/background.png` if exists). The resolution of this file determines the resolution of the installer window.
|
185 | * If background is not specified, use `window.size`. Default locations expected background size to be 540x380.
|
186 | * @see [DMG with Retina background support](http://stackoverflow.com/a/11204769/1910191).
|
187 | */
|
188 | background?: string | null;
|
189 | /**
|
190 | * The background color (accepts css colors). Defaults to `#ffffff` (white) if no background image.
|
191 | */
|
192 | backgroundColor?: string | null;
|
193 | /**
|
194 | * The path to DMG icon (volume icon), which will be shown when mounted, relative to the [build resources](/configuration/configuration.md#MetadataDirectories-buildResources) or to the project directory.
|
195 | * Defaults to the application icon (`build/icon.icns`).
|
196 | */
|
197 | readonly icon?: string | null;
|
198 | /**
|
199 | * The size of all the icons inside the DMG.
|
200 | * @default 80
|
201 | */
|
202 | readonly iconSize?: number | null;
|
203 | /**
|
204 | * The size of all the icon texts inside the DMG.
|
205 | * @default 12
|
206 | */
|
207 | readonly iconTextSize?: number | null;
|
208 | /**
|
209 | * The title of the produced DMG, which will be shown when mounted (volume name).
|
210 | *
|
211 | * Macro `${productName}`, `${version}` and `${name}` are supported.
|
212 | * @default ${productName} ${version}
|
213 | */
|
214 | readonly title?: string | null;
|
215 | /**
|
216 | * The content — to customize icon locations.
|
217 | */
|
218 | contents?: Array<DmgContent>;
|
219 | /**
|
220 | * The disk image format. `ULFO` (lzfse-compressed image (OS X 10.11+ only)).
|
221 | * @default UDZO
|
222 | */
|
223 | readonly format?: "UDRW" | "UDRO" | "UDCO" | "UDZO" | "UDBZ" | "ULFO";
|
224 | /**
|
225 | * The DMG windows position and size.
|
226 | */
|
227 | window?: DmgWindow;
|
228 | /**
|
229 | * Whether to create internet-enabled disk image (when it is downloaded using a browser it will automatically decompress the image, put the application on the desktop, unmount and remove the disk image file).
|
230 | * @default false
|
231 | */
|
232 | readonly internetEnabled?: boolean;
|
233 | }
|
234 | export interface DmgWindow {
|
235 | /**
|
236 | * The X position relative to left of the screen.
|
237 | * @default 400
|
238 | */
|
239 | x?: number;
|
240 | /**
|
241 | * The Y position relative to top of the screen.
|
242 | * @default 100
|
243 | */
|
244 | y?: number;
|
245 | /**
|
246 | * The width. Defaults to background image width or 540.
|
247 | */
|
248 | width?: number;
|
249 | /**
|
250 | * The height. Defaults to background image height or 380.
|
251 | */
|
252 | height?: number;
|
253 | }
|
254 | export interface DmgContent {
|
255 | x: number;
|
256 | y: number;
|
257 | type?: "link" | "file" | "dir";
|
258 | /**
|
259 | * The name of the file within the DMG. Defaults to basename of `path`.
|
260 | */
|
261 | name?: string;
|
262 | /**
|
263 | * The path of the file within the DMG.
|
264 | */
|
265 | path?: string;
|
266 | }
|
267 | export interface MasConfiguration extends MacConfiguration {
|
268 | /**
|
269 | * The path to entitlements file for signing the app. `build/entitlements.mas.plist` will be used if exists (it is a recommended way to set).
|
270 | * Otherwise [default](https://github.com/electron-userland/electron-osx-sign/blob/master/default.entitlements.mas.plist).
|
271 | */
|
272 | readonly entitlements?: string | null;
|
273 | /**
|
274 | * The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mas.inherit.plist` will be used if exists (it is a recommended way to set).
|
275 | * Otherwise [default](https://github.com/electron-userland/electron-osx-sign/blob/master/default.entitlements.mas.inherit.plist).
|
276 | */
|
277 | readonly entitlementsInherit?: string | null;
|
278 | /**
|
279 | * Paths of any extra binaries that need to be signed.
|
280 | */
|
281 | readonly binaries?: Array<string> | null;
|
282 | }
|