.replaceAll("_*-_*", "-") // collapse _-_
.toLowerCase()
+ getdownWrapperLink = install4jUnixApplicationFolder // e.g. "jalview_local"
getdownAppDir = string("${getdownWebsiteDir}/${getdownAppDistDir}")
//getdownJ11libDir = "${getdownWebsiteDir}/${getdown_j11lib_dir}"
getdownResourceDir = string("${getdownWebsiteDir}/${getdown_resource_dir}")
}
}
- def getdownWrapperScripts = [ getdown_bash_wrapper_script, getdown_powershell_wrapper_script ]
+ def getdownWrapperScripts = [ getdown_bash_wrapper_script, getdown_powershell_wrapper_script, getdown_batch_wrapper_script ]
getdownWrapperScripts.each{ script ->
def s = file( "${jalviewDir}/utils/getdown/${getdown_wrapper_script_dir}/${script}" )
if (s.exists()) {
'WINDOWS_APPLICATION_ID': install4jWinApplicationId,
'MACOS_DMG_DS_STORE': install4jDMGDSStore,
'MACOS_DMG_BG_IMAGE': install4jDMGBackgroundImage,
- 'WRAPPER_LINK': getdown_wrapper_link,
+ 'WRAPPER_LINK': getdownWrapperLink,
'BASH_WRAPPER_SCRIPT': getdown_bash_wrapper_script,
'POWERSHELL_WRAPPER_SCRIPT': getdown_powershell_wrapper_script,
'WRAPPER_SCRIPT_BIN_DIR': getdown_wrapper_script_dir,
<variable name="MACOS_DMG_BG_IMAGE" value="jalview_dmg_background-72dpi.png" />
<variable name="WRAPPER_LINK" value="jalview" />
<variable name="BASH_WRAPPER_SCRIPT" value="jalview.sh" />
- <variable name="POWERSHELL_WRAPPER_SCRIPT" value="jalview.ps1" />
<variable name="WRAPPER_SCRIPT_BIN_DIR" value="bin" />
<variable name="INSTALLER_NAME" value="Jalview Installer" />
<variable name="INSTALL4J_UTILS_DIR" value="utils/install4j" />
<variable name="WINDOWS_ICONS_FILE" value="utils/channels/release/images/jalview_logo.ico" />
<variable name="PNG_ICON_FILE" value="utils/channels/release/images/jalview_logo.png" />
<variable name="BACKGROUND" value="utils/channels/release/images/jalview_logo_background_fade-640x480.png" />
- <variable name="LINK_TO_WRAPPER_SCRIPT" value="${compiler:BASH_WRAPPER_SCRIPT}" />
</variables>
<codeSigning macEnabled="true" macPkcs12File="${compiler:OSX_KEYSTORE}" macNotarize="true" appleId="${compiler:OSX_APPLEID}">
<macAdditionalBinaries>
<property name="obtainIfAdminWin" type="boolean" value="false" />
</serializedBean>
</action>
+ <action name="Set unixUserBinDir (Linux or Unix)" id="2738" beanClass="com.install4j.runtime.beans.actions.control.SetVariableAction" rollbackBarrierExitCode="0">
+ <serializedBean>
+ <property name="script">
+ <object class="com.install4j.api.beans.ScriptProperty">
+ <property name="value" type="string">String userHome = (String)context.getVariable("sys.userHome");
+
+String[] tryPaths = new String[] {
+ "bin",
+ ".local" + File.separator + "bin",
+ "local" + File.separator + "bin",
+ "opt" + File.separator + "bin"
+};
+
+for (int i = 0; i < tryPaths.length; i++) {
+ String tryPath = tryPaths[i];
+ File unixUserBinDir = new File(userHome + File.separator + tryPath);
+ if (unixUserBinDir.exists()) {
+ return tryPath;
+ }
+}
+
+return null;
+</property>
+ </object>
+ </property>
+ <property name="variableName" type="string">unixUserBinDir</property>
+ </serializedBean>
+ <condition>Util.isLinux() || Util.isUnixInstaller()</condition>
+ </action>
</actions>
</screen>
</startup>
</action>
<action id="2542" beanClass="com.install4j.runtime.beans.actions.control.SetMessageAction" actionElevationType="none" rollbackBarrierExitCode="0">
<serializedBean>
- <property name="statusMessage" type="string">Creating file associations</property>
+ <property name="statusMessage" type="string">Finished creating file associations</property>
<property name="useDetail" type="boolean" value="true" />
<property name="useStatus" type="boolean" value="true" />
</serializedBean>
</screen>
<screen id="20" beanClass="com.install4j.runtime.beans.screens.FinishedScreen" rollbackBarrierExitCode="0" finishScreen="true">
<actions>
- <action name="Linux/Unix symlink" id="2733" beanClass="com.install4j.runtime.beans.actions.files.CreateSymlinkAction" actionElevationType="elevated" rollbackBarrierExitCode="0" errorMessage="Could not make symlink to wrapper script">
- <serializedBean>
- <property name="file">
- <object class="java.io.File">
- <string>${compiler:WRAPPER_SCRIPT_BIN_DIR}/${compiler:LINK_TO_WRAPPER_SCRIPT}</string>
- </object>
- </property>
- <property name="linkFile">
- <object class="java.io.File">
- <string>${compiler:WRAPPER_SCRIPT_BIN_DIR}/${compiler:WRAPPER_LINK}</string>
- </object>
- </property>
- </serializedBean>
- </action>
<action id="2012" beanClass="com.install4j.runtime.beans.actions.desktop.CreateStartMenuEntryAction" actionElevationType="elevated" rollbackBarrierExitCode="0">
<serializedBean>
<property name="allUsers" type="boolean" value="false" />
</serializedBean>
<condition>context.getBooleanVariable("addToDockAction")</condition>
</action>
+ <action name="Linux/Unix symlink" id="2733" beanClass="com.install4j.runtime.beans.actions.files.CreateSymlinkAction" actionElevationType="elevated" rollbackBarrierExitCode="0" errorMessage="Could not make symlink to wrapper script">
+ <serializedBean>
+ <property name="file">
+ <object class="java.io.File">
+ <string>${compiler:WRAPPER_SCRIPT_BIN_DIR}/${compiler:BASH_WRAPPER_SCRIPT}</string>
+ </object>
+ </property>
+ <property name="linkFile">
+ <object class="java.io.File">
+ <string>${compiler:WRAPPER_SCRIPT_BIN_DIR}/${compiler:WRAPPER_LINK}</string>
+ </object>
+ </property>
+ </serializedBean>
+ <condition>!Util.isWindows()</condition>
+ </action>
+ <action name="Add Jalview bin to the user's path (Windows)" id="2740" beanClass="com.install4j.runtime.beans.actions.misc.ModifyEnvironmentVariableAction" actionElevationType="elevated" rollbackBarrierExitCode="0" errorMessage="Could not add "${installer:sys.contentDir}\${compiler:WRAPPER_SCRIPT_BIN_DIR}" to the Path environment variable">
+ <serializedBean>
+ <property name="type" type="enum" class="com.install4j.runtime.beans.actions.misc.ModifyStringType" value="APPEND" />
+ <property name="value" type="string">${installer:sys.contentDir}\${compiler:WRAPPER_SCRIPT_BIN_DIR}</property>
+ <property name="variableName" type="string">Path</property>
+ </serializedBean>
+ <condition>context.getBooleanVariable("appendToPathAction")</condition>
+ </action>
+ <action name="Create symbolic link to jalview.sh in user's local bin" id="2739" beanClass="com.install4j.runtime.beans.actions.files.CreateSymlinkAction" actionElevationType="elevated" rollbackBarrierExitCode="0" errorMessage="Could not make a ${compiler:WRAPPER_LINK} symbolic link in ~/${installer:unixUserBinDir}">
+ <serializedBean>
+ <property name="file">
+ <object class="java.io.File">
+ <string>${installer:sys.contentDir}/${compiler:WRAPPER_SCRIPT_BIN_DIR}/${compiler:BASH_WRAPPER_SCRIPT}</string>
+ </object>
+ </property>
+ <property name="linkFile">
+ <object class="java.io.File">
+ <string>${installer:sys.userHome}/${installer:unixUserBinDir}/${compiler:WRAPPER_LINK}</string>
+ </object>
+ </property>
+ </serializedBean>
+ <condition>context.getBooleanVariable("makeSymbolicLink") && ( Util.isLinux() || Util.isUnixInstaller() ) && ( context.getVariable("unixUserBinDir") != null )</condition>
+ </action>
</actions>
<formComponents>
<formComponent id="21" beanClass="com.install4j.runtime.beans.formcomponents.MultilineLabelComponent" insetBottom="10">
</serializedBean>
<visibilityScript>Util.isMacOS()</visibilityScript>
</formComponent>
+ <formComponent name="Add jalview bin to the user's Path environment variable (Windows)" id="2734" beanClass="com.install4j.runtime.beans.formcomponents.CheckboxComponent">
+ <serializedBean>
+ <property name="checkboxText" type="string">Add ${compiler:JALVIEW_APPLICATION_NAME}'s bin folder to the Path environment variable</property>
+ <property name="initiallySelected" type="boolean" value="true" />
+ <property name="variableName" type="string">appendToPathAction</property>
+ </serializedBean>
+ <visibilityScript>Util.isWindows()</visibilityScript>
+ </formComponent>
+ <formComponent name="Make a symbolic link to jalview.sh bash script in the user's local bin (Linux or Unix)" id="2736" beanClass="com.install4j.runtime.beans.formcomponents.CheckboxComponent">
+ <serializedBean>
+ <property name="checkboxText" type="string">Make a ${compiler:WRAPPER_LINK} symbolic link in ~/${installer:unixUserBinDir}</property>
+ <property name="initiallySelected" type="boolean" value="true" />
+ <property name="variableName" type="string">makeSymbolicLink</property>
+ </serializedBean>
+ <visibilityScript>( Util.isLinux() || Util.isUnixInstaller() ) && ( context.getVariable("unixUserBinDir") != null )</visibilityScript>
+ </formComponent>
</formComponents>
</screen>
</screens>
<entry filesetId="1873" />
<entry filesetId="2105" />
</exclude>
- <variables>
- <variable name="LINK_TO_WRAPPER_SCRIPT" value="${compiler:POWERSHELL_WRAPPER_SCRIPT}" />
- </variables>
<jreBundle jreBundleSource="preCreated" includedJre="${compiler:WINDOWS_JAVA_VM_TGZ}" manualJreEntry="true" />
</windows>
<macosArchive name="macOS Disk Image" id="878" customizedId="MACOS_DISK_IMAGE" mediaFileName="${compiler:APPLICATION_FOLDER}-${compiler:JALVIEW_VERSION}-${compiler:sys.platform}-java_${compiler:JAVA_INTEGER_VERSION}" volumeName="${compiler:INSTALLER_NAME}" launcherId="737">
<entry filesetId="882" />
<entry filesetId="1873" />
</exclude>
- <variables>
- <variable name="LINK_TO_WRAPPER_SCRIPT" value="${compiler:BASH_WRAPPER_SCRIPT}" />
- </variables>
<topLevelFiles>
<symlink name="" "" target="/Applications" />
<file name=".background/jalview_dmg_background.png" file="${compiler:JALVIEW_DIR}/${compiler:MACOS_DMG_BG_IMAGE}" />
<entry filesetId="1873" />
<entry filesetId="2105" />
</exclude>
- <variables>
- <variable name="LINK_TO_WRAPPER_SCRIPT" value="${compiler:BASH_WRAPPER_SCRIPT}" />
- </variables>
<jreBundle jreBundleSource="preCreated" includedJre="${compiler:LINUX_JAVA_VM_TGZ}" manualJreEntry="true" />
</unixInstaller>
<unixArchive name="Unix .tar.gz Archive" id="1596" mediaFileName="${compiler:UNIX_APPLICATION_FOLDER}-${compiler:JALVIEW_VERSION}-${compiler:sys.platform}-java_${compiler:JAVA_INTEGER_VERSION}" installDir="${compiler:UNIX_APPLICATION_FOLDER}">
<entry filesetId="1873" />
<entry filesetId="2105" />
</exclude>
- <variables>
- <variable name="LINK_TO_WRAPPER_SCRIPT" value="${compiler:BASH_WRAPPER_SCRIPT}" />
- </variables>
<jreBundle includedJre="${compiler:LINUX_JAVA_VM_TGZ}" manualJreEntry="true" />
</unixArchive>
<unixInstaller name="Unix Shell Installer" id="2639" mediaFileName="${compiler:UNIX_APPLICATION_FOLDER}-${compiler:JALVIEW_VERSION}-${compiler:sys.platform}-java_${compiler:JAVA_INTEGER_VERSION}" installDir="${compiler:UNIX_APPLICATION_FOLDER}" customInstallBaseDir="~/opt/">
<entry filesetId="1873" />
<entry filesetId="2105" />
</exclude>
- <variables>
- <variable name="LINK_TO_WRAPPER_SCRIPT" value="${compiler:BASH_WRAPPER_SCRIPT}" />
- </variables>
<jreBundle includedJre="${compiler:LINUX_JAVA_VM_TGZ}" manualJreEntry="true" />
</unixInstaller>
</mediaSets>