[MacTUG] Packaging Tips #1: Firefox customized, with no user template

Donald Duff-McCracken dsmccrac at uwaterloo.ca
Tue May 2 19:54:26 EDT 2017


This is long, so if you are not interested don’t read on! ;-)

It would be nice if we shared how we package stuff. I usually write notes for my group anyhow, so why not share?  I will start with how I am packaging Firefox. I have been leaning on heavy UserTemplate customization and I moving away from this and this is an example.

It is pretty simple to create a customized Firefox install. I mainly want a custom homepage and bookmarks (without using the User Template method).  This can be done by modifying Firefox.app/Contents. While one can do it by hand, the Firefox Plugin CCK2 (available at https://mike.kaply.com/cck2/ ) is a nice way to start.

To use CCK2, install the plugin and fire it up (it is a little icon in the far right of the menubar). As you step through creating a ‘configuration’ you will:

  *   Give your configuration at name (eg: Lab Firefox) and an Identifier (eg ca.uwaterloo.env.labfirefox), a Description (optional), and Version # (optional)
  *   Select an output directory (where is will save the configuration)
  *   Step through a series of options for how you want to customize it. (see http://www.amsys.co.uk/2014/08/locking-firefox-cck-2/ for example of what you can do – TLDR). I just used ‘Web Pages’ (for homepage), and Bookmarks. It is straightforward and if it is a setting you don’t know about, just skip it.

When finished configuring, click the “Use AutoConfig” button to create an autoconfig.zip file in the output directory. (A cck2.config.json file will also get created which you can import back into CCK2 if you want to modify your configuration.) When you unzip you autoconfig.zip file, you will have a bunch of goodies. The main thing you need to do is to place a few files within the Firefox.app directory structure (using the right-click Show Package Contents method).

  *   "cck2.cfg" file and the "cck2" directory should be placed in /Firefox/Contents/Resources/
  *   "defaults/prefs/autoconfig.js" file in  /Firefox/Contents/Resources/defaults/pref/

The files it generates are easy to understand. If I want to add something simple (like a bookmark) is just edit the cck2.cfg file versus redoing it.
The one thing that CCK2 seems to not be able to do is stop first time importing of Safari bookmarks but it is easy:

  *   create a file called overide.ini
  *   have it contain the following text:
[XRE]
EnableProfileMigrator=0
  *   Place this in Firefox.app/Contents/Resources/browser  (see https://www.jamf.com/jamf-nation/discussions/22817/disable-import-wizard-at-first-launch-mozilla-firefox-50-mac-sierra )
PACKAGING
Given how often Firefox updates, it would be a shame to do to all this work every week when a new version of Firefox comes out. You have a few options, for example:

  *   Create a PKG in Packages that is a Distribution (which can contain more than one sub package) and have it first install Firefox.app and then have a second package with all the files that need to be squirreled away. I am currently doing this.
  *   Write a script that tosses the files into the new copy of Firefox
  *   Use an AUTOPKG recipe (or find one). I am going to look at this now that I realize AutoPKG is not just for Munki users!
  *   Have a couple of packages, the first installs Firefox, the second modifies it,
  *   Etc etc

See also:
https://developer.mozilla.org/en-US/Firefox/Enterprise_deployment



------------------------------------
Donald Duff-McCracken
Technical Services Manager
Mapping, Analysis & Design
Faculty of Environment
University of Waterloo
(519) 888-4567 x32151
https://uwaterloo.ca/environment-computing/about/people
------------------------------------
This email communication is intended as a private communication for the sole use of the primary addressee and those individuals listed for copies in the original message. The information contained in this email is private and confidential and If you are not an intended recipient you are hereby notified that copying, forwarding or other dissemination or distribution of this communication by any means is prohibited.  If you are not specifically authorized to receive this email and if you believe that you received it in error please notify the original sender immediately.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.uwaterloo.ca/pipermail/mactug/attachments/20170502/03750d5a/attachment-0001.html>


More information about the MacTUG mailing list