WorldsLinuxWrapper/install-worlds.sh

74 lines
2.4 KiB
Bash
Raw Normal View History

2020-01-13 14:58:30 -05:00
#!/bin/bash
2020-01-13 18:28:43 -05:00
export WINEPREFIX=$HOME/.local/share/wineprefixes/worlds
2020-01-13 14:58:30 -05:00
export WINEARCH=win32
2020-01-13 15:18:26 -05:00
export DIR="$WINEPREFIX/drive_c/Program Files/Worlds/WorldsPlayer by Worlds.com"
2020-01-13 14:58:30 -05:00
export DIREXE="$DIR/run.exe"
2020-01-13 18:28:43 -05:00
start () {
rm -rf "$DIR/downloads"
mkdir -p "$DIR/downloads"
if [ $1 == "fresh" ]; then
rm -rf $WINEPREFIX
fi
prefix
}
2020-01-13 14:58:30 -05:00
prefix () {
echo "Settings up the Wine prefix..."
wine init
if ! [ -x "$(command -v winetricks)" ]; then
echo "Error: 'winetricks' not found! Please add it to your path or install it via your package manager."
exit 1
fi
echo "Self updating winetricks..."
sudo winetricks --self-update
echo "Installing components..."
winetricks gdiplus ddr=gdi glsl=disabled allfonts l3codecx devenum quartz wmp10 ie8 win7
install
}
install () {
cd "$DIR/downloads"
echo "Downloading Java 6u45 Windows i586..."
2020-01-13 17:33:45 -05:00
wget --user=$(zenity --forms --title="Oracle Login" --text="An Oracle account is required to download the installer" --add-entry="Email") --password=$(zenity --forms --title="Oracle Login" --text="An Oracle account is required to download the installer" --add-password="Password") https://download.oracle.com/otn/java/jdk/6u45-b06/jre-6u45-windows-i586.exe
2020-01-13 14:58:30 -05:00
if ! [ -f "$DIR/downloads/jre-6u45-windows-i586.exe" ]; then
echo "JRE6 installer not found! Aborting!"
exit 1
fi
2020-01-13 18:28:43 -05:00
wine jre-6u45-windows-i586 /s
2020-01-13 14:58:30 -05:00
echo "Downloading Installer..."
wget "http://cache.worlds.com/downloads/1900/Worlds1900.exe"
echo "Installing Worlds 1900. Please complete the setup."
wine "Worlds1900.exe"
2020-01-13 18:28:43 -05:00
killall run.exe Worlds1900.exe javaw.exe
2020-01-13 14:58:30 -05:00
audio
}
audio () {
echo "Setting up Audio prerequisites..."
cd "$DIR/downloads"
2020-01-13 15:18:26 -05:00
wget "https://www.dropbox.com/s/el0co8k0n0ps6a2/BCM1043.exe"
2020-01-13 18:28:43 -05:00
wine BCM1043.exe /s
2020-01-13 15:18:26 -05:00
wget "https://github.com/Nevcairiel/LAVFilters/releases/download/0.74.1/LAVFilters-0.74.1-Installer.exe"
2020-01-13 18:28:43 -05:00
wine LAVFilters-0.74.1-Installer.exe /s
2020-01-13 14:58:30 -05:00
script
}
script () {
WORLDSSCRIPT=$HOME/worlds.sh
2020-01-13 15:18:26 -05:00
rm $WORLDSSCRIPT
2020-01-13 14:58:30 -05:00
touch "$WORLDSSCRIPT"
echo "#!/bin/sh" >> "$WORLDSSCRIPT"
echo "export WINEPREFIX=$WINEPREFIX" >> "$WORLDSSCRIPT"
echo "export WINEARCH=win32" >> "$WORLDSSCRIPT"
echo "export DIR=\"$DIR\"" >> "$WORLDSSCRIPT"
echo "cd \"$DIR\"" >> "$WORLDSSCRIPT"
echo "rm -rf \"\$DIR/cachedir\"" >> "$WORLDSSCRIPT"
echo "wine \"\$DIR/run.exe\" $*" >> "$WORLDSSCRIPT"
chmod +u $WORLDSSCRIPT
echo "A worlds startup script is available at $WORLDSSCRIPT!"
echo "Setup done!"
}
2020-01-13 18:28:43 -05:00
start