Creating a DNAStar Lasergene 13.x installer
As part of my day job, I support some medical research software packages that most Mac admins have likely never heard of. One of these software packages is DNAStar‘s Lasergene software suite. Up until now, this software used an Installer VISE installer, which required me to completely repackage the software for deployment. However, as of Lasergene 13.x, DNAStar has switched to using Bitrock’s InstallBuilder for the Lasergene installer. This tool does not produce standard installer packages, but InstallBuilder installer applications do support installation and uninstallation via the command line. That allows me to run an installation or uninstallation of the Lasergene suite by using the commands shown below:
To install a copy of DNAStar Lasergene which uses a network license server:
"/path/to/DNASTAR Lasergene Installer.app/Contents/MacOS/installbuilder.sh" --mode unattended
To install a copy of DNAStar Lasergene which uses an individual license code:
"/path/to/DNASTAR Lasergene Installer.app/Contents/MacOS/installbuilder.sh" --dnastarProductKey XXXXX-XXXXX-XXXXX
To uninstall DNAStar Lasergene:
"/Applications/DNASTAR/Uninstall Lasergene 13.app/Contents/MacOS/installbuilder.sh" --mode unattended
While this installation method is still not ideal, I can at least script it. That makes it an improvement over the hand-crafted installers I previously had to create for Lasergene.
Unfortunately, there is a quirk of Lasergene’s installation process which carries over from the Installer VISE days, which is that the Lasergene installer assumes that the account running the installation is going to be the owner of the application. So if you install Lasergene as your local admin, that may mean that your users aren’t able to run the Lasergene applications because they may not have permission to run the applications or access one or more of the application data files.
To address both the installation and permissions issues, I was able to create an installer using this method that handles both the installation and then fixing the permissions as a post-installation task. For more details, see below the jump.
In this example, I’m creating an installer package which will install both the DNAStar Lasergene software and the configuration needed to connect to a DNAStar network license server.
- The latest DNAStar Lasergene installer application
- The appropriate network license files from DNAStar.
1. Set up a new Packages project and select Raw Package.
2. In this case, I’m naming the project DNAStar 18.104.22.168
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 DNAStar Lasergene installer application and associated network license files and drag them into the Additional Resources section of your Packages project.
7. The last piece is telling the Lasergene installer to run, then fix the permissions after the software is installed. For this, you’ll need a postinstall script. Here’s the one I’m using:
Notice that $install_dir in the postinstall script refers to the path to the package’s working directory. That’s where Packages will be storing the Lasergene installer application along with the associated network license files, inside the Package-built installer’s embedded directory where it stores the items defined in the Additional Resources section.
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.)
Once the package has been built, test it by taking it to a test machine that does not have DNAStar Lasergene installed and install it. The end result should be that Lasergene installs with the correct permissions.