Win-osx-linux zip version chmod +x problem
Posted: Wed Jun 06, 2012 9:50 am
Hi,
Would be great to add :
before the last "exec" line.
Zip files does not store exec flags. Wouldn't it be better to tell the user to check the "enable execution of the file as a program" on the launcher ".sh" than to say him to make a chown -R 755 or do it manually with the GUI?
the launcher ".sh" file would then be :
Would be great to add :
Code: Select all
chmod u+x -R "`dirname \"$0\"`/lib/"Zip files does not store exec flags. Wouldn't it be better to tell the user to check the "enable execution of the file as a program" on the launcher ".sh" than to say him to make a chown -R 755 or do it manually with the GUI?
the launcher ".sh" file would then be :
Code: Select all
#!/bin/sh
# We assume Darwin means Mac OS X. Sorry, Darwin guys.
if [ "x`uname -s`" = "xDarwin" ]; then
dir=`dirname "$0"`
dir=`cd "$dir"; pwd`
base=`basename "$0"`
export RENPY_LAUNCHER_DIR="$dir"
if [ -e "$dir/${base%.sh}.app/Contents/MacOS/${base%.sh}" ] ; then
launcher="$dir/${base%.sh}.app/Contents/MacOS/${base%.sh}"
else
launcher="$dir/${base%.sh}.app/Contents/MacOS/Ren'Py Launcher"
fi
exec "$launcher" "${0%.sh}.py" "$@"
fi
chmod u+x -R "`dirname \"$0\"`/lib/"
exec "`dirname \"$0\"`/lib/python" "-OO" "${0%.sh}.py" "$@"