You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This tool will quickly and easily build a package from an installed application, a disk image file or zip archive with an enclosed application bundle. It will also extract the application nameand version and use it to name the resulting `pkg` file.
3
+
This tool will quickly and easily build a package from an installed application, a disk image file, or zip/xip archive with an enclosed application bundle. It will also extract the application name, version, identifier, and minimum OS version and use them for the resulting `pkg` file.
4
4
5
5
The tool will look for applications on the first level of the disk image or archive. If it finds no or more than one application it will error.
6
6
7
7
The name of the resulting package will be of the form `{name}-{version}.pkg`. Spaces will be removed from the name. The package will be written to the current working directory.
8
8
9
-
## Dependencies
9
+
## Implementations
10
10
11
-
Apple will remove the Python 2.7 binary at `/usr/local/python` from macOS in macOS Monterey 12.3. This script is built and tested with [the MacAdmins "Managed Python."](https://github.com/macadmins/python) It should (probably) work with other Python 3 distributions, as well, but has not been tested on any.
@@ -30,27 +56,71 @@ Build package from a zip archive:
30
56
quickpkg ~/Downloads/Things.zip
31
57
```
32
58
59
+
Build package from an xip archive:
60
+
61
+
```
62
+
quickpkg ~/Downloads/Xcode.xip
63
+
```
64
+
65
+
Build a signed distribution package:
66
+
67
+
```
68
+
quickpkg /Applications/MyApp.app --sign "Developer ID Installer: Your Name"
69
+
```
70
+
71
+
Build a component package (instead of distribution):
72
+
73
+
```
74
+
quickpkg /Applications/MyApp.app --component
75
+
```
76
+
33
77
## Options
34
78
35
-
### `--scripts scripts_folder`:
79
+
### Installation Scripts
80
+
81
+
#### `--scripts <folder>`
82
+
83
+
Pass a folder with scripts that are passed to `pkgbuild`'s `--scripts` option. If there is a `preinstall` and/or `postinstall` script they will be run at the respective times and can call other scripts in this folder.
84
+
85
+
#### `--postinstall <script>` (or `--post`)
86
+
87
+
Use the script file given as a postinstall script. If given together with the `--scripts` option will attempt to merge the two and error if a `postinstall` script is already present.
88
+
89
+
#### `--preinstall <script>` (or `--pre`)
90
+
91
+
Use the script file given as a preinstall script. If given together with the `--scripts` option will attempt to merge the two and error if a `preinstall` script is already present.
92
+
93
+
### Package Options
94
+
95
+
#### `--install-location <path>`
96
+
97
+
Set the install location for the application. Default is `/Applications`.
Pass a folder with scripts that are passed to `pkgbuild`'s `--scripts` option. If the there is a `preinstall` and/or `postinstall` script they will be run at the respective and can call other scripts in this folder.
101
+
This parameter will be passed to `pkgbuild`. See `man pkgbuild` for details.
38
102
39
-
### `--postinstall postinstall_script`
103
+
####`--compression <latest|legacy>` (v2.0)
40
104
41
-
Use the script file given as a postinstall script. If given together with the `-scripts` option will attempt to merge the two and error if a `postinstall` script is already present.
105
+
Set the compression type for the package. Default is `latest`.
42
106
43
-
### `--preinstall preinstall_script`
107
+
####`--component` / `--distribution` (v2.0)
44
108
45
-
Use the script file given as a preinstall script. If given together with the `-scripts` option will attempt to merge the two and error if a `preinstall` script is already present.
109
+
Choose the package type. Default is `--distribution` which wraps the component package using `productbuild`. Use `--component` for a simple component package.
This parameter will be passed into `pkgbuild`. Default is `recommended`. See `man pkgbuild` for details.
113
+
Controls whether the resulting pkg file is relocatable, i.e. if the installer process will search for the bundle by bundle-identifier if it was moved to another location. By default packages are created **non-relocatable**.
50
114
51
-
### `--output pkgpath`
115
+
####`--[no-]clean`
52
116
53
-
Will write the resulting package to `pkgpath` instead of the current working directory. If `pkgpath` is a directory, then the default package name (`{name}-{version}.pkg`) is used. You can also give the complete path, including a name. You can use the placeholders `{name}`, `{version}` and `{identifier}` in the name.
117
+
Controls whether temporary files are cleaned up after building. Default is `--clean`.
118
+
119
+
### Output Options
120
+
121
+
#### `--output <path>` (or `-o`)
122
+
123
+
Write the resulting package to `<path>` instead of the current working directory. If `<path>` is a directory, then the default package name (`{name}-{version}.pkg`) is used. You can also give the complete path, including a name. You can use the placeholders `{name}`, `{version}` and `{identifier}` in the name.
54
124
55
125
Examples:
56
126
@@ -64,37 +134,49 @@ Will create `Numbers-X.Y.Z.pkg` in `~/Packages`.
will create `com.apple.Numbers_X.Y.Z.pkg` in `~/Packages`.
143
+
Will create `com.apple.Numbers_X.Y.Z.pkg` in `~/Packages`.
144
+
145
+
### Signing Options
146
+
147
+
#### `--sign <identity>`
148
+
149
+
Sign the resulting package with the specified identity. Usually a "Developer ID Installer" certificate from your Apple Developer account.
74
150
75
-
### `--[no-]relocatable`
151
+
####`--keychain <path>`
76
152
77
-
Controls wether the resulting pkg file is relocatable, i.e. if the installer process will search for the bundle by bundle-identifier if it was moved to another location. By default packages will be created NON-relocatable.
153
+
Specify a keychain to search for the signing identity.
78
154
79
-
## `--sign`, `--keychain` and `--cert`
155
+
####`--cert <path>`
80
156
81
-
You can add these options to sign the resulting package. These three options are passed through to the `pkgbuild` command. Read the `pkgbuild` man page for details.
157
+
Specify an intermediate certificate to embed in the package.
82
158
83
-
Usually you can find the proper signing identity (from the Apple Developer account) with the command
159
+
You can find available signing identities with:
84
160
85
161
```
86
-
$ security find-identity -p basic -v
162
+
security find-identity -p basic -v
87
163
```
88
164
89
-
and then you add the proper identity with the `--sign` option.
165
+
Example:
90
166
91
167
```
92
-
$ quickpkg ~/Downloads/Firefox\ 53.0.3.dmg --sign "3rd Party Mac Developer Installer: Your Name Here"
168
+
quickpkg ~/Downloads/Firefox.dmg --sign "Developer ID Installer: Your Name"
93
169
```
94
170
171
+
### Verbosity
172
+
173
+
#### `-v`, `-vv`, `-vvv`
174
+
175
+
Increase verbosity. Use `-v` for basic info, `-vv` for more detail, `-vvv` for full command output including all shell commands.
176
+
95
177
## Background
96
178
97
-
OS X has had the `pkgbuild` tool since Xcode 3.2 on Snow Leopard. With pkgbuild you can directly build a installer package from an application in the `/Applications` folder:
179
+
macOS has had the `pkgbuild` tool since Xcode 3.2 on Snow Leopard. With pkgbuild you can directly build an installer package from an application in the `/Applications` folder:
This tool even does the work of determining a bundle's identifier and version and sets the identifier and version of the pkg to the same values.
112
194
113
-
However, while `pkgbuild` does automatically name the package, it does not include the version, which is important when you tracking many versions of the same application. It also doesn't automatically look into a `dmg` file or `zip` archive.
195
+
However, while `pkgbuild` does automatically name the package, it does not include the version, which is important when tracking many versions of the same application. It also doesn't automatically look into a `dmg` file or `zip` archive.
114
196
115
197
## `quickpkg` vs `autopkg`
116
198
117
199
This tool is not meant to replace [`autopkg`](https://github.com/autopkg/autopkg). `autopkg` will automate the download, the re-packaging (if necessary) and the upload to and configuration of your client management system. It can also handle much more complex setups than `quickpkg`. `autopkg` is far superior and should be your tool of choice.
118
200
119
-
However, there are situations where `autopkg` does not work well. The most common reason is if the download cannot be automated because the download page is behind a paywall. Or maybe you are just experimenting with a test server and do not want to change your production `autopkg` setup. Also `autopkg` requires a recipe for a given piece of software. If no recipe exists, `quickpkg` may be a simple alternative. (Though if `quickpkg` works, creating an `autopkg` recipe should not be hard.)
120
-
121
-
## `quickpkg` vs `munkipkg`
122
-
123
-
`quickpkg` is meant for 'quick' packaging. No configuration, no options. Download the application from the AppStore or the dmg or zip from the web and go. (I started working on it because I could never remember the exact options needed for `pkgbuild`.) [`munkipkg`](https://github.com/munki/munki-pkg/) is a tool that makes it easier to access the complex options of `pkgbuild` and `packagebuild`, but it still supports complex projects.
201
+
However, there are situations where `autopkg` does not work well. The most common reason is if the download cannot be automated because the download page is behind a paywall. Or maybe you are just experimenting with a test server and do not want to change your production `autopkg` setup. Also `autopkg` requires a recipe for a given piece of software. If no recipe exists, `quickpkg` may be a simple alternative. (Though if `quickpkg` works, creating an `autopkg` recipe should not be hard.)
124
202
125
-
If you prefer a UI rather than a command line tool, then use [Stéphane Sudre's Packages](http://s.sudre.free.fr/Software/Packages/about.html).
126
203
127
204
## Warning
128
205
129
-
All `quickpkg` does is identify an application bundle and package it in a way that the package will install that application bundle into the `/Applications` folder. If the application needs other files (libraries, frameworks, configuration files, license files, preferences etc.) to run and work they are your responsibility.
206
+
All `quickpkg` does is identify an application bundle and package it in a way that the package will install that application bundle into the `/Applications` folder (or another location specified with `--install-location`). If the application needs other files (libraries, frameworks, configuration files, license files, preferences etc.) to run and work they are your responsibility.
130
207
131
-
Also be sure to understand what you are running `quickpkg` against. If you run `quickpkg` on the disk image you get from DropBox or for the Adobe Flash Player, you will get a pkg that installs the DropBox or Flash Player installer in the `/Applications` folder. Probably not what you wanted.
208
+
Also be sure to understand what you are running `quickpkg` against. For example, when you run `quickpkg` on the disk image you get from DropBox, you will get a pkg that installs the DropBox installer in the `/Applications` folder. Probably not what you wanted.
0 commit comments