into getdownResourceDir
}
}
-
+
def getdownWrapperScripts = [
getdown_bash_wrapper_script,
getdown_powershell_wrapper_script,
- getdown_batch_wrapper_script,
getdown_bash_update_script,
getdown_powershell_update_script,
- getdown_batch_update_script
]
+ def run_powershell = file( "${jalviewDir}/utils/getdown/${getdown_wrapper_script_dir}/${getdown_run_powershell}" )
+ def run_other_script = file( "${jalviewDir}/utils/getdown/${getdown_wrapper_script_dir}/${getdown_run_other_script}" )
getdownWrapperScripts.each{ script ->
def s = file( "${jalviewDir}/utils/getdown/${getdown_wrapper_script_dir}/${script}" )
if (s.exists()) {
}
getdownTextLines += "xresource = ${getdown_wrapper_script_dir}/${script}"
}
+ def ext = script.toLowerCase(Locale.ROOT).substring(script.lastIndexOf(".") + 1)
+ if ("ps1".equals(ext)) {
+ def base = script.take(script.lastIndexOf("."))
+ def newbase = "update".equals(base) ? "${install4jUnixApplicationFolder}_update" : install4jUnixApplicationFolder
+ if (!newbase.equals(base)) {
+ copy {
+ from run_other_script
+ rename(run_other_script.getName(), "${newbase}.${ext}")
+ into "${getdownAppBaseDir}/${getdown_wrapper_script_dir}"
+ getdownTextLines += "xresource = ${getdown_wrapper_script_dir}/${newbase}.${ext}"
+ filter(ReplaceTokens,
+ beginToken: '__',
+ endToken: '__',
+ tokens: [
+ 'OTHERSCRIPT': script
+ ]
+ ) }
+ }
+ copy {
+ from run_powershell
+ rename(run_powershell.getName(), "${newbase}.bat")
+ into "${getdownAppBaseDir}/${getdown_wrapper_script_dir}"
+ getdownTextLines += "xresource = ${getdown_wrapper_script_dir}/${newbase}.bat"
+ }
+ }
}
def codeFiles = []
'WRAPPER_LINK': getdownWrapperLink,
'BASH_WRAPPER_SCRIPT': getdown_bash_wrapper_script,
'POWERSHELL_WRAPPER_SCRIPT': getdown_powershell_wrapper_script,
- 'BATCH_WRAPPER_SCRIPT': getdown_batch_wrapper_script,
'BASH_UPDATE_SCRIPT': getdown_bash_update_script,
'POWERSHELL_UPDATE_SCRIPT': getdown_powershell_update_script,
- 'BATCH_UPDATE_SCRIPT': getdown_batch_update_script,
'WRAPPER_SCRIPT_BIN_DIR': getdown_wrapper_script_dir,
'MACOSARCHIVE_X64_NAME': install4jmacOSArchiveX64Name,
'MACOSARCHIVE_AARCH64_NAME': install4jmacOSArchiveAarch64Name,
'INSTALLER_ICON': "${getdownImagesDir}/${install4j_installer_icon}",
'INSTALLER_MAC_ICON': "${getdownImagesDir}/${install4j_installer_mac_icon}",
'INSTALLER_WINDOWS_ICON': "${getdownImagesDir}/${install4j_installer_windows_icon}",
+ 'TITLE_ICON': "${getdownImagesDir}/${install4j_title_icon}",
'LOG_FILE': "${install4jUnixApplicationFolder}.log",
]
getdown_wrapper_script_dir = bin
getdown_bash_wrapper_script = jalview.sh
getdown_powershell_wrapper_script = jalview.ps1
-getdown_batch_wrapper_script = jalview.bat
getdown_bash_update_script = update.sh
getdown_powershell_update_script = update.ps1
-getdown_batch_update_script = update.bat
+getdown_run_other_script = run_other_script.ps1
+getdown_run_powershell = run_powershell.bat
OSX_KEYSTORE =
OSX_KEYPASS =
# save args and first parameter
$myArgs = $args.Clone()
-$myArg1 = $args[0]
# setup for powershell version < 6.0
[bool] $myIsWindows = 0
$headless = 0
}
-# parent dir of this actual script (which should be the getdown appdir/bin). Follow all symlinks. Like GNU readlink -f
+# actual path of this script (which should be the getdown appdir/bin). Follow all symlinks. Like GNU readlink -f
function Readlink-f {
- Param($Link)
- $dirs = @()
- $dir = Convert-Path $Link
- while ( $dir ) {
- $dirs = @( Split-Path $dir -Leaf ) + $dirs
- $dir = Split-Path $dir -Parent
+ Param(
+ [Parameter(mandatory=$true, ValueFromPipeline=$true)]$Link,
+ [Parameter()]$iteration_count = 1
+ )
+ if ( $iteration_count -ge 100 ) {
+ Write-Error "Readlink-f iterated 100 times"
+ return $Link
}
- $real = Get-Item "/"
- foreach ($d in $dirs) {
- $real = Join-Path -Path $real -ChildPath $d
- $item = Get-Item $real
- if ($item.Target -ne $null) {
- $real = Convert-Path $item.Target
+ if ( $Link -eq "" -or $Link -eq $null ) {
+ return $null
+ }
+ $path_components = @()
+ $dir = Get-Item $Link
+ while ( $dir -ne $null ) {
+ while ( $dir.Target -ne $null ) {
+ # [System.IO.Path]::Combine caters for a multitude of sins that it's almost impossible to deal with with Join-Path
+ $dir = Get-Item ([System.IO.Path]::GetFullPath( [System.IO.Path]::Combine( (Split-Path $dir -Parent), $dir.Target )))
}
+ $parent = Split-Path -Path $dir -Parent
+ $path_components = @( (Split-Path -Path $dir -Leaf) ) + $path_components
+ $dir = Readlink-f $parent ($iteration_count + 1)
+ }
+ $real = Get-Item "/"
+ foreach ( $component in $path_components) {
+ # [System.IO.Path]::Combine caters for a multitude of sins that it's almost impossible to deal with with Join-Path
+ $real = Get-Item ([System.IO.Path]::GetFullPath( [System.IO.Path]::Combine( $real, $component )))
}
$real
}
--- /dev/null
+#!/usr/bin/env pwsh
+
+$OTHERSCRIPT = "__OTHERSCRIPT__"
+
+# actual path of this script (which should be the getdown appdir/bin). Follow all symlinks. Like GNU readlink -f
+function Readlink-f {
+ Param(
+ [Parameter(mandatory=$true, ValueFromPipeline=$true)]$Link,
+ [Parameter()]$iteration_count = 1
+ )
+ if ( $iteration_count -ge 100 ) {
+ Write-Error "Readlink-f iterated 100 times"
+ return $Link
+ }
+ if ( $Link -eq "" -or $Link -eq $null ) {
+ return $null
+ }
+ $path_components = @()
+ $dir = Get-Item $Link
+ while ( $dir -ne $null ) {
+ while ( $dir.Target -ne $null ) {
+ # [System.IO.Path]::Combine caters for a multitude of sins that it's almost impossible to deal with with Join-Path
+ $dir = Get-Item ([System.IO.Path]::GetFullPath( [System.IO.Path]::Combine( (Split-Path $dir -Parent), $dir.Target )))
+ }
+ $parent = Split-Path -Path $dir -Parent
+ $path_components = @( (Split-Path -Path $dir -Leaf) ) + $path_components
+ $dir = Readlink-f $parent ($iteration_count + 1)
+ }
+ $real = Get-Item "/"
+ foreach ( $component in $path_components) {
+ # [System.IO.Path]::Combine caters for a multitude of sins that it's almost impossible to deal with with Join-Path
+ $real = Get-Item ([System.IO.Path]::GetFullPath( [System.IO.Path]::Combine( $real, $component )))
+ }
+ $real
+}
+
+$CMDPATH = ( Get-Item $MyInvocation.MyCommand.Path )
+$SCRIPTPATH = Readlink-f -Link $CMDPATH
+$SCRIPTBIN = Split-Path -Path $SCRIPTPATH -Parent
+$SCRIPT = Join-Path $SCRIPTBIN -ChildPath $OTHERSCRIPT
+
+Write-Host "Running: $SCRIPT $args"
+& $SCRIPT $args
+++ /dev/null
-@ECHO OFF
-
-REM This is the Jalview batch script wrapper to run the powershell script of the same name.
-REM There is nothing specific to Jalview.
-
-REM ******************************************************************************
-REM If you need to set a full path to the PowerShell executable please do so here:
-SET PWSHPATH=
-REM ******************************************************************************
-
-REM This is some DOS magic to substitute the extension in the full path of this batch script with .ps1
-SET SCRIPTPATH=%~dpn0.ps1
-
-REM PowerShell script isn't where it should be!
-IF NOT EXIST "%SCRIPTPATH%" (
- ECHO Could not find PowerShell script "%SCRIPTPATH%". Is %~nx0 in the right folder?
- EXIT /B 1
-)
-
-REM Look for either pwsh.exe or powershell.exe if not set in PWSHPATH above.
-REM pwsh.exe is preferred as it is likely to be a newer version.
-SET PWSH=
-IF DEFINED PWSHPATH (
- SET PWSH=%PWSHPATH%
-)
-FOR %%X IN (pwsh.exe powershell.exe) DO (
- IF NOT DEFINED PWSH (
- IF NOT "%%~$PATH:X" == "" (
- REM Found a PowerShell executable in the PATH
- SET PWSH="%%X"
- GOTO end_looking
- )
- )
-)
-:end_looking
-
-IF NOT DEFINED PWSH (
- REM No PowerShell executable found -- tell the user what to do.
- ECHO No PowerShell found in %%PATH%%. If PowerShell is installed either
- ECHO 1. add it to your PATH, or
- ECHO 2. edit the PWSHPATH value at the top of this file:
- ECHO "%~dpnx0"
- ECHO.
- ECHO %~n0 on the command line requires PowerShell. To install PowerShell see
- ECHO https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell
- EXIT /B 2
-)
-
-REM Run the PowerShell script
-"%PWSH%" -NoProfile -ExecutionPolicy Bypass -Command "& '%SCRIPTPATH%' %*";
#!/usr/bin/env pwsh
-# save args and first parameter
-$myArgs = $args.Clone()
-$myArg1 = $args[0]
-
# setup for powershell version < 6.0
[bool] $myIsWindows = 0
[bool] $myIsMacOS = 0
Exit
}
-# parent dir of this actual script (which should be the getdown appdir/bin). Follow all symlinks. Like GNU readlink -f
+# actual path of this script (which should be the getdown appdir/bin). Follow all symlinks. Like GNU readlink -f
function Readlink-f {
Param(
[Parameter(mandatory=$true, ValueFromPipeline=$true)]$Link,
<variable name="MACOSARCHIVE_VOLUMEICON" />
<variable name="WRAPPER_LINK" value="jalview" />
<variable name="BASH_WRAPPER_SCRIPT" value="jalview.sh" />
- <variable name="BATCH_WRAPPER_SCRIPT" value="jalview.bat" />
<variable name="POWERSHELL_WRAPPER_SCRIPT" value="jalview.ps1" />
<variable name="BASH_UPDATE_SCRIPT" value="update.sh" />
- <variable name="BATCH_UPDATE_SCRIPT" value="update.bat" />
<variable name="POWERSHELL_UPDATE_SCRIPT" value="update.ps1" />
<variable name="WRAPPER_SCRIPT_BIN_DIR" value="bin" />
<variable name="MACOSARCHIVE_X64_NAME" value="Install Jalview (Intel)" />
<variable name="INSTALLER_ICON" value="jalview_installer.png" description="An icon with installation arrow.
NOT USED" />
<variable name="INSTALLER_MAC_ICON" value="jalview_installer.icns" description="An icon with installation arrow.
NOT USED" />
<variable name="INSTALLER_WINDOWS_ICON" value="jalview_installer.ico" description="An icon with installation arrow.
NOT USED" />
+ <variable name="TITLE_ICON" value="jalview_logo-64.png" description="Icon sized for the installer wizard title bar" />
<variable name="LOG_FILE" value=".jalview.log" />
</variables>
<codeSigning macEnabled="true" macPkcs12File="${compiler:OSX_KEYSTORE}" macNotarize="true" appleId="${compiler:OSX_APPLEID}">
</group>
</styleOverride>
<styleOverride name="Jalview" enabled="true">
- <formComponent name="Watermark" id="352" beanClass="com.install4j.runtime.beans.formcomponents.SeparatorComponent" insetTop="0" insetLeft="5" insetBottom="0" useExternalParametrization="true" externalParametrizationName="Jalview" externalParametrizationMode="include">
+ <formComponent name="Watermark" id="352" beanClass="com.install4j.runtime.beans.formcomponents.SeparatorComponent" insetTop="0" insetLeft="5" insetBottom="0" useExternalParametrization="true" externalParametrizationName="Custom watermark" externalParametrizationMode="include">
<serializedBean>
<property name="enabledTitleText" type="boolean" value="false" />
</serializedBean>
<property name="imageEdgeBorderWidth" type="int" value="2" />
<property name="imageFile">
<object class="com.install4j.api.beans.ExternalFile">
- <string>${compiler:JALVIEW_DIR}/${compiler:ICONS_DIR}/${compiler:PNG_ICON_FILE}</string>
+ <string>${compiler:JALVIEW_DIR}/${compiler:TITLE_ICON}</string>
</object>
</property>
<property name="imageInsets">
</action>
</beans>
</group>
- <group name="Windows scripts" id="2949" beanClass="com.install4j.runtime.beans.groups.ActionGroup">
- <beans>
- <action name="Windows copy BAT jalview file" id="2947" beanClass="com.install4j.runtime.beans.actions.files.CopyFileAction" rollbackBarrierExitCode="0">
- <serializedBean>
- <property name="destinationFile">
- <object class="java.io.File">
- <string>${compiler:WRAPPER_SCRIPT_BIN_DIR}/${compiler:WRAPPER_LINK}.bat</string>
- </object>
- </property>
- <property name="files" type="array" class="java.io.File" length="1">
- <element index="0">
- <object class="java.io.File">
- <string>${compiler:WRAPPER_SCRIPT_BIN_DIR}/${compiler:BATCH_WRAPPER_SCRIPT}</string>
- </object>
- </element>
- </property>
- </serializedBean>
- <condition>Util.isWindows() && !(((String)context.getCompilerVariable("WRAPPER_LINK")+".bat").equals((String)context.getCompilerVariable("BATCH_WRAPPER_SCRIPT")))</condition>
- </action>
- <action name="Windows copy PS1 jalview file" id="2948" beanClass="com.install4j.runtime.beans.actions.files.CopyFileAction" rollbackBarrierExitCode="0">
- <serializedBean>
- <property name="destinationFile">
- <object class="java.io.File">
- <string>${compiler:WRAPPER_SCRIPT_BIN_DIR}/${compiler:WRAPPER_LINK}.ps1</string>
- </object>
- </property>
- <property name="files" type="array" class="java.io.File" length="1">
- <element index="0">
- <object class="java.io.File">
- <string>${compiler:WRAPPER_SCRIPT_BIN_DIR}/${compiler:POWERSHELL_WRAPPER_SCRIPT}</string>
- </object>
- </element>
- </property>
- </serializedBean>
- <condition>Util.isWindows() && !(((String)context.getCompilerVariable("WRAPPER_LINK")+".ps1").equals((String)context.getCompilerVariable("POWERSHELL_WRAPPER_SCRIPT")))</condition>
- </action>
- <action name="Windows copy BAT update file" id="3055" beanClass="com.install4j.runtime.beans.actions.files.CopyFileAction" rollbackBarrierExitCode="0">
- <serializedBean>
- <property name="destinationFile">
- <object class="java.io.File">
- <string>${compiler:WRAPPER_SCRIPT_BIN_DIR}/update_${compiler:WRAPPER_LINK}.bat</string>
- </object>
- </property>
- <property name="files" type="array" class="java.io.File" length="1">
- <element index="0">
- <object class="java.io.File">
- <string>${compiler:WRAPPER_SCRIPT_BIN_DIR}/${compiler:BATCH_UPDATE_SCRIPT}</string>
- </object>
- </element>
- </property>
- </serializedBean>
- <condition>Util.isWindows()</condition>
- </action>
- <action name="Windows copy PS1 update file" id="3056" beanClass="com.install4j.runtime.beans.actions.files.CopyFileAction" rollbackBarrierExitCode="0">
- <serializedBean>
- <property name="destinationFile">
- <object class="java.io.File">
- <string>${compiler:WRAPPER_SCRIPT_BIN_DIR}/update_${compiler:WRAPPER_LINK}.ps1</string>
- </object>
- </property>
- <property name="files" type="array" class="java.io.File" length="1">
- <element index="0">
- <object class="java.io.File">
- <string>${compiler:WRAPPER_SCRIPT_BIN_DIR}/${compiler:POWERSHELL_UPDATE_SCRIPT}</string>
- </object>
- </element>
- </property>
- </serializedBean>
- <condition>Util.isWindows()</condition>
- </action>
- </beans>
- </group>
<action id="3020" beanClass="com.install4j.runtime.beans.actions.control.SetProgressAction" actionElevationType="none" rollbackBarrierExitCode="0">
<serializedBean>
<property name="percentValue" type="int" value="100" />
</serializedBean>
<beans>
<formComponent id="38" beanClass="com.install4j.runtime.beans.styles.ContentComponent" insetTop="10" insetLeft="20" insetBottom="10" insetRight="20" />
- <formComponent name="Watermark" id="39" beanClass="com.install4j.runtime.beans.formcomponents.SeparatorComponent" insetTop="0" insetLeft="5" insetBottom="0" useExternalParametrization="true" externalParametrizationName="${compiler:JALVIEW_APPLICATION_NAME}" externalParametrizationMode="include">
+ <formComponent name="Watermark" id="39" beanClass="com.install4j.runtime.beans.formcomponents.SeparatorComponent" insetTop="0" insetLeft="5" insetBottom="0" useExternalParametrization="true" externalParametrizationMode="include">
<serializedBean>
<property name="enabledTitleText" type="boolean" value="false" />
</serializedBean>