-
Notifications
You must be signed in to change notification settings - Fork 4
Using Script2Pkg
To create a payload-free package using this app, you will need two things:
- The app
- A script
Once you have both of those items available, please use the procedure to create a payload-free package.
- Launch the app.
-
Click the
Select scripts
button. -
In the window which appears, select the script(s) you want to use and click the
Build
button.
- Installer package(s) will be created and stored in the same location as the script(s) which were selected. Each installer package will have the same name as the source script.
To create a signed payload-free package using this app, you will need these things:
- The app
- The app configured for signing
- A script
Once you have all items available, please use the procedure to create a signed payload-free package:
- Launch the app.
- Select the
Sign packages
option.
-
Click the
Select scripts
button. -
In the window which appears, select the script(s) you want to use and click the
Build
button.
- Installer package(s) will be created and stored in the same location as the script(s) which were selected. Each installer package will have the same name as the source script.
The app is able to sign existing packages. This allows you to sign an existing package that not has been signed or to resign a package with an expired signature. Once you have an installer package you want to sign, please use the procedure below:
- Launch the app.
- Make sure the
Sign packages
option is selected.
- Under the
File
menu, chooseSign Existing Package…
- Select the package you want to sign and click the
Sign
button.
- If the package is already signed, the app asks you if the existing signature should be replaced. Click the
Replace
button to continue.
- The app will report back if signing was successful.
To create a notarized payload-free package using this app, you will need these things:
-
The app
-
A script
Once you have all items available, please use the procedure to create a signed and notarized payload-free package:
- Launch the app.
- Select the
Sign packages
option.
- Select the
Notarize packages
option.
-
Click the
Select scripts
button. -
In the window which appears, select the script(s) you want to use and click the
Build
button.
- Installer package(s) will be created and stored in the same location as the script(s) which were selected. Each installer package will have the same name as the source script.
The app is able to notarize existing packages. Once you have an installer package you want to notarize, please use the procedure below:
- Launch the app.
- Make sure the
Sign packages
and theNotarize packages
options are selected.
- Under the
File
menu, chooseNotarize Existing Package…
- Select the package you want to notarize and click the
Notarize
button.
Notarizing a package (especially very large ones) may take a while…
- The app will report back if notarization was successful.
You may need to create an installer package where you need to provide additional resources to the script you're trying to package into an installer package. These resources may be an additional script, an application binary, or even another installer package. This tool provides an option for doing so, with the following requirements:
You must create a folder. Inside the folder, you must have at least one script named exactly as follows:
preinstall
postinstall
These scripts must also be set as executable files. The reason is that two categories of scripts have been defined for use with installer packages:
-
preinstall
: Thepreinstall
script is run before files are being installed. If the script does not return an exit status of zero, Installer will cancel the installation. -
postinstall
: Thepostinstall
script is run after files have been installed. If the script does not return an exit status of zero, Installer will declare the installation failed.
The names of the scripts must also be exactly as described, as the Installer application can only use executable files with those names as scripts which can run pre-installation and post-installation actions. If the file names are different, Installer will not recognize or use them.
Once you have all items available, please use the procedure to create the package:
- Launch the app.
- If you want to sign the installer package you're creating, make sure at least the
Sign packages
option is selected. Also select theNotarize packages
option if you want the package to be notarized.
-
Click the
Select scripts
button. -
In the window which appears, select the folder containing your components and click the
Build
button. In this example, thejq
binary is included besides thepostinstall
script, so thepostinstall
script can runjq
right from within the package without installing it.
- The installer package will be created and stored in the same location as the folder which was selected. The installer package will have the same name as the source folder.
The app is able to check any installer package and report on the following:
-
if the installer package is signed with a valid code signing certificate
-
if the installer package is signed with a valid code signing certificate and notarized
Once you have an installer package that you want to check, please use the procedure below to validate its status:
-
Launch the app.
-
Under the
File
menu, chooseValidate Package Signature…
- Select the package you want to check and click the
Validate
button.
The app will report back on the package signing and notarization status.
Package not signed or notarized
Package signed with an expired certificate
Package signed with a valid certificate and not notarized
Package signed with a valid certificate and notarized
To configure notifications about new packages following their creation, use the following procedure:
- Go to the
Script2Pkg
menu and selectSettings…
- Select the
General
option.
- To enable notifications, select the
Show notification when packaging has been finished
option.
With the the Show notification when packaging has been finished
option enabled, creation of new packages will include a notification from Notification Center similar to the one shown below.
Reverting to Default Settings
To reset back to the default settings, de-select the Show notification when packaging has been finished
option.
By default, new packages will be stored in the same location as the selected script(s). If you want to choose an alternate storage location, use the following procedure:
- Go to the
Script2Pkg
menu and selectSettings…
- Select the
Locations
option.
To change the location where packages are stored following their creation, select the Package location:
drop-down menu and select a new location.
Reverting to Default Settings
To change back to the default location, select the Package location:
drop-down menu and select the Same as script
option.
By default, new packages with the same name as an existing package stored in the same location will be re-named to avoid having the same name as the existing package. This behavior can be changed to overwrite the existing package.
To configure new packages to automatically overwrite existing packages as part of the package creation process, use the following procedure:
- Go to the
Script2Pkg
menu and selectSettings…
- Select the
Locations
option.
- Select the
If package exists:
drop-down menu and chooseOverwrite new package
.
Reverting to Default Settings
To change back to the default setting, select the If package exists:
drop-down menu and choose Rename new package
.
All macOS installer packages need an identifier so that macOS can recognize if a package is a new installation or an upgrade from a previously-installed installer package.
By default, the package identifier used by the app will begin with the following: corp.sap.Script2Pkg
This is referred to in the context of the app as the identifier prefix . The remainder of the identifier will be a UUID. For example, using the default settings will may result in a package with the following package identifier:
corp.sap.Script2Pkg.5BA0E8CB-99B2-4FC2-85AE-0C1CC85ACC05
If you want to choose an alternate identifier prefix, use the following procedure:
- Go to the
Script2Pkg
menu and selectSettings…
- Select the
Packaging
option.
- Click in the
Package identifier prefix:
entry blank and enter whatever you want as the new identifier prefix. Packages created by the app will now use this identifier prefix, followed by a UUID, as the package identifier.
If you want to have whatever you entered into the Package identifier prefix:
entry blank to be the complete package identifier, enable the Use prefix as fixed package identifier option.
Packages created by the app will now use the identifier prefix as the package identifier. No UUID information will be added to the package identifier.
Reverting to Default Settings
To reset back to the default settings, remove the current entry in the Package identifier prefix:
entry blank. If applicable, also uncheck Use prefix as fixed package identifier
option.
Installer package receipt files are used by macOS to maintain a record of what the Installer application has installed. For more information on installer package receipts, please see the FAQ
Normally, a receipt file is created each time you install new software via a package file but there is an exception to this rule: payload-free packages normally do not install any files and do not leave a receipt behind.
By default, installer packages created by this tool will not leave an installer package receipt when the package is installed. If you need to create installer packages which leave package receipts, use the following procedure:
- Go to the
Script2Pkg
menu and selectSettings…
- Select the
Packaging
option.
- Enable the
Create package receipts
option.
Reverting to Default Settings
To reset back to the default settings, uncheck the Create package receipts
option.
A macOS installation package can have an optional version number. This is most useful if the installer package leaves a receipt, as the package identifier and version information are included in the receipt. For more information on installer package receipts, please see the Glossary.
By default, the package version used by the app will be the following: 1.0.0
If you want to choose an alternate version number, use the following procedure:
- Go to the
Script2Pkg
menu and selectSettings…
- Select the
Packaging
option.
- Click in the
Default package version:
entry blank and enter whatever numeric value you want as the new version number. Packages created by the app will now use this as the package version number.
You can also set the app to try and detect version information from the script’s filename. For example, if the script is named as follows, the app can be set to detect the version information and use it when creating the package: example_3.0.0.sh
-
Go to the
Script2Pkg
menu and selectSettings…
-
Select the
Packaging
option. -
Enable the
Use package version from script name if possible
option. Packages created by the app will now try to identify version information from the script’s name and use that information as the package version number.
Reverting to Default Settings
To reset back to the default settings, remove the current entry in the Default package version:
entry blank. If applicable, also uncheck the Use package version from script name if possible
option.
By default, installer packages created by this tool are component packages, but you can set the tool to create distribution packages instead of component packages. Distribution packages are a special format of installer packages and Apple requires their use in place of using component installer packages in certain circumstances. For more information on component and distribution packages, please see the Glossary.
If you need to create distribution packages, use the following procedure:
- Go to the
Script2Pkg
menu and selectSettings…
- Select the
Packaging
option.
- Enable the
Create distribution packages
option.
Reverting to Default Settings
To reset back to the default settings, uncheck the Create distribution packages
option.