Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto-update local copy of launcher in wrapper if found to be outdated
- Loading branch information
1 parent
a39b47c
commit 5f678f5
Showing
4 changed files
with
51 additions
and
7 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,32 @@ | ||
#!/bin/sh | ||
|
||
available_version="$(cat /app/extra/data/launcher/version.txt)" | ||
home_version="$(cat "${HOME}/.albiononline/launcher/version.txt" 2>/dev/null)" | ||
if [ "${home_version}" != "${available_version}" ]; then | ||
set -e | ||
|
||
if ! [ -f "${HOME}/.albiononline/launcher/version.txt" ]; then | ||
mkdir -p "${HOME}/.albiononline" | ||
rm -rf "${HOME}/.albiononline/launcher" | ||
cp -r /app/extra/data/launcher "${HOME}/.albiononline/" | ||
cp -r /app/extra/launcher "${HOME}/.albiononline/" | ||
fi | ||
cd "${HOME}/.albiononline/" | ||
|
||
cd "${HOME}/.albiononline" | ||
|
||
installed_version="$(cat launcher/version.txt 2>/dev/null | sed -n '/^launcher-linux-full-\(.*\)\r/{;s//\1/;p;q;}')" | ||
|
||
IFS=';' read -a uriver <<<"$(get_albion_online_download_uri)" | ||
version=${uriver[1]} | ||
uri=${uriver[0]} | ||
|
||
if [ "${version}" != "${installed_version}" ]; then | ||
curl "${uri}" -o albion-online-setup --stderr - | zenity --progress --text="Downloading update" --pulsate --no-cancel --auto-close | ||
/app/bin/splitelf albion-online-setup albion-online-setup.zip | ||
rm -rf data | ||
unzip albion-online-setup.zip 'data/launcher/*' | ||
rm -rf launcher | ||
mv data/launcher . | ||
rm -rf data | ||
rm albion-online-setup | ||
rm albion-online-setup.zip | ||
fi | ||
|
||
export LD_PRELOAD="${HOME}/.albiononline/game_x64/Albion-Online_Data/Plugins/x86_64/libSDL2-2.0.so.0" | ||
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${HOME}/.albiononline/launcher" | ||
exec "${HOME}/.albiononline/launcher/Albion-Online" |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/python3 | ||
|
||
import xml.etree.ElementTree as ET | ||
from urllib.request import urlopen | ||
from urllib.parse import urljoin | ||
|
||
base_uri = 'https://live.albiononline.com/autoupdate/' | ||
|
||
manifest_uri = urljoin(base_uri, 'manifest.xml') | ||
manifest = urlopen(manifest_uri) | ||
doc = ET.parse(manifest) | ||
fullinstall = doc.find('installer/linux/fullinstall') | ||
name = fullinstall.attrib['file'] | ||
version = fullinstall.attrib['version'] | ||
print("{};{}".format(urljoin(base_uri, name), version)) |