📜 ⬆️ ⬇️

Step-by-Step: Preparing Mac OS Installation Packages. Part two. Package Creation in Package Maker

The first part of the article is here .

As an example, we will demonstrate the creation of the Mozilla Firefox 31.5.3 esr installation package in the Pakage Maker environment . Firefox is quite popular among our customers and at the same time is quite revealing.

To get started, download the latest version of the package from the official site (at the time of this writing, Mozilla Firefox 31.5.3 esr was available). Run the DMG file on the MAC machine. Firefox.app is portable to Applications:
')
image
(under the cut a lot of photos)


Launch Firefox -> Don't import anything

image

Default Browser -> set a tick so that no more window appears and click No

image

Options -> General set the homepage www.google.ru in the Home Page field

image

Options -> Data Choices disables Enable Telemetry and Enable Firefox Health Report

image

Options -> Update select Never check for updates

image

Next, create a project folder Mozilla Firefox 31.5.3 esr where we will place all the files that will be needed for the package. Run the Package Maker, fill in the Organization and Minimum Target, as shown in the picture:

image

We register title Title:

image

From Applications, select Firefox.app and copy to the project folder (Mozilla Firefox 31.5.3 esr), then transfer it to Contents. A new Choice is created, in which we register the Choice Name, Identifier.

image

We put the installation path (Destination) and fill in the Package Identifier, later this identifier is used for Upgrade.

image

We issue the rights for Firefox.app root: wheel, as shown below:

image

On the Components tab, uncheck Allow Relocation, otherwise the application may not get to the desired folder during the test installation.

image

Copy user settings that are stored in ~ / Library / Application Support / Firefox, after deleting all unnecessary in the project folder and creating another Choice.

image

In the Destination field, set the path from which the user settings will be copied.

image

Assign root: wheel, as shown below:

image

To copy settings to users, create a mozilla.firefox.plist file in which we write the following:

image

Program Arguments specify the path to the script that will be executed when the user first logs into the system. After that, create another Choice.

Notice the LaunchOnlyOnce and RunAtLoad flags, i.e. run the script when the user logs in and only once.

image

This plist file is installed in / Library / LaunchAgents

image

And we issue the rights as shown below:

image

Create an applysettings.sh script that will copy from "/ Library / Cashes / Mozilla to the user:

#! / bin / sh
/ bin / cp -r "/ Library / Cashes / Mozilla /" ~ / Library / Application \ Support /

Create another Choice for the script:

image

Set the Destination and Package Identifier:

image

We assign the same rights as for the Choice Application.

After all the settings have been applied, for the package do Project-> Build

image

Make Save and wait for the finished package.

image

The demo package is ready and you can check it on the client machine. After installation, you need to make a log-off, so that the settings for the user are applied (the script is launched through launch agents).

I would also like to add that Package Maker supports apple script, which can be run before and after installing the package. Another nice feature of Package Maker is a set of template scripts, such as: Get Application, Kill Application, Open File, Open URL. They can be run at the beginning or at the end of the package installation.

For the convenience of developing and testing packages, we developed a number of scripts, utilities (programs) that allow us to increase the speed of developing solutions and maintain their high quality, but we will tell about this in more detail in the next article.

The resulting PKG package can be deployed using the same deployment systems (for example, SCCM 2012) on thousands of computers in a few clicks, and there is no need to configure it on the user side. In the end, users are happy, just like us :)

Posted by: Eduard123

Source: https://habr.com/ru/post/256985/


All Articles