Deploying Sophos Anti-Virus Home Edition for Mac 9.2.x for personal use
With the release of Sophos Anti-Virus 9.x, Sophos changed how their antivirus solution for Macs was installed. Where previous versions of Sophos used an installer package, Sophos has now switched to using an application to install their antivirus.
This switch was a problem for Mac admins who wanted to deploy Sophos Home Edition 9.x for personal use, as there was not an available installer package to simplify the task of deployment. Sophos Home Edition 9.2.x added additional complexity by storing many of the installer’s files and other components outside the installer in a separate Sophos Installer Components directory.
However, after doing some research and testing, it looks like it is possible to repackage Sophos Home Edition 9.2.x for personal deployment. For more details, see below the jump.
Sophos’ installer application can be run from the command line using the InstallationDeployer tool and include both install and remove switches. Here’s how to install and uninstall Sophos 9.x using the free Sophos Home Edition installer application:
/path/to/Sophos\ Anti-Virus\ Home\ Edition.app/Contents/MacOS/InstallationDeployer --install
/Library/Application\ Support/Sophos/he/Installer.app/Contents/MacOS/InstallationDeployer --remove
With these commands, it’s possible to add the Sophos install application and the Sophos Installer Components directory to an installer package and run the needed command(s) as a postinstall script.
Once I had this information and understood what was going on, here’s how I repackaged Sophos Anti-Virus Home Edition 9.2.x so that it could be deployed via an installer package.
- Sophos Home Edition 9.2.x install application and the associated Sophos Installer Components directory.
1. Set up a new Packages project and select Raw Package.
2. In this case, I’m naming the project Sophos Anti-Virus Home Edition 9.2.2.
3. Once the Packages project opens, click on the Project tab. You’ll want to make sure that the your information is correctly set here (if you don’t know what to put in, check the Help menu for the Packages User Guide. The information you need is in Chapter 4 – Configuring a project.)
In this example, I’m not changing any of the options from what is set by default.
4. Next, click on the Settings tab. In the case of my project, I want to install with root privileges and not require a logout, restart or shutdown.
To accomplish this, I’m choosing the following options in the Settings section:
- In the Post-Installation Behavior section, set On Success: to Do Nothing.
- In the Options section, check the box for Require admin password for installation.
5. Click on the Scripts tab in your Packages project.
6. Select the Sophos Home Edition install application and the associated Sophos Installer Components directory, then drag both into the Additional Resources section of your Packages project.
7. The last piece is telling the Sophos install application to run. For this, you’ll need a postinstall script. Here’s the one I’m using:
8. Once you’ve got the postinstall script built, run the following command to make the script executable:
sudo chmod a+x /path/to/postinstall
9. Once completed, add the postinstall script to your Packages project.
10. Last step, go ahead and build the package. (If you don’t know to build, check the Help menu for the Packages User Guide. The information you need is in Chapter 3 – Creating a raw package project and Chapter 10 – Building a project.)
Testing the installer
Once the package has been built, test it by taking it to a test machine where Sophos is not installed and install it. The end result should be that Sophos Anti-Virus Home Edition installs properly.
Note: If you’re installing Sophos Home Edition, it should be for personal use only. I would not recommend using Home Edition at a business because that’s not what it’s meant for. For more information, the governing EULA here is Sophos’ End User License Agreement for Consumers (see the RIGHTS AND RESTRICTIONS section):