New Administrator Mode installers -- Testers required!

Hello Jalviewers,

If you are an admin managing Jalview installations on macs, windows, linux or other unix machines, or interested in how Jalview can be installed on machines used by many people, then read on!

Background

Since Jalview’s new desktop installers were released in 2019, the Jalview desktop application has had an automatic update capability that, not ideally, required Jalview to be installed in the user-space of the user running Jalview. The automatic updates is really important and reduces most user problems dramatically.

This is mostly fine for a single-user machine or laptop, but has meant that a proper grown-up multi-user installation (e.g. into C:\Program Files\Jalview on Windows or /opt/jalview on Linux/Unix or /Applications for multi-user Macs) has not been possible.

We’ve had very useful feedback and suggestions from a few System Administrators who would like to install Jalview in a system location for use by all users.

Administrator installation and system-space user launches

For the last couple of months we’ve been working on an Administrator mode for the installers that puts an installation of Jalview in a more conventional location on the system. When launched, Jalview will still automatically update for users by downloading updated components into a location in the user’s space. This allows Jalview to be installed in an expected and common place, with an updated version running when any user launches Jalview.

Headless installation

Headless unattended installations (alongside the regular GUI methods) are available for all the platforms we support, using the same install4j installers for Windows, Linux (x64/aarch64), other Unixes and a bespoke installation script for macOS that will (optionally download and) install the Jalview.app from the usual DMG file (also headless).

Administrator GUI installation still available!

Of course you can also use the installers in GUI mode. In Windows it will ask for Administrator privileges and in Linux/Unix you should run it with sudo to get the Administrator mode. On macOS you can just open the DMG file in Finder and drag Jalview.app to /Applications as usual and you will get the default user-space updatable settings (though you won’t be able to tweak those settings as easily).

Setup options

Not every sysadmin’s requirements are the same, so there are options to change how Jalview behaves, including disabling the user-space updates (so that no updates occur), and changing the location that user-space updates are stored in.

Updating the system installation

Since the installation of Jalview will not be automatically updated, we now bundle a script that can be run headlessly to update the updatable components of Jalview in the installation location without launching Jalview. There are bash and PowerShell versions to ensure cross-platform compatibility (the bash script will run in Linux, Unix, macOS, Cygwin and Windows Subsystem for Linux, and the PowerShell script will run on Windows 10/11, macOS and Linux if you have pwsh installed). These scripts should work out of the box without any non-standard dependencies.

We need you :index_pointing_at_the_viewer: !

If you would like to test these new installers, and the new user-space updates, to help us iron out any bugs or find missing essential options/features, please download the latest version of the Jalview Test installers (you will need to re-install Jalview Test if you have installed it before). If you are going to try this out, please let us know in a reply to this topic!

Downloads

You can test these new capabilities with the latest Jalview Test installers, which will install a Test version of Jalview alongside any existing installation of Jalview. It should not interfere with your existing installation of Jalview!
https://www.jalview.org/development/jalview_test/
For macOS, the DMG will work fine but if you want to try the headless installer script (macos-install-jalview.sh) which has more options (including setting the PATH correctly), see the further details in the post below.

The details

Details of what we mean by user-space updates and the installation options used to alter this new behaviour can be found in the next post in this topic.

The details

User-space updates

By default a new installation of Jalview will assume it cannot be written to by the launching user, and will store the updatable components of Jalview (which amounts to about 55MB) in a user-space location. The default location varies depending on the OS:

OS default user-space location
Windows ~\AppData\Local\Jalview-Desktop\Jalview_Test\HASH\app
macOS ~/Library/Application Support/Jalview‑Desktop/Jalview_Test/HASH/app
Linux ~/.local/share/jalview-desktop/jalview_test/HASH/app
Other ~/.jalview-desktop/jalview_test/HASH/app

where HASH is an 8-character SHA256 hash of the installation folder (to distinguish between multiple installations).

Use of these user-space folders can be disabled if desired (see Additional options for headless mode below)

Windows EXE / Linux SH / Unix SH installers

The Windows/Linux/Unix installers are created by install4j, and can be run in GUI mode (the default) or in Console mode (not recommended – the file associations choice stage is not lovely!), or in Unattended mode (the recommended headless installation method). There are existing options documented in the Jalview website Download section (see the Installation notes for each OS) with more detail on the install4j help pages.

Additional options for headless mode

The following additional options can now be used when running the install4j installers in either Console or Unattended mode.

option              action
-a folder Install Jalview into folder (the same as install4j’s -dir)
-U Disable user-space updates
-u template Install user-space updates into template instead of the default location
-S Disable all updates

macOS installer

For macOS we don’t distribute an installer programme, but instead distribute the Jalview.app in a DMG (disk image) file (also made by install4j) that opens in a Finder window with an arrow to suggest the user drags the Jalview.app to the Applications folder where it will be copied. This is a very common and simple way for users to install an application in macOS.
This can still be done by an Administrator, and the default behaviour means that all users on the system will be able to run Jalview.app (with any updates downloaded to their user-space folder).

However, we now also have a bash script, macos-install-jalview.sh, to allow a headless installation of Jalview. Its installation options can be adjusted like the install4j installers. This script can also optionally download the latest version of the DMG for a particular channel (release, test-release or develop), perform a SHA256 check on the DMG file it downloaded, and will then headlessly mount the DMG, copy Jalview.app, and then unmount and delete any downloaded DMG. Alternatively you can tell it to use an already downloaded/created DMG file.

One big advantage the macOS installer script has over using the DMG on its own is that it adjusts all users’ PATH by adding a file /etc/paths.d/Jalview_Test-HASH so that the jalview_test command line is available to all users in their PATH.

The script’s options are:

option              action
-h Help (usage statement)
-d Download the latest DMG for the channel
-i dmgfile Use existing dmgfile instead of downloading
-c channel Use channel channel (defaults to release, can also be test-release, develop)
-a folder Install Jalview.app into folder (defaults to /Applications)
-U Disable user-space updates
-u template Install user-space updates into template instead of the default location
-S Disable all updates (if you use -U you probably want this too)
-y Don’t ask for confirmation (probably needed for an automated install)

There are some other less important options too that you can see in the usage statement (-h).

The user-space path template

One of the options:

option              action
-u template Install user-space updates into template instead of the default location

allows you to change the base of the path that the user-space updates will be downloaded to. The default base path depends on the OS, as detailed above, but there might be a reason (some kind of slow network drive maybe) that you want to change where the user-space updates will be downloaded to. You can set that with the -u option.
The template has various substitutions made to it, and you should include one of these substitutions to avoid collisions of user-space updates:

value substitution
~/ (at the start) User’s home directory/
%u User’s username
%h User’s home directory

e.g.
-u /tmp/jalview-desktop/%u
will set the user-space updates to install in
/tmp/jalview-desktop/username/jalview_test/HASH/app .

Running the installers in Administrator mode

Windows

For the Windows installer, if you launch the GUI with an Administrator account then it will ask if it can have Administrator privileges. On the command line you must launch it in a Terminal, or equivalent, that already has Administrator privileges.
In Administrator mode the default installation location is
C:\Program Files\Jalview_Test .
This can be changed with the -a option.

Linux/Unix

To run the installer in Administrator mode it must be launched with bash in a root environment, e.g. with sudo:
sudo bash jalview_test-...sh
or in unattended mode:
sudo bash jalview_test-...sh -q
In Administrator mode the default installation location is
/opt/jalview_test .
This can be changed with the -a option.

macOS

macos-install-jalview.sh should be run with sudo:
sudo macos-install-jalview.sh -d -c test-release
to allow Administrator privileges – definitely needed to add a file to /etc/paths.d.
The default installation location is /Applications, which can be changed with the -a option.

https://www.jalview.org/downloads/installers/macos-install-jalview.sh

Download the above file and run
sudo bash ./macos-install-jalview.sh -d -c test-release
to then download and install the latest Jalview Test (which has these features – the release channel doesn’t, so it won’t do any of the things being described here… yet!).

Presently this file isn’t linked to on the Jalview website.

Updating your Jalview installation

When new releases of Jalview come out we highly recommend that your installation should be updated. However this doesn’t mean a re-installation since Jalview already has an updating component (shout out to Getdown!) – it’s just been disabled in the installation folder.

Bundled with Jalview is an updater script that will just run the updating component, headlessly (no splash screen), and without launching Jalview afterwards, for the installation the script is found in.

As with the jalview command line launch there are both bash and PowerShell versions of the update script to ensure cross-platform compatibility. The bash version will work in macOS, Linux, Unix, Cygwin and WSL, and the PowerShell version will work in Windows 10/11 Terminal or Command Prompt (there is a wrapping .bat file that launches the PowerShell script), as well as in macOS and Linux should you have pwsh installed and dare to try!
This script can be found in the installation, and on macOS and Windows (if you didn’t disable the add to PATH option at installation time) it will be in your PATH, so running

jalview_test_update

should find it. If you have multiple installations of Jalview (Test) then you should use a full path to the installation and the script is in the bin folder on Windows and Linux, and in .../Jalview.app/Contents/MacOS on macOS.
It requires one of two options:

option action
--installation updates the installation folder
--userspace updates the user-space folder for the user running the script

If you are running with --installation then you will need to be in an Administrator mode Terminal on Windows, or use sudo on macOS or Linux, e.g.:
sudo jalview_test_update --installation
or
jalview_test_update --installation on Windows.
If you need a full path, you’ll need to do something like
"C:\Program Files\Jalview Test\bin\jalview_test_update" --installation

Problems/issues

If you run across any problems, niggling issues, or just find something so unintuitive that you couldn’t do it, please comment in this Topic. We will do our best to add functionality :tada: or fix something broken :wrench: .

Thank you! The :jalview: Team

The unnecessary detail

The -U, -u and -S options in the installers adjust Jalview’s update behaviour by setting certain Java system properties that get passed to the Getdown updater/launcher. These are stored in a file called
On macOS: .../Jalview.app/Contents/vmoptions.txt
On everything else: .../Jalview/jalviewg.vmoptions
and if you want to adjust your settings post-installation, you can uncomment/comment out the system properties that get set in that file. There are notes in the file to figure out what to do.

I tried installing it on Ubuntu 20.04 using the GUI installer with default values and I have several comments and issues:

  • neither jalview_test_update nor jalview_test_update.sh exist in /opt/jalview_test/bin
  • Running any of the bash executables in the {user installation}/bin prints
    Cannot find bundled java, using system java and hoping for the best!
    and then launches with system java
  • Running bash /opt/jalview_test/bin/update.sh --userspace causes an error
    LAUNCHER: Running update only
    LAUNCHER: DEBUG - Got launcher versions ‘1.8.3-1.5.2_JVL’ and ‘1.8.3-1.5.2_JVL’
    Directory ‘/home/mmwarowny/.local/share/jalview-desktop/jalview/ce226442/app’ doesn’t exist, cannot update getdown-launcher.jar.
    Note that it looks for …/jalview/ce226442 instead of …/jalview_test/ce226442
  • After the first launch, for each script file in the {user installation}/bin directory jalview created empty files having the script name with “v” appended to it (e.g. jalview.ps1v, jalview.shv)
1 Like

Thanks @mmwarowny for the good detail. I have been able to resolve the first and third points. The fourth point is a by-product of the getdown launcher updates, and so (unfortunately) expected.

I haven’t been able to replicate the second point (Cannot find bundled java). Could you run one of those scripts (jalview_test will probably be most informative) with --debug and paste the output here? I’m not sure there’ll be anything more informative but there might be.