UNPKG

6.42 kBTypeScriptView Raw
1import { TargetSpecificOptions } from "../core";
2export declare type BackgroundAlignment = "center" | "left" | "right" | "top" | "bottom" | "topleft" | "topright" | "bottomleft" | "bottomright";
3export declare type BackgroundScaling = "tofit" | "none" | "proportional";
4/**
5 * macOS product archive options.
6 */
7export interface PkgOptions extends TargetSpecificOptions {
8 /**
9 * The scripts directory, relative to `build` (build resources directory).
10 * 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.
11 * Scripts are required to be executable (`chmod +x file`).
12 * @default build/pkg-scripts
13 * @see [Scripting in installer packages](http://macinstallers.blogspot.de/2012/07/scripting-in-installer-packages.html).
14 */
15 readonly scripts?: string | null;
16 /**
17 * should be not documented, only to experiment
18 * @private
19 */
20 readonly productbuild?: Array<string> | null;
21 /**
22 * 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.
23 * 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.
24 * @default /Applications
25 */
26 readonly installLocation?: string | null;
27 /**
28 * 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.
29 *
30 * 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).
31 * @default true
32 */
33 readonly allowAnywhere?: boolean | null;
34 /**
35 * Whether can be installed into the current user’s home directory.
36 * A home directory installation is done as the current user (not as root), and it cannot write outside of the home directory.
37 * If the product cannot be installed in the user’s home directory and be not completely functional from user’s home directory.
38 *
39 * 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).
40 * @default true
41 */
42 readonly allowCurrentUserHome?: boolean | null;
43 /**
44 * 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.
45 *
46 * 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).
47 * @default true
48 */
49 readonly allowRootDirectory?: boolean | null;
50 /**
51 * The name of certificate to use when signing. Consider using environment variables [CSC_LINK or CSC_NAME](/code-signing) instead of specifying this option.
52 */
53 readonly identity?: string | null;
54 /**
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 */
57 readonly license?: string | null;
58 /**
59 * Options for the background image for the installer.
60 */
61 readonly background?: PkgBackgroundOptions | null;
62 /**
63 * The path to the welcome file. This may be used to customize the text on the Introduction page of the installer.
64 */
65 readonly welcome?: string | null;
66 /**
67 * Identifies applications that must be closed before the package is installed.\n\nCorresponds 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)
68 */
69 readonly mustClose?: Array<string> | null;
70 /**
71 * The path to the conclusion file. This may be used to customize the text on the final "Summary" page of the installer.
72 */
73 readonly conclusion?: string | null;
74 /**
75 * Install bundle over previous version if moved by user?
76 * @default true
77 */
78 readonly isRelocatable?: boolean | null;
79 /**
80 * Don't install bundle if newer version on disk?
81 * @default true
82 */
83 readonly isVersionChecked?: boolean | null;
84 /**
85 * Require identical bundle identifiers at install path?
86 * @default true
87 */
88 readonly hasStrictIdentifier?: boolean | null;
89 /**
90 * Specifies how an existing version of the bundle on disk should be handled when the version in
91 * the package is installed.
92 *
93 * If you specify upgrade, the bundle in the package atomi-cally replaces any version on disk;
94 * this has the effect of deleting old paths that no longer exist in the new version of
95 * the bundle.
96 *
97 * If you specify update, the bundle in the package overwrites the version on disk, and any files
98 * not contained in the package will be left intact; this is appropriate when you are delivering
99 * an update-only package.
100 *
101 * Another effect of update is that the package bundle will not be installed at all if there is
102 * not already a version on disk; this allows a package to deliver an update for an app that
103 * the user might have deleted.
104 *
105 * @default upgrade
106 */
107 readonly overwriteAction?: "upgrade" | "update" | null;
108}
109/**
110 * Options for the background image in a PKG installer
111 */
112export interface PkgBackgroundOptions {
113 /**
114 * Path to the image to use as an installer background.
115 */
116 file?: string;
117 /**
118 * Alignment of the background image.
119 * Options are: center, left, right, top, bottom, topleft, topright, bottomleft, bottomright
120 * @default center
121 */
122 alignment?: BackgroundAlignment | null;
123 /**
124 * Scaling of the background image.
125 * Options are: tofit, none, proportional
126 * @default tofit
127 */
128 scaling?: BackgroundScaling | null;
129}