Write a utility wrapper for linux. Untested / Unfinished.
This commit is contained in:
24
packaging/linux/OpenRA.Utility.sh
Executable file
24
packaging/linux/OpenRA.Utility.sh
Executable file
@@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# OpenRA utility wrapper for linux systems
|
||||||
|
|
||||||
|
authenticate () {
|
||||||
|
if command -v gksudo > /dev/null; then
|
||||||
|
gksudo --description "OpenRA Installer" -- mono OpenRA.Utility.exe $@ || echo "Error: Permission denied."
|
||||||
|
elif command -v kdesu > /dev/null; then
|
||||||
|
kdesudo -d -- mono OpenRA.Utility.exe $@ || echo "Error: Permission denied."
|
||||||
|
else
|
||||||
|
# Try running without escalating
|
||||||
|
mono OpenRA.Utility.exe $@
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ "$1" == "--display-filepicker" ]]; then
|
||||||
|
if command -v zenity > /dev/null ; then
|
||||||
|
zenity --file-selection --title $2
|
||||||
|
else
|
||||||
|
mono OpenRA.Utility.exe $@
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# Everything else requires root running an -inner variant
|
||||||
|
authenticate "$1-inner" ${@:2}
|
||||||
|
fi
|
||||||
@@ -18,9 +18,9 @@ rm -rf $ROOTDIR
|
|||||||
# Game files
|
# Game files
|
||||||
mkdir -p $ROOTDIR/usr/bin/
|
mkdir -p $ROOTDIR/usr/bin/
|
||||||
cp -T openra-bin root/usr/bin/openra
|
cp -T openra-bin root/usr/bin/openra
|
||||||
|
|
||||||
mkdir -p $ROOTDIR/usr/share/openra/
|
mkdir -p $ROOTDIR/usr/share/openra/
|
||||||
cp -R $BUILTDIR/* "$ROOTDIR/usr/share/openra/" || exit 3
|
cp -R $BUILTDIR/* "$ROOTDIR/usr/share/openra/" || exit 3
|
||||||
|
cp -T OpenRA.Utility.sh $ROOTDIR/usr/share/openra/
|
||||||
|
|
||||||
# Desktop Icons
|
# Desktop Icons
|
||||||
mkdir -p $ROOTDIR/usr/share/applications/
|
mkdir -p $ROOTDIR/usr/share/applications/
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
cd /usr/share/openra
|
cd /usr/share/openra
|
||||||
mono /usr/share/openra/OpenRA.Game.exe SupportDir=~/.openra "$@"
|
mono OpenRA.Game.exe SupportDir=~/.openra UtilityPath=OpenRA.Utility.sh "$@"
|
||||||
|
|||||||
Reference in New Issue
Block a user