Switch from wget to curl for downloads. this removes a dependency, and theoretically should not lose any functionality. It is experimental, however, so please watch for bugs.

This commit is contained in:
stormdragon2976 2023-01-21 01:14:45 -05:00
parent 03dfcdbf04
commit b2e1655246

View File

@ -152,12 +152,6 @@ checklist() {
errorList+=("Critical: Curl is not installed. Critical functionality will not work.")
fi
packageList+=("curl")
if command -v wget &> /dev/null ; then
[[ $# -eq 0 ]] && echo "Wget is installed."
else
errorList+=("Critical: Wget is not installed. You will not be able to install any games.")
fi
packageList+=("wget")
if command -v dialog &> /dev/null ; then
[[ $# -eq 0 ]] && echo "Dialog is installed."
else
@ -290,7 +284,7 @@ download() {
fi
# Skip if the item is in cache.
test -e "${cache}/${dest}" && continue
if ! wget -4 -O "${cache}/${dest}" "${i}" ; then
if ! curl -4 --output "${cache}/${dest}" "${i}" ; then
echo "Could not download \"$i\"..."
exit 1
fi
@ -1083,8 +1077,8 @@ gameList=(
"World of War"
)
# Make sure the minimum of curl, sox, wget, wine, and winetricks are installed
for i in curl sox wget wine winetricks ; do
# Make sure the minimum of curl, sox, wine, and winetricks are installed
for i in curl sox wine winetricks ; do
if ! command -v $i &> /dev/null ; then
echo "Please install $i before continuing."
exit 1
@ -2064,8 +2058,8 @@ case "${game}" in
export winVer="win10"
install_wine_bottle ie8 vcrun2015 speechsdk
# This download url breaks the download function, so grab it manually.
wget -O "${cache}/Hearthstone.exe" "https://us.battle.net/download/getInstaller?os=win&installer=Hearthstone-Setup.exe"
wget -O "${cache}/Hearthstone_patch.zip" "https://github.com/HearthstoneAccess/HearthstoneAccess/releases/latest/download/patch.zip"
curl --output "${cache}/Hearthstone.exe" "https://us.battle.net/download/getInstaller?os=win&installer=Hearthstone-Setup.exe"
curl --output "${cache}/Hearthstone_patch.zip" "https://github.com/HearthstoneAccess/HearthstoneAccess/releases/latest/download/patch.zip"
wine "${cache}/Hearthstone.exe" /silent
unzip -o "${cache}/Hearthstone_patch.zip" -d "${WINEPREFIX}/drive_c/Program Files/Hearthstone"
find "${WINEPREFIX}" -type f -name "nvdaControllerClient32.dll" -exec rm -fv "{}" \;
@ -2505,7 +2499,7 @@ EOF
install_wine_bottle
unzip -d "$WINEPREFIX/drive_c/Program Files/sequence-storm" "${cache}/sequence-storm-win64.zip"
write_sequence_storm_reader
wget -O "$WINEPREFIX/drive_c/Program Files/sequence-storm/settings.json" "https://stormgames.wolfe.casa/downloads/sequencestorm-settings.json"
curl --output "$WINEPREFIX/drive_c/Program Files/sequence-storm/settings.json" "https://stormgames.wolfe.casa/downloads/sequencestorm-settings.json"
add_launcher "c:\Program Files\sequence-storm\SequenceStorm.exe"
;;
"Shades of Doom 1.2")
@ -2635,7 +2629,7 @@ EOF
download "https://www.kaldobsky.com/audiogames/Swamp.zip"
unzip -d "$WINEPREFIX/drive_c/Program Files/swamp" "${cache}/Swamp.zip"
# make sure the latest version is installed.
if wget -O "${cache}/SwampPatch.zip" "https://www.kaldobsky.com/audiogames/SwampPatch.zip" ; then
if curl --output "${cache}/SwampPatch.zip" "https://www.kaldobsky.com/audiogames/SwampPatch.zip" ; then
unzip -o -d "$WINEPREFIX/drive_c/Program Files/swamp" "${cache}/SwampPatch.zip"
fi
wine 'c:\Program Files\swamp\checkup.exe' /verysilent