1 | import { TargetSpecificOptions } from "../core";
|
2 | export type BackgroundAlignment = "center" | "left" | "right" | "top" | "bottom" | "topleft" | "topright" | "bottomleft" | "bottomright";
|
3 | export type BackgroundScaling = "tofit" | "none" | "proportional";
|
4 | /**
|
5 | * macOS product archive options.
|
6 | */
|
7 | export 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.
|
68 | *
|
69 | * Corresponds 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).
|
70 | */
|
71 | readonly mustClose?: Array<string> | null;
|
72 | /**
|
73 | * The path to the conclusion file. This may be used to customize the text on the final "Summary" page of the installer.
|
74 | */
|
75 | readonly conclusion?: string | null;
|
76 | /**
|
77 | * Install bundle over previous version if moved by user?
|
78 | * @default true
|
79 | */
|
80 | readonly isRelocatable?: boolean | null;
|
81 | /**
|
82 | * Don't install bundle if newer version on disk?
|
83 | * @default true
|
84 | */
|
85 | readonly isVersionChecked?: boolean | null;
|
86 | /**
|
87 | * Require identical bundle identifiers at install path?
|
88 | * @default true
|
89 | */
|
90 | readonly hasStrictIdentifier?: boolean | null;
|
91 | /**
|
92 | * Specifies how an existing version of the bundle on disk should be handled when the version in
|
93 | * the package is installed.
|
94 | *
|
95 | * If you specify upgrade, the bundle in the package atomi-cally replaces any version on disk;
|
96 | * this has the effect of deleting old paths that no longer exist in the new version of
|
97 | * the bundle.
|
98 | *
|
99 | * If you specify update, the bundle in the package overwrites the version on disk, and any files
|
100 | * not contained in the package will be left intact; this is appropriate when you are delivering
|
101 | * an update-only package.
|
102 | *
|
103 | * Another effect of update is that the package bundle will not be installed at all if there is
|
104 | * not already a version on disk; this allows a package to deliver an update for an app that
|
105 | * the user might have deleted.
|
106 | *
|
107 | * @default upgrade
|
108 | */
|
109 | readonly overwriteAction?: "upgrade" | "update" | null;
|
110 | }
|
111 | /**
|
112 | * Options for the background image in a PKG installer
|
113 | */
|
114 | export interface PkgBackgroundOptions {
|
115 | /**
|
116 | * Path to the image to use as an installer background.
|
117 | */
|
118 | file?: string;
|
119 | /**
|
120 | * Alignment of the background image.
|
121 | * Options are: center, left, right, top, bottom, topleft, topright, bottomleft, bottomright
|
122 | * @default center
|
123 | */
|
124 | alignment?: BackgroundAlignment | null;
|
125 | /**
|
126 | * Scaling of the background image.
|
127 | * Options are: tofit, none, proportional
|
128 | * @default tofit
|
129 | */
|
130 | scaling?: BackgroundScaling | null;
|
131 | }
|