Hopefully the automate installer using xdotool will work now. There's a wineserver -w in case something goes wrong to give the user a chance to fix with ocrdesktop.

This commit is contained in:
Storm Dragon 2020-09-02 22:36:48 -04:00
parent cf08791ba0
commit 20f11c04a3

View File

@ -17,6 +17,16 @@ checklist() {
else else
errorList+=("Critical: Wget is not installed. You will not be able to install any games.") errorList+=("Critical: Wget is not installed. You will not be able to install any games.")
fi fi
if command -v ocrdesktop &> /dev/null ; then
echo "Ocrdesktop is installed."
else
errorList+=("Warning: ocrdesktop is not installed. It can help if the installer gets stuck to figure out what is happening.")
fi
if command -v unix2dos &> /dev/null ; then
echo "Dos2unix is installed."
else
errorList+=("Warning: unix2dos is not installed. Some games need a configuration file in dos format before they will run.")
fi
if [[ -d /usr/share/wine/gecko/ ]]; then if [[ -d /usr/share/wine/gecko/ ]]; then
echo "Found wine gecko." echo "Found wine gecko."
else else
@ -135,17 +145,19 @@ add_launcher() {
automate_installer() { automate_installer() {
# Function arguments are the keys to be pressed. # Function arguments are the keys to be pressed.
declare -a keyListD=("sleep 20") sleep 15
declare -a keyList
for i in ${@} ; do for i in ${@} ; do
case "$i" in case "$i" in
"alt+f") keyList+=("key ${i}");; "alt+f") keyList+=("sleep 15 key ${i}");;
"alt+i") keyList+=("sleep 10 key ${i}");; "space") keyList+=("sleep 1 key ${i}");;
"alt+"*) keyList+=("key ${i} sleep 2");; *"+"*) keyList+=("sleep 1 key ${i}");;
*"+"*) keyList+=("key ${i} sleep 2");; *) xdotool sleep 1 type ${i};;
*) xdotool sleep 15 type ${i} & ;;
esac esac
done done
xdotool ${keyList[*]} & xdotool ${keyList[*]} &
# call wineserver -w in case something failed here, the user will have a chance to try to fix it.
wineserver -w
} }
# Settings file # Settings file
@ -158,6 +170,8 @@ export WINEDEBUG="-all"
# During installation, you can set winVer to the versions available. # During installation, you can set winVer to the versions available.
# To set winetricks arguments, such as virtual desktop, set the winetricksSettings variable. # To set winetricks arguments, such as virtual desktop, set the winetricksSettings variable.
# Example: winetricksSettings="vd=1024x768" # Example: winetricksSettings="vd=1024x768"
# Manual installation is not default, make sure it's unset
unset manualInstall
# The list of games available for installation. # The list of games available for installation.
# Use menu friendly names. # Use menu friendly names.
@ -187,6 +201,7 @@ fi
command=( command=(
"c" # Check wine environment "c" # Check wine environment
"i" # Install games "i" # Install games
"m" # Manually handle install screens
) )
while getopts "${command[*]//[[:space:]]/}" i ; do while getopts "${command[*]//[[:space:]]/}" i ; do
@ -194,6 +209,7 @@ while getopts "${command[*]//[[:space:]]/}" i ; do
c) checklist;; c) checklist;;
h) show_help;; h) show_help;;
i) game_installer;; i) game_installer;;
i) manualInstall="true"
esac esac
done done
@ -222,9 +238,16 @@ case "${game}" in
rm -f "$WINEPREFIX/drive_c/Program Files/Kitchensinc complete Setup.exe" rm -f "$WINEPREFIX/drive_c/Program Files/Kitchensinc complete Setup.exe"
;; ;;
"Light Cars") "Light Cars")
install_wine_bottle dx8vb install_wine_bottle dx8vb vb6run
wget -O "$WINEPREFIX/drive_c/Program Files/light cars setup.exe" "https://www.agarchive.net/games/lighttech/light%20cars%20setup.exe" wget -O "$WINEPREFIX/drive_c/Program Files/light cars setup.exe" "https://www.agarchive.net/games/lighttech/light%20cars%20setup.exe"
wine "$WINEPREFIX/drive_c/Program Files/light cars setup.exe" /silent if [[ -n "$manualInstall" ]]; then
wine "$WINEPREFIX/drive_c/Program Files/light cars setup.exe"
else
wine "$WINEPREFIX/drive_c/Program Files/light cars setup.exe" &
automate_installer alt+n alt+a space alt+n alt+n alt+i alt+f
fi
echo -e "${USER} ${HOST}\nna@na.na\nUS" > ~/.local/wine/light-cars/drive_c/Program\ Files/Lighttech\ Interactive/Light\ Cars/config.dat
unix2dos ~/.local/wine/light-cars/drive_c/Program\ Files/Lighttech\ Interactive/Light\ Cars/config.dat
add_launcher "c:\Program Files\Lighttech Interactive\Light Cars\lightCars.exe" add_launcher "c:\Program Files\Lighttech Interactive\Light Cars\lightCars.exe"
rm -f "$WINEPREFIX/drive_c/Program Files/light cars setup.exe" rm -f "$WINEPREFIX/drive_c/Program Files/light cars setup.exe"
;; ;;