Started work on the checklist functionality. Also have a non-working function to automate key presses for installers that require it.

This commit is contained in:
Storm Dragon 2020-08-27 17:35:32 -04:00
parent bc906ec5a5
commit 235f44935f

View File

@ -3,6 +3,43 @@
# Wine configuration section
checklist() {
declare -a errorList
echo "Checking your system..."
echo
if command -v wine &> /dev/null ; then
echo "Wine is installed."
else
errorList+=("Critical: Wine is not installed. You will not be able to play any games.")
fi
if command -v wget &> /dev/null ; then
echo "Wget is installed."
else
errorList+=("Critical: Wget is not installed. You will not be able to install any games.")
fi
if [[ -d /usr/share/wine/gecko/ ]]; then
echo "Found wine gecko."
else
errorList+=("Warning: Wine gecko not found, some games may not work.")
fi
if [[ -d /usr/share/wine/mono/ ]]; then
echo "Found wine mono."
else
errorList+=("Warning: Wine mono not found, some games may not work.")
fi
# Show the results
if [[ ${#errorList[@]} -eq 0 ]]; then
echo "No problems found, you are good to go."
exit 0
fi
echo "Errors detected, here is a list along with the severity."
echo "Note that errors marked critical mean that you will not be able to install and play games until they are resolved."
for i in "${errorList[@]}" ; do
echo "$i"
done
exit 0
}
install_wine_bottle() {
local bottle="${game,,}"
bottle="${bottle//[[:space:]]/-}"
@ -100,17 +137,17 @@ add_launcher() {
automate_installer() {
# Function arguments are the keys to be pressed.
declare -a keyList=("sleep 15")
declare -a keyListD=("sleep 20")
for i in ${@} ; do
case "$i" in
"alt+f") keyList+=("key ${i}");;
"alt+i") keyList+=("sleep 10 key ${i}");;
"alt+"*) keyList+=("key ${i} sleep 2");;
*"+"*) keyList+=("key ${i} sleep 2");;
*) xdotool type ${i};;
*) xdotool sleep 15 type ${i} & ;;
esac
done
xdotool ${keyList[*]}
xdotool ${keyList[*]} &
}
# 32 bit installations work best and are the default here, if you need to override it, do it in the game specific installation steps.
@ -141,13 +178,15 @@ fi
# Array of command line arguments
command=(
"i" # Install
"c" # Check wine environment
"i" # Install games
)
while getopts "${command[@]//[[:space:]]/}" i ; do
while getopts "${command[*]//[[:space:]]/}" i ; do
case "$i" in
c) checklist;;
h) show_help;;
i) game_installer
i) game_installer;;
esac
done
@ -167,9 +206,8 @@ case "${game}" in
"Kitchensinc Games")
install_wine_bottle vb6run speechsdk
wget -O "$WINEPREFIX/drive_c/Program Files/Kitchensinc complete Setup.exe" "https://www.agarchive.net/games/kitchensinc/Kitchensinc%20complete%20Setup.exe"
wine "$WINEPREFIX/drive_c/Program Files/Kitchensinc complete Setup.exe" &
xdotool sleep 5 key y sleep 2 key alt+n sleep 2 key alt+n sleep 2 key alt+n sleep 2 key alt+n sleep 2 key alt+i sleep 10 key alt+f
#automate_installer y alt+n alt+n alt+n alt+n alt+i alt+f
automate_installer y alt+n alt+n alt+n alt+n alt+i alt+f
wine "$WINEPREFIX/drive_c/Program Files/Kitchensinc complete Setup.exe"
add_launcher "c:\Program Files\Kitchen's Sink\gamemenu.exe"
#rm -f "$WINEPREFIX/drive_c/Program Files/Kitchensinc complete Setup.exe"
;;