Last active
August 29, 2015 13:57
-
-
Save Gordin/9520241 to your computer and use it in GitHub Desktop.
Scripts to install and run Scrolls on linux with PlayOnLinux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Date : 2013-06-02 17:37 | |
# Last revision : 2013-08-06 19:54 | |
# Wine version used : 1.5.29, 1.5.31, 1.6 | |
# Distribution used to test : Ubuntu 13.04 x64 (Unity) | |
# Author : Vimes | |
# Depend: unzip | |
[ "$PLAYONLINUX" = "" ] && exit 0 | |
source "$PLAYONLINUX/lib/sources" | |
TITLE="Scrolls" | |
PREFIX="scrolls" | |
SHORTCUT_NAME="Scrolls" | |
POL_SetupWindow_Init | |
#POL_SetupWindow_SetID 12345 ##TODO | |
POL_Debug_Init | |
POL_SetupWindow_presentation "$TITLE" "Mojang" "http://www.scrolls.com" "Vimes" "$PREFIX" | |
POL_Wine_SelectPrefix "$PREFIX" | |
POL_Wine_PrefixCreate "1.6" | |
POL_System_TmpCreate "$PREFIX" | |
# Download installer | |
POL_SetupWindow_message "$(eval_gettext 'When installing, be sure not to let Scrolls launch automatically, so the POL setup can complete.')" "$TITLE" | |
cd "$POL_System_TmpDir" | |
POL_Download "http://download.scrolls.com/installer/win/Scrolls-Installer.msi" \ | |
"719ca39cfa957858773cdc18d73092c0" | |
POL_Wine_WaitBefore "$TITLE" | |
POL_Wine msiexec /i "$POL_System_TmpDir/Scrolls-Installer.msi" | |
POL_System_TmpDelete | |
# Download game data | |
cd "$WINEPREFIX/drive_c/users/$USER/Local Settings/Application Data/Mojang/Scrolls" || exit 1 | |
POL_Download "http://download.scrolls.com/client/windows.zip" | |
POL_SetupWindow_wait "$(eval_gettext 'Please wait while we extract $TITLE game data.')" "$TITLE" | |
(unzip -qqo ./windows.zip && stat -c %Y windows.zip > last_updated && rm -f ./windows.zip) || exit 1 | |
POL_SetupWindow_VMS "128" | |
POL_Wine_reboot | |
# Remove Z:\ from Wine because otherwise (for some reason) the game | |
# tries to write files in / which results in permissions errors. | |
rm -f "$WINEPREFIX/dosdevices/z:" | |
POL_Shortcut "Scrolls.exe" "$TITLE" "$SHORTCUT_NAME.png" "" | |
POL_SetupWindow_Close | |
exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
UPDATE=windows.zip | |
URL=http://download.scrolls.com/client/$UPDATE | |
PASSWORD=XXXXXXXXXXXXXXXXXX | |
TIMESTAMP=last_updated | |
cd ~/.PlayOnLinux/wineprefix/scrolls/drive_c/users/gordin/Local\ Settings/Application\ Data/Mojang/Scrolls | |
unpack_update () { | |
#safe timestamp from the update to a file | |
stat -c %Y $UPDATE > $TIMESTAMP | |
#unpack the update and remove it afterwards | |
unzip -o $UPDATE && rm $UPDATE | |
} | |
if [[ -f $TIMESTAMP ]]; then | |
#If we have a timestamp, download if there is an update and unpack if we downloaded something (HTTP 200) | |
[[ "$(curl $URL -z "$(date --rfc-2822 -d @$(<$TIMESTAMP))" -o $UPDATE -L -w %{http_code})" == "200" ]] && unpack_update | |
else | |
#If we don't have a timestamp just download and unpack | |
curl $URL -o $UPDATE -L | |
unpack_update | |
fi | |
#copy your Password to the Clipboard so you can STRG+V it | |
echo -n $PASSWORD | xclip -selection clipboard -i | |
#run Scrolls through PlayOnLinux | |
/usr/share/playonlinux/playonlinux --run "Scrolls" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment