audiogame-manager/.install/Pipe 2 Blast Chamber.sh

41 lines
2.5 KiB
Bash

install_wine_bottle vb6run dx8vb
# FIXME: Hacky, but it works. Install dotnet35 by itself so it actually doesn't hang.
winetricks -q dotnet35sp1
${wine}server -k # Damn you, dotnet.
download "http://www.agarchive.net/games/bsc/BlastChamberSetup.exe" "https://www.agarchive.net/games/bsc/BSC%20unlock%20code%20generator.7z"
wine "${cache}/BlastChamberSetup.exe" /silent &
xdotool sleep 10 key --clearmodifiers alt+y 2> /dev/null
sleep 30 && ${wine}server -k # Sometimes the installer finishes but the ${wine}server has more processes that don't exit, so we can't depend on ${wine}server -w.
mkdir -p "$WINEPREFIX/drive_c/Program Files/bsc-key-generator"
7z x -o"$WINEPREFIX/drive_c/Program Files/bsc-key-generator" "${cache}/BSC unlock code generator.7z"
echo "$USER"$'\n'"$(hostname)"$'\n'"none"$'\n'"US" > "$WINEPREFIX/drive_c/Program Files/Blast Chamber/config.dat"
unix2dos "$WINEPREFIX/drive_c/Program Files/Blast Chamber/config.dat"
if command -v xclip &> /dev/null && command -v xdotool &> /dev/null ; then
wine "c:\Program Files\Blast Chamber\register.exe" &
xdotool sleep 10 key Return sleep 2 key Return sleep 2 key Alt+n
sleep 1
regcode="$(xclip -selection clipboard -o)"
xdotool sleep 1 key Shift+Tab sleep 1 key Return
# FIXME: Kind of hacky, but let's make sure it actually exitted.
sleep 5
${wine}server -k
wine "c:\Program Files\bsc-key-generator\BlindsoftwareUnlockCodeGenerator.exe" &
xdotool sleep 10 key Return sleep 2 type b
xdotool sleep 1 key Tab sleep 1 type $regcode
xdotool sleep 1 key Tab sleep 1 key Return
sleep 2
regcode="$(xclip -selection clipboard -o)" # Might as well reuse the variable.
# FIXME: Kind of hacky, but let's make sure it actually exitted since I can't find a good way to exit this program.
sleep 5
${wine}server -k
wine "c:\Program Files\Blast Chamber\register.exe" &
echo "$regcode" | xclip -selection clipboard
xdotool sleep 10 key Return sleep 2 key Shift+Tab sleep 1 key Shift+Tab sleep 1 key Return
# FIXME: Kind of hacky, but let's make sure it actually exitted.
sleep 5
${wine}server -k
else
echo "Warning: You need xclip and xdotool for this installer to finish the registration process, however, you don't have them. Either remove the program, install the stated tools, and reinstall it, or go on your own. Caveat Emptor, go to jail, do not pass go, do not collect audiogame rewards and all that stuff."
fi
add_launcher "c:\Program Files\Blast Chamber\pipe.exe"