Upgrade install if newer version is run

This commit is contained in:
Paul Chote
2010-07-03 15:02:24 +12:00
committed by Chris Forbes
parent a74705f34d
commit 1b38c4a6cb
2 changed files with 11 additions and 1 deletions

View File

@@ -27,6 +27,7 @@ CNC_MIXEN="http://open-ra.org/packages/cnc-packages.zip"
APP_PATH=`echo $0 | awk '{split($0,patharr,"/"); idx=1; while(patharr[idx+3] != "") { if (patharr[idx] != "/") {printf("%s/", patharr[idx]); idx++ }} }'`
EXE_PATH="$APP_PATH/Contents/MacOS/"
PAYLOAD="$APP_PATH/Contents/Resources/payload.zip"
VERSION=`cat "$APP_PATH/Contents/Resources/VERSION"`
export LD_LIBRARY_PATH="$EXE_PATH/lib":$LD_LIBRARY_PATH
export MONO_PATH="$EXE_PATH/lib"
@@ -100,6 +101,13 @@ if [ ! -e "$GAME_PATH/OpenRA.Game.exe" ]; then
fi
fi
# Is the installed version older than the current version?
INSTVER=`cat "$GAME_PATH/VERSION"`
if [ $INSTVER -lt $VERSION ]; then
echo "Updating installed version $INSTVER to $VERSION"
unzip -o "$PAYLOAD" -d "$GAME_PATH"
fi
# Prompt for the mod to run
MODBUTTON=`osascript -e 'tell application "Finder"
display dialog "Choose a mod" buttons {"Red Alert", "C&C"} \

View File

@@ -25,13 +25,15 @@ cd $PAYLOAD
for i in $EXCLUDE; do
find . -path "$i" -delete
done
date "+%Y%m%d%H" >> "VERSION"
zip payload -r -9 *
cd $PACKAGING_PATH
# Move everything into the app bundle
cp -r "$LAUNCHER_PATH" .
cp "$PAYLOAD/payload.zip" "OpenRA.app/Contents/Resources/"
cp "$PAYLOAD/VERSION" "OpenRA.app/Contents/Resources/"
rm -rf $PAYLOAD
zip OpenRA -r -9 OpenRA.app
echo "Done!"