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.
Prerequisites:
- Packages
- 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 13.0.0.0
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:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Determine working directory | |
install_dir=`dirname $0` | |
# Install DNAStar using InstallBuilder's unattended mode | |
$install_dir/"DNASTAR Lasergene Installer.app/Contents/MacOS/installbuilder.sh" –mode unattended | |
# When installing DNAStar with root privileges using InstallBuilder's unattended mode, it will install | |
# files and directories using the following permissions: | |
# | |
# Owner: system (aka root): read/write/execute permissions | |
# | |
# Group: staff: read/execute permissions | |
# | |
# Everyone: read/execute permissions | |
# | |
# | |
# This section fixes the permissions on the referenced files so that they're set to the following: | |
# | |
# Owner: system (aka root): read/write/execute permissions | |
# | |
# Group: admin: read/write/execute permissions | |
# | |
# Everyone: read/execute permissions | |
# | |
# Fixing /Applications/DNASTAR | |
/usr/bin/find "$3/Applications/DNASTAR" ! -group admin -exec chown root:admin {} \; | |
/usr/bin/find "$3/Applications/DNASTAR" ! -perm 775 -exec chmod 775 {} \; | |
# Fixing /Library/Application Support/DNASTAR | |
/usr/bin/find "$3/Library/Application Support/DNASTAR" ! -group admin -exec chown root:admin {} \; | |
/usr/bin/find "$3/Library/Application Support/DNASTAR" ! -perm 775 -exec chmod 775 {} \; | |
# Fixing DNAStar-installed fonts | |
# This section fixes the permissions on the referenced font files so that they're set to the following: | |
# | |
# Owner: system (aka root): read/write/execute permissions | |
# | |
# Group: wheel: read/execute permissions | |
# | |
# Everyone: read/execute permissions | |
# | |
/usr/bin/find "$3/Library/Fonts/protein chem &spaceBW" ! -group wheel -exec chown root:wheel {} \; | |
/usr/bin/find "$3/Library/Fonts/protein chem &spaceBW" ! -perm 755 -exec chmod 755 {} \; | |
/usr/bin/find "$3/Library/Fonts/ProtePla" ! -group wheel -exec chown root:wheel {} \; | |
/usr/bin/find "$3/Library/Fonts/ProtePla" ! -perm 755 -exec chmod 755 {} \; | |
/usr/bin/find "$3/Library/Fonts/ProteSpaBW" ! -group wheel -exec chown root:wheel {} \; | |
/usr/bin/find "$3/Library/Fonts/ProteSpaBW" ! -perm 755 -exec chmod 755 {} \; | |
# Read the the DNAStar install log into /var/log/install.log then delete | |
# the DNAStar install log from /Applications/DNASTAR | |
if [[ -e "$3/Applications/DNASTAR/Lasergene 13 Install.log" ]]; then | |
/bin/cat "$3/Applications/DNASTAR/Lasergene 13 Install.log" | |
/bin/rm "$3/Applications/DNASTAR/Lasergene 13 Install.log" | |
fi | |
exit 0 |
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.)
Testing
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.
Hi Rich, all apps works except Protean 3D this gives an error at startup with an message “an error has occurred See the log file
/Users/user/Library/Prefrences/DNAStar/pretean3D/instance/.metadata/.log
Is in your environment Protean3D working? (if i use the installer from DNASTAR there is no problem)
greetings
Peter-Erik
Peter-Erik,
Protean 3D is opening without issues for me:
Thanks for reply,
Found the problem ; In the Lasergene 13 Data folder there is an folder with Chemical Component Dictionary for some reason the rights for “everyone” is on “Read only” but must be changed to “Read & Write” , next how to fix this at installation.
Hi, Rich, how about make cracked package for no IT background user?
Hi Rich,
I bumped into your post today and would like to offer my assistance. We both can agree that you should not have to perform such grand measures to modify an installer to meet your needs. If you are willing, please contact DNASTAR support (https://www.dnastar.com/f-tech-submit.aspx), mention my name, and we can work toward fixing the issues you have discovered.
Best regards,
Steve Darnell (Principal scientist, DNASTAR)
Hi Peter-Erik,
I am the team lead for the Structural Biology suite, which includes Protean 3D. We changed the permissions scheme for the Chemical Component Library in the last release to resolve this crash issue. I am sorry you had to discover a workaround on your own just to launch Protean 3D.
Best,
Steve
Hi Steve, any idea of the new version 15 has an .pkg installer or is it the same as before so we still need this manual to covert the installer to the one we can roll out to our users. thanks & greetings
Word to the wise, there is a bug into v150a after installation SegMan Pro error cant find Vectors.vct etc.. DNASTAR is aware of this problem . (this problem is also without Rich solution)
You can fix this manually at this time
Still works with version 15.1 😀