Skip to content

Developer Notes

Johann N. Löfflmann edited this page Oct 27, 2024 · 1 revision

How to create the .app and .dmg

1. Download and install the Platypus command line tool

The .app will be created by the Platypus command line tool. Platypus is a great tool create Mac apps from command line scripts. Go to https://sveinbjorn.org/platypus, download and open Platypus, select "Settings..." from the Platypus menu and install the command line tool.

2. Clone the sources

Clone or download the sources from the GitHub project:

% git clone https://github.com/jonelo/jacksum-for-macos.git
% cd jacksum-for-macos/

Note: if you haven't installed git yet, Apple's Install Command Line Developer Tools will install it for you.

3. Build both the .app and the .dmg

Open a Terminal and run

% ./bin/make_all.sh

That will build the .app and wrap it in a .dmg. You find both the .app and the .dmg in the folder called ./output/.

4. Open the .dmg and test the .app

% open ./output/*.dmg

How to update the .app and .dmg

Update HashGarten.app

Get the latest jacksum*.jar, HashGarten*.jar, and flatlaf*.jar

FILE=https://github.com/jonelo/jacksum-for-linux/releases/download/v2.9.0/jacksum-3.7.0-hashgarten-0.18.0-for-linux-2.9.0.tar.bz2
cd resources/app/HashGarten.app/Contents/MacOS/lib/
mkdir -p /tmp/$$
curl -L -o /tmp/$$/my.tar.bz2 $FILE
tar xfvj my.tar.bz2 "jacksum-for-linux/*.jar"
cd -
rm *.jar
cp /tmp/$$/jacksum-for-linux/*.jar .

Update the configs

vi config/make_all.cfg

and change

APP_VERSION=3.7.0 <-- jacksum version
DMG_VERSION=2.4.0 <--- installer version

vi config/make_app.cfg

and change

APP_JAR_FILE_HASHGARTEN=...
APP_JAR_FILE_FLATLAF=...

vi resources/HashGarten.app/contents/MacOS/bin/jacksum.sh

and change

HASHGARTEN_JAR=...
JACKSUM_JAR=...

vi resources/HashGarten.app/contents/MacOS/bin/launcher

and change

MAIN_JAR="HashGarten...

Update the JRE .tar.gz

  1. Go to https://adoptium.net/de/download/
  2. Download the latest JREs for the architectures x64 and aarch64. If downloaded, macOS extracts the .tar.gz to .tar
  3. Save the .tar files to resources/app/
  4. Repack the .tar files again using gzip

Update the readme.pdf

Prerequisites

Make a screenshot from the current installer .app

  1. Open the .dmg
  2. Select the Jacksum ... for macOS icon
  3. Type Fn+Blank on the keyboard
  4. Cmd+Shift+4, blank, mouse left click to store a picture
  5. Open the screenshot (it is stored on the Desktop) and copy the image

Update the Markup

  1. Open Google Chrome
  2. Go to https://github.com/jonelo/jacksum-for-macos
  3. Edit the GitHub markup page
  4. Paste the new image
  5. Save the markup

Replace the old readme.pdf with the new one

  1. Print the Markup page using GitHub Markdown Printer
  2. Save the pdf to resources/dmg/readme.pdf

Update the release_notes.txt

vi resources/dmg/release_notes.txt

Interna of the installation app

The core of the Jacksum for macOS.app is a bash script that installs both HashGarten and Jacksum to the Finder's Script Menu (and other file managers it can detect) by creating applescript scripts (in case of Finder and Path Finder), and compiling those on the system during the installation using osacompile.

The installation script requires Mac OS X 10.4 (Tiger) or later to run. The script does not require admin privileges. Credits: the installer app has been created by Platypus, a great app to wrap shell scripts into a macOS app.

Once the script has been compiled by Platypus, the installer app requires macOS 10.11 (El Capitan) or later. The script source can be revealed again by typing

% cd /Volumes/Jacksum\ for\ macOS/
% cat ./Jacksum\ 3.7.0\ for\ macOS.app/Contents/Resources/script

The source code of the generated and compiled applescripts can be relealed again by opening the .scpt files (located in the appropriate script folders) usiing the Apple Script Editor or osadecompile.