diff --git a/bin/launch_pcsx2_linux.sh b/bin/launch_pcsx2_linux.sh index 6cc4022da2..ba8216a304 100755 --- a/bin/launch_pcsx2_linux.sh +++ b/bin/launch_pcsx2_linux.sh @@ -5,19 +5,26 @@ # Rationale: There is no guarantee on the directory when PCSX2 is launched from a shortcut. # This behavior trigger the first time wizards everytime... -if test $0 = "launch_pcsx2_linux.sh" || $0 = "sh" || $0 = "bash" ; then - echo "Error the script was directly 'called'" - echo "Use either /absolute_path/launch_pcsx2_linux.sh or ./relative_path/launch_pcsx2_linux.sh" - exit 1 -fi +current_script=$0 + +[ $current_script = "launch_pcsx2_linux.sh" ] || [ $current_script = "sh" ] || [ $current_script = "bash" ] && \ + echo "Error the script was directly 'called'" && \ + echo "Use either /absolute_path/launch_pcsx2_linux.sh or ./relative_path/launch_pcsx2_linux.sh" && exit 1; # Note: sh (dash on debian) does not support pushd, popd... # Save current directory PWD_old=$PWD # Go to the script directory -chdir `dirname $0` -./pcsx2 +chdir `dirname $current_script` +if [ -e pcsx2 ] ; then + ./pcsx2 +else + echo "Error PCSX2 not found" + echo "Maybe the script was directly 'called'" + echo "Use either /absolute_path/launch_pcsx2_linux.sh or ./relative_path/launch_pcsx2_linux.sh" + exit 1 +fi # Go back to the old directory chdir $PWD_old