From: Ben Soares Date: Fri, 11 Mar 2022 17:49:44 +0000 (+0000) Subject: JAL-3393 Updated DS_Store files, script and doc X-Git-Url: http://source.jalview.org/gitweb/?p=jalview.git;a=commitdiff_plain;h=2f952713217783544759f90eff4505ff5a04a489 JAL-3393 Updated DS_Store files, script and doc --- diff --git a/doc/README-DMG_creation.md b/doc/README-DMG_creation.md index 6542b7c..566ad05 100644 --- a/doc/README-DMG_creation.md +++ b/doc/README-DMG_creation.md @@ -3,7 +3,7 @@ ## New method to make the DS_Store file from scratch (on a Mac) ``` -./utils/install4j/mk_ds_store.sh --name Jalview [--bgimg ./utils/channels/release/image/jalview_dmg_background.png] [--output ./utils/channels/release/image/jalview_dmg_DS_Store] +./utils/install4j/mk_ds_store.sh --name Jalview [--volname "Jalview Installer (2.11.2.0)"] [--bgimg ./utils/channels/release/image/jalview_dmg_background.png] [--output ./utils/channels/release/image/jalview_dmg_DS_Store] ``` A script that creates a new DMG with the top level items to be found in a Jalview Installer DMG, mounts the volume, then uses an AppleScript to adjust the background image, size and position of the icons, and appearance of the Finder window. @@ -12,6 +12,8 @@ The .DS_Store is then copied out of the volume by the script, the volume unmount To use it, the NAME (of the application, without the `.app` extension) should be set in the script (set to "Jalview"), and the background image that you want to use should be copied to your working directory as `background.png` (or use the --bgimg option). +While it is running you will see a styled Finder window appear. The App icon will be broken as only a folder for the App is put in place, not an actual .app. + Once it is run (only works on a Mac with osascript) it will leave a file Output-DS_Store in your working directory (or use the --output option). > This script borrows extensively from https://github.com/create-dmg/create-dmg diff --git a/utils/channels/develop/images/jalview_develop_dmg_DS_Store b/utils/channels/develop/images/jalview_develop_dmg_DS_Store index f948c20..a63a3ce 100644 Binary files a/utils/channels/develop/images/jalview_develop_dmg_DS_Store and b/utils/channels/develop/images/jalview_develop_dmg_DS_Store differ diff --git a/utils/channels/release/images/jalview_dmg_DS_Store b/utils/channels/release/images/jalview_dmg_DS_Store index 006f829..cb0d612 100644 Binary files a/utils/channels/release/images/jalview_dmg_DS_Store and b/utils/channels/release/images/jalview_dmg_DS_Store differ diff --git a/utils/channels/test-release/images/jalview_test-release_dmg_DS_Store b/utils/channels/test-release/images/jalview_test-release_dmg_DS_Store index d03fc55..6730098 100644 Binary files a/utils/channels/test-release/images/jalview_test-release_dmg_DS_Store and b/utils/channels/test-release/images/jalview_test-release_dmg_DS_Store differ diff --git a/utils/install4j/mk_ds_store.sh b/utils/install4j/mk_ds_store.sh index 9bbac91..c0cabbe 100755 --- a/utils/install4j/mk_ds_store.sh +++ b/utils/install4j/mk_ds_store.sh @@ -14,6 +14,8 @@ Usage: $(basename "$0") --name "Your Application Name" [options] Options: --name The application name (without '.app' extension) (mandatory) + --volname + The Volume name of the DMG when mounted (defaults to " Installer") --bgimg Path to your background image (defaults to background.png) --output @@ -30,10 +32,13 @@ BACKGROUNDIMG="background.png" OUTPUTNAME="Output-DS_Store" while [[ "${1:0:1}" = "-" ]]; do - case $1 in - --name) - NAME="$2" - shift; shift;; + case $1 in + --name) + NAME="$2" + shift; shift;; + --volname) + VOLNAME="$2" + shift; shift;; --bgimg) BACKGROUNDIMG="$2" shift; shift;; @@ -50,18 +55,20 @@ if [[ -z "$NAME" ]]; then exit 1 fi +if [[ -z "$VOLNAME" ]]; then + VOLNAME="${NAME} Installer" +fi + +APPNAME="${NAME}.app" + WDIR=$(pwd) # make a relative path absolute as we'll be cd-ing to /tmp if [[ "${BACKGROUNDIMG#/}" = "${BACKGROUNDIMG}" ]]; then BACKGROUNDIMG="${WDIR}/${BACKGROUNDIMG}" fi - -# Note that VOLNAME is only for making the DS_Store file in. The final DMG can have a different Volume name -# This temporary VOLNAME can be seen if you do `strings /Volume/Your DMG Name/.DS_Store` on the final .DS_Store -# so we set this to something relatable to the application name. -VOLNAME="${NAME// /_}_Installer" - -APPNAME="${NAME}.app" +if [[ "${OUTPUTNAME#/}" = "${OUTPUTNAME}" ]]; then + OUTPUTNAME="${WDIR}/${OUTPUTNAME}" +fi DMG="${VOLNAME}.dmg" # We set the Applications folder link to " " in the DMG @@ -99,10 +106,10 @@ APPLICATIONSY=124 TEXTSIZE=14 ICONSIZE=76 -osascript - "$VOLNAME" "$APPNAME" <