JAL-3830 Moved wrappers to bin/jalview.* and make a symlink bin/jalview. Install4j...
[jalview.git] / utils / getdown / bin / jalview.ps1
similarity index 90%
rename from utils/getdown/jalviewc.ps1
rename to utils/getdown/bin/jalview.ps1
index 0a5802b..b84e275 100755 (executable)
@@ -18,7 +18,7 @@ if ( $IsWindows -eq $null ) {
 
 # parent dir of this script (should be the getdown app dir). Follow symlinks.
 $TARGET = ( Get-Item $MyInvocation.MyCommand.Path ).Target
-$DIR = If ( $TARGET -eq $null -or $TARGET.LinkType -ne "SymbolicLink" ) { Split-Path $MyInvocation.MyCommand.Path -Parent } Else { Split-Path $TARGET -Parent }
+$DIR = If ( $TARGET -eq $null -or $TARGET.LinkType -ne "SymbolicLink" ) { Split-Path -Path $MyInvocation.MyCommand.Path -Parent } Else { Split-Path -Path $TARGET -Parent }
 
 # set the "-open" parameter if myArg1 is non-zero-length, and not "open" or starts with a "-"
 $OPEN = ""
@@ -26,7 +26,7 @@ if ( $myArg1.length -gt 0 -and ( -not $myArg1.StartsWith("-") ) -and $myArg1 -cn
   $OPEN = "-open"
 }
 
-$APPDIR = $DIR
+$APPDIR = If ( ( Split-Path -Path $DIR -Leaf ) -eq "bin" ) { Split-Path -Path $DIR -Parent } Else { $DIR }
 $JAVAEXE = If ( $myIsWindows ) { "java.exe" } Else { "java" }
 $JAVA = Join-Path -Path $APPDIR -ChildPath ( "jre/" + $( If ( $myIsMacOS ) { "Contents/Home/" } Else { "" } ) + "bin/${JAVAEXE}" )
 $GETDOWNTXT = Join-Path -Path $APPDIR -ChildPath "getdown.txt"