}
}
- def getdownWrapperScripts = [ getdown_mac_wrapper_script, getdown_unix_wrapper_script, getdown_windows_wrapper_script, getdown_powershell_wrapper_script ]
+ def getdownWrapperScripts = [ getdown_bash_wrapper_script, getdown_powershell_wrapper_script ]
getdownWrapperScripts.each{ script ->
def s = file( "${jalviewDir}/utils/getdown/${script}" )
if (s.exists()) {
'WINDOWS_APPLICATION_ID': install4jWinApplicationId,
'MACOS_DMG_DS_STORE': install4jDMGDSStore,
'MACOS_DMG_BG_IMAGE': install4jDMGBackgroundImage,
- 'MACOS_DMG_WRAPPER_LINK': install4j_dmg_wrapper_link,
- 'MACOS_WRAPPER_SCRIPT': getdown_mac_wrapper_script,
+ 'MACOS_DMG_WRAPPER_LINK': getdown_bash_wrapper_script,
+ 'MACOS_WRAPPER_SCRIPT': getdown_bash_wrapper_script,
'INSTALLER_NAME': install4jInstallerName,
'INSTALL4J_UTILS_DIR': install4j_utils_dir,
'GETDOWN_WEBSITE_DIR': getdown_website_dir,
install4j_background = jalview_logo_background_fade-640x480.png
install4j_dmg_background = jalview_dmg_background-NON-RELEASE.png
install4j_dmg_ds_store = jalview_dmg_DS_Store
-install4j_dmg_wrapper_link = jalviewc
-getdown_mac_wrapper_script = jalviewc-macos
-getdown_unix_wrapper_script = jalviewc
-getdown_windows_wrapper_script = jalviewc-windows
+getdown_bash_wrapper_script = jalviewc
getdown_powershell_wrapper_script = jalviewc.ps1
OSX_KEYSTORE =
#!/usr/bin/env bash
+declare -a ARGS=("${@}")
ARG1=$1
-DIR="$(dirname "$(readlink -f "$0")")"
-# check to see if $1 is set and is not start of other cli set args
-OPEN=""
-if [ -n "${ARG1}" -a "${ARG1}" = "${ARG1#-}" -a "${ARG1}" != "open" ]; then
- # first argument exists and does not start with a "-" and is not "open"
- OPEN="-open"
+# this whole next part is because there's no readlink -f in Darwin
+function readlinkf() {
+ FINDFILE="$1"
+ FILE="${FINDFILE}"
+ PREVFILE=""
+ C=0
+ MAX=100 # just in case we end up in a loop
+ FOUND=0
+ while [ "${C}" -lt "${MAX}" -a "${FILE}" != "${PREVFILE}" -a "${FOUND}" -ne 1 ]; do
+ PREVFILE="${FILE}"
+ FILE="$(readlink "${FILE}")"
+ if [ -z "${FILE}" ]; then
+ # the readlink is empty means we've arrived at the script, let's canonicalize with pwd
+ FILE="$(cd "$(dirname "${PREVFILE}")" &> /dev/null && pwd -P)"/"$(basename "${PREVFILE}")"
+ FOUND=1
+ elif [ "${FILE#/}" = "${FILE}" ]; then
+ # FILE is not an absolute path link, we need to add the relative path to the previous dir
+ FILE="$(dirname "${PREVFILE}")/${FILE}"
+ fi
+ C=$((C+1))
+ done
+ if [ "${FOUND}" -ne 1 ]; then
+ echo "Could not determine path to actual file '$(basename "${FINDFILE}")'" >&2
+ exit 1
+ fi
+ echo "${FILE}"
+}
+
+ISMACOS=0
+if [ "$( uname -s )" = "Darwin" ]; then
+ ISMACOS=1
+fi
+
+declare -a JVMARGS=()
+
+# set vars for being inside the macos App Bundle
+if [ "${ISMACOS}" = 1 ]; then
+# MACOS ONLY
+ DIR="$(dirname "$(readlinkf "$0")")"
+ APP="${DIR%.app/Contents/*}".app
+ if [ "${APP}" = "${APP%.app}" ]; then
+ echo "Could not find Jalview.app" >&2
+ exit 2
+ fi
+ APPDIR="${APP}/Contents/Resources/app"
+ JAVA="${APPDIR}/jre/Contents/Home/bin/java"
+ JVMARGS=( "${JVMARGS[@]}" "-Xdock:icon=${APPDIR}/resource/jalview_logo.png" )
+else
+# NOT MACOS
+ DIR="$(dirname "$(readlink -f "$0")")"
+ APPDIR="${DIR}"
+ JAVA="${APPDIR}/jre/bin/java"
fi
-APPDIR="${DIR}"
-JAVA="${APPDIR}/jre/bin/java"
+SYSJAVA=java
GETDOWNTXT="${APPDIR}/getdown.txt"
+
CLASSPATH=""
+# save an array of JAR paths in case we're in WSL (see later)
+declare -a JARPATHS=()
if [ -e "${GETDOWNTXT}" ]; then
+ # always check grep and sed regexes on macos -- they're not the same
for JAR in $(grep -e '^code\s*=\s*' "${GETDOWNTXT}" | sed -e 's/^code\s*=\s*//;'); do
[ -n "${CLASSPATH}" ] && CLASSPATH="${CLASSPATH}:"
CLASSPATH="${CLASSPATH}${APPDIR}/${JAR}"
+ JARPATHS=( "${JARPATHS[@]}" "${APPDIR}/${JAR}" )
done
else
echo "Cannot find getdown.txt" >&2
exit 3
fi
+# WINDOWS ONLY (Cygwin or WSL)
+# change paths for Cygwin or Windows Subsystem for Linux (WSL)
+if [ "${ISMACOS}" != 1 ]; then # macos doesn't like uname -o, best to avoid
+ if [ "$(uname -o)" = "Cygwin" ]; then
+ # CYGWIN
+ echo "When using relative paths in args within Cygwin, please start with './' or '../'" >&2
+ CLASSPATH=$(cygpath -pw "${CLASSPATH}")
+ # now for some arg paths fun. only translating paths starting with './', '../' or '/'
+ ARGS=()
+ for ARG in "${@}"; do
+ if [ "${ARG}" != "${ARG#./}" -o "${ARG}" != "${ARG#/}" -o "${ARG}" != "${ARG#../}" ]; then
+ ARGS=( "${ARGS[@]}" "$(cygpath -aw "${ARG}")" )
+ else
+ ARGS=( "${ARGS[@]}" "${ARG}" )
+ fi
+ done
+ elif uname -r | grep Microsoft >/dev/null; then
+ # WSL
+ echo "When using relative paths in args within WSL, please start with './' or '../'" >&2
+ CLASSPATH=""
+ for JARPATH in "${JARPATHS[@]}"; do
+ [ -n "${CLASSPATH}" ] && CLASSPATH="${CLASSPATH};"
+ CLASSPATH="${CLASSPATH}$(wslpath -aw "${JARPATH}")"
+ done
+ ARGS=()
+ for ARG in "${@}"; do
+ if [ "${ARG}" != "${ARG#./}" -o "${ARG}" != "${ARG#/}" -o "${ARG}" != "${ARG#../}" ]; then
+ # annoyingly wslpath does not work if the file doesn't exist!
+ ARGBASENAME="$(basename "${ARG}")"
+ ARGDIRNAME="$(dirname "${ARG}")"
+ ARGS=( "${ARGS[@]}" "$(wslpath -aw "${ARGDIRNAME}")\\${ARGBASENAME}" )
+ else
+ ARGS=( "${ARGS[@]}" "${ARG}" )
+ fi
+ done
+ JAVA="${JAVA}.exe"
+ SYSJAVA="java.exe"
+ fi
+fi
+
+# Is there a bundled Java? If not just try one in the PATH (do need .exe in WSL)
if [ \! -e "${JAVA}" ]; then
- echo "Cannot find bundled java, using system and hoping for the best!" >&2
- JAVA=java
+ JAVA=$SYSJAVA
+ echo "Cannot find bundled java, using system ${JAVA} and hoping for the best!" >&2
+fi
+
+# check to see if $1 is set and is not start of other cli args
+OPEN=""
+if [ -n "${ARG1}" -a "${ARG1}" = "${ARG1#-}" -a "${ARG1}" != "open" ]; then
+ # first argument exists and does not start with a "-" and is not "open"
+ OPEN="-open"
fi
-# don't quote $OPEN
-"${JAVA}" -cp "${CLASSPATH}" jalview.bin.Launcher ${OPEN} "$@"
+# don't quote $OPEN (don't want it accidentally mistaken as an empty string arg!)
+"${JAVA}" "${JVMARGS[@]}" -cp "${CLASSPATH}" jalview.bin.Launcher ${OPEN} "${ARGS[@]}"
+++ /dev/null
-#!/usr/bin/env bash
-
-ARG1="$1"
-
-# this whole next part is because there's no readlink -f in Darwin
-function readlinkf() {
- FINDFILE="$1"
- FILE="${FINDFILE}"
- PREVFILE=""
- C=0
- MAX=100 # just in case we end up in a loop
- FOUND=0
- while [ "${C}" -lt "${MAX}" -a "${FILE}" != "${PREVFILE}" -a "${FOUND}" -ne 1 ]; do
- PREVFILE="${FILE}"
- FILE="$(readlink "${FILE}")"
- if [ -z "${FILE}" ]; then
- # the readlink is empty means we've arrived at the script, let's canonicalize with pwd
- FILE="$(cd "$(dirname "${PREVFILE}")" &> /dev/null && pwd -P)"/"$(basename "${PREVFILE}")"
- FOUND=1
- elif [ "${FILE#/}" = "${FILE}" ]; then
- # FILE is not an absolute path link, we need to add the relative path to the previous dir
- FILE="$(dirname "${PREVFILE}")/${FILE}"
- fi
- C=$((C+1))
- done
- if [ "${FOUND}" -ne 1 ]; then
- echo "Could not determine path to actual file '$(basename "${FINDFILE}")'" >&2
- exit 1
- fi
- echo "${FILE}"
-}
-
-DIR="$(dirname "$(readlinkf "$0")")"
-APP="${DIR%.app/Contents/*}".app
-
-if [ "${APP}" = "${APP%.app}" ]; then
- echo "Could not find Jalview.app dir" >&2
- exit 2
-fi
-
-# check to see if $1 is set and is not start of other cli set args
-OPEN=""
-if [ -n "${ARG1}" -a "${ARG1}" = "${ARG1#-}" -a "${ARG1}" != "open" ]; then
- # first argument exists and does not start with a "-" and is not "open"
- OPEN="-open"
-fi
-
-APPDIR="${APP}/Contents/Resources/app"
-JAVA="${APPDIR}/jre/Contents/Home/bin/java"
-GETDOWNTXT="${APPDIR}/getdown.txt"
-CLASSPATH=""
-if [ -e "${GETDOWNTXT}" ]; then
- # always check grep and sed regexes on macOS -- they're not the same
- for JAR in $(grep -e '^code\s*=\s*' "${GETDOWNTXT}" | sed -e 's/^code\s*=\s*//;'); do
- [ -n "${CLASSPATH}" ] && CLASSPATH="${CLASSPATH}:"
- CLASSPATH="${CLASSPATH}${APPDIR}/${JAR}"
- done
-else
- echo "Cannot find getdown.txt" >&2
- exit 3
-fi
-
-if [ \! -e "${JAVA}" ]; then
- echo "Cannot find bundled java, using system and hoping for the best!" >&2
- JAVA=java
-fi
-
-# don't quote $OPEN
-"${JAVA}" -Xdock:icon="${APPDIR}"/resource/jalview_logo.png -cp "${CLASSPATH}" jalview.bin.Launcher ${OPEN} "$@"
+++ /dev/null
-#!/usr/bin/env bash
-
-ARG1=$1
-DIR="$(dirname "$(readlink -f "$0")")"
-
-# check to see if $1 is set and is not start of other cli set args
-OPEN=""
-if [ -n "${ARG1}" -a "${ARG1}" = "${ARG1#-}" -a "${ARG1}" != "open" ]; then
- # first argument exists and does not start with a "-" and is not "open"
- OPEN="-open"
-fi
-
-APPDIR="${DIR}"
-JAVA="${APPDIR}/jre/bin/java"
-GETDOWNTXT="${APPDIR}/getdown.txt"
-CLASSPATH=""
-if [ -e "${GETDOWNTXT}" ]; then
- for JAR in $(grep -e '^code\s*=\s*' "${GETDOWNTXT}" | sed -e 's/^code\s*=\s*//;'); do
- [ -n "${CLASSPATH}" ] && CLASSPATH="${CLASSPATH}:"
- CLASSPATH="${CLASSPATH}${APPDIR}/${JAR}"
- done
-else
- echo "Cannot find getdown.txt" >&2
- exit 3
-fi
-
-if [ \! -e "${JAVA}" ]; then
- echo "Cannot find bundled java, using system and hoping for the best!" >&2
- JAVA=java
-fi
-
-declare -a ARGS=("${@}")
-
-# change paths for Cygwin or Windows Subsystem for Linux (WSL)
-if [ "$(uname -o)" = "Cygwin" ]; then
- echo "When using relative paths in args within Cygwin, please start with './' or '../'" >&2
- CLASSPATH=$(cygpath -pw "${CLASSPATH}")
- # now for some arg paths fun. only translating paths starting with './', '../' or '/'
- ARGS=()
- for ARG in "${@}"; do
- if [ "${ARG}" != "${ARG#./}" -o "${ARG}" != "${ARG#/}" -o "${ARG}" != "${ARG#../}" ]; then
- ARGS=( "${ARGS[@]}" "$(cygpath -aw "${ARG}")" )
- else
- ARGS=( "${ARGS[@]}" "${ARG}" )
- fi
- done
- JAVA="${JAVA}.exe"
-elif uname -r | grep Microsoft >/dev/null; then
- echo "When using relative paths in args within WSL. please start with './' or '../'" >&2
- WCLASSPATH=""
- OLD_IFS="${IFS}"
- IFS=":"
- for JAR in $CLASSPATH; do
- [ -n "${WCLASSPATH}" ] && WCLASSPATH="${WCLASSPATH};"
- WCLASSPATH="${WCLASSPATH}$(wslpath -aw "${JAR}")"
- done
- CLASSPATH="${WCLASSPATH}"
- IFS="${OLD_IFS}"
- ARGS=()
- for ARG in "${@}"; do
- if [ "${ARG}" != "${ARG#./}" -o "${ARG}" != "${ARG#/}" -o "${ARG}" != "${ARG#../}" ]; then
- # annoyingly wslpath does not work if the file doesn't exist!
- ARGBASENAME="$(basename "${ARG}")"
- ARGDIRNAME="$(dirname "${ARG}")"
- ARGS=( "${ARGS[@]}" "$(wslpath -aw "${ARGDIRNAME}")\\${ARGBASENAME}" )
- else
- ARGS=( "${ARGS[@]}" "${ARG}" )
- fi
- done
- JAVA="${JAVA}.exe"
-fi
-
-# don't quote $OPEN
-"${JAVA}" -cp "${CLASSPATH}" jalview.bin.Launcher ${OPEN} "${ARGS[@]}"
<dirEntry mountPoint="736" file="${compiler:JALVIEW_DIR}/${compiler:GETDOWN_WEBSITE_DIR}/${compiler:JAVA_VERSION}" uninstallMode="2" overrideOverwriteMode="true" overrideUninstallMode="true" subDirectory="files">
<exclude>
<entry location="jalviewc" />
- <entry location="jalviewc-macos" />
- <entry location="jalviewc-windows" />
<entry location="jalviewc.ps1" />
</exclude>
</dirEntry>
<dirEntry mountPoint="736" file="${compiler:JALVIEW_DIR}/examples" overwriteMode="1" uninstallMode="2" overrideFileMode="true" overrideOverwriteMode="true" overrideUninstallMode="true" entryMode="subdir" subDirectory="examples" />
<fileEntry mountPoint="736" file="${compiler:JALVIEW_DIR}/${compiler:GETDOWN_WEBSITE_DIR}/${compiler:JAVA_VERSION}/jalviewc" fileMode="755" overrideFileMode="true" />
- <fileEntry mountPoint="736" file="${compiler:JALVIEW_DIR}/${compiler:GETDOWN_WEBSITE_DIR}/${compiler:JAVA_VERSION}/jalviewc-macos" fileMode="755" overrideFileMode="true" />
- <fileEntry mountPoint="736" file="${compiler:JALVIEW_DIR}/${compiler:GETDOWN_WEBSITE_DIR}/${compiler:JAVA_VERSION}/jalviewc-windows" fileMode="755" overrideFileMode="true" />
<fileEntry mountPoint="736" file="${compiler:JALVIEW_DIR}/${compiler:GETDOWN_WEBSITE_DIR}/${compiler:JAVA_VERSION}/jalviewc.ps1" fileMode="755" overrideFileMode="true" />
<dirEntry mountPoint="884" file="${compiler:MACOS_JAVA_VM_DIR}" fileMode="755" overrideFileMode="true" overrideUninstallMode="true" entryMode="subdir" subDirectory="${compiler:JRE_DIR}" />
<dirEntry mountPoint="885" file="${compiler:WINDOWS_JAVA_VM_DIR}" fileMode="755" overrideFileMode="true" overrideUninstallMode="true" entryMode="subdir" subDirectory="${compiler:JRE_DIR}" />
</action>
<action id="1525" beanClass="com.install4j.runtime.beans.actions.files.DeleteFileAction" actionElevationType="elevated" rollbackBarrierExitCode="0">
<serializedBean>
- <property name="files" type="array" class="java.io.File" length="44">
+ <property name="files" type="array" class="java.io.File" length="40">
<element index="0">
<object class="java.io.File">
<string>jre</string>
</element>
<element index="37">
<object class="java.io.File">
- <string>jalviewc-macos</string>
- </object>
- </element>
- <element index="38">
- <object class="java.io.File">
<string>jalviewc.ps1</string>
</object>
</element>
- <element index="39">
+ <element index="38">
<object class="java.io.File">
<string>jalviewcv</string>
</object>
</element>
- <element index="40">
- <object class="java.io.File">
- <string>jalviewc-macosv</string>
- </object>
- </element>
- <element index="41">
+ <element index="39">
<object class="java.io.File">
<string>jalviewc.ps1v</string>
</object>
</element>
- <element index="42">
- <object class="java.io.File">
- <string>jalviewc-windows</string>
- </object>
- </element>
- <element index="43">
- <object class="java.io.File">
- <string>jalviewc-windowsv</string>
- </object>
- </element>
</property>
<property name="recursive" type="boolean" value="true" />
</serializedBean>