One of the recent changes for the macOS version of SAP GUI for Java is that both SapMachine Java 11 and OpenJFX 11 are now bundled with SAP GUI, so it is no longer required to have Java installed on your machine in order for SAP GUI to work. This change has also been extended to the SAP GUI installer, which is now available as a notarized installer application as of SAP GUI 7.70.
You can run this installer on a Mac which does not have Java already installed and it will install SAP GUI for Java with SapMachine Java 11 and OpenJFX 11 installations embedded inside the SAP GUI application.
Note: As of SAP GUI 7.70 rev 2, Rosetta 2 is required if installing on an Apple Silicon Mac so Rosetta needs to be installed and running before installing SAP GUI.
The installer application is available for download to customers via a link on the announcement blog post:
https://blogs.sap.com/2021/03/16/ann-sap-gui-for-java-7.70-available-for-download/
When you click the download link, you will see two choices:
The DMG download will provide the notarized installer application and the JAR download will provide the Java .jar installer that SAP GUI has traditionally used on macOS. I’ve discussed how to package the .jar installer in previous posts, so this post is going to focus on the new installer application contained inside the DMG download.
For more details, please see below the jump.
If you want to run the SAP GUI installer application without repackaging it as a macOS installer package, use the procedure below:
1. Download the disk image.
2. Mount the disk image.
3. Copy the SAP GUI for Java Installer application to a convenient location.
If you have a templates.jar file, copy the templates.jar file to the same location. As long as both files are in the same directory, the SAP GUI for Java Installer application will detect and use the templates.jar file’s contents to help configure SAP GUI.
4. Launch the SAP GUI for Java Installer application.
5. Follow the prompts to install.
To build an installer package for SAP GUI which uses the installer application, use the procedure shown below:
Building the SAP GUI installer
Pre-requisites:
1. Set up a new Packages project and select Raw Package.
2. In this case, I’m naming the project SAP GUI 7.70 rev2.
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 Tag section:
In the Post-installation Behavior section:
In the Options section:
7. Select the Payload tab. Nothing here should be changed from the defaults.
8. Select the Scripts tab.
Under the Additional Resources section, add the following files:
The last part is telling the SAP GUI for Java installer to run. For this, you’ll need a postinstall script.
Here’s the postinstall script being used for this installer package:
#!/bin/bash | |
install_dir=$(/usr/bin/dirname $0) | |
sap_gui_installer="$install_dir/SAP GUI for Java Installer.app" | |
sap_gui_install_path="/Applications/SAP Clients" | |
ERROR=0 | |
if [[ -x "$sap_gui_installer" ]]; then | |
echo "Attempting to install $sap_gui_install…" | |
"$sap_gui_installer/Contents/MacOS/install" -G –installdir "${sap_gui_install_path}" -J "${install_dir}" –force | |
if [[ $? -ne 0 ]]; then | |
echo "ERROR! Installation of $sap_gui_installer failed" | |
ERROR=1 | |
else | |
echo "Successfully installed $sap_gui_installer" | |
fi | |
else | |
echo "$sap_gui_installer not found or not executable." | |
ERROR=1 | |
fi | |
exit $ERROR |
If not already selected, select the postinstall script and add it to the project.
9. 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 installing it on a test machine which has the following:
The end result should be that the SAP GUI client installs into /Applications.
If a templates.jar file was included with the installer, the SAP GUI configuration files specified by the templates.jar file should also be installed.