Improved the Crazy Party update script.
This commit is contained in:
		| @@ -37,16 +37,28 @@ | |||||||
| #    Works which are defined in the CPAL as a work which combines Covered Code | #    Works which are defined in the CPAL as a work which combines Covered Code | ||||||
| #    or portions thereof with code not governed by the terms of the CPAL. | #    or portions thereof with code not governed by the terms of the CPAL. | ||||||
|   |   | ||||||
|  | newVersion=82 | ||||||
|  |  | ||||||
|  | WINEPREFIX="${XDG_DATA_HOME:-$HOME/.local}/wine/crazy-party" | ||||||
|  | oldVersion=$(find ~/.local/wine/crazy-party -type d -name 'Crazy-Party-beta*' | tr -cd '[:digit:]') | ||||||
| cache="${XDG_CACHE_HOME:-$HOME/.cache}/audiogame-manager" | cache="${XDG_CACHE_HOME:-$HOME/.cache}/audiogame-manager" | ||||||
| configFile="${XDG_CONFIG_HOME:-$HOME/.config}/storm-games/audiogame-manager/games.conf" | configFile="${XDG_CONFIG_HOME:-$HOME/.config}/storm-games/audiogame-manager/games.conf" | ||||||
| url="http://pragmapragma.free.fr/crazy-party/Crazy-Party-beta78.zip" |  | ||||||
| (rm -v "${cache}/Crazy-Party-beta77.zip" | if [[ $oldVersion -eq $newVersion ]]; then | ||||||
| wget -O "${cache}/Crazy-Party-beta78.zip" "$url" || { echo "Could not download file."; exit 1; } |     echo "Crazy Party is up to date." | ||||||
| unzip -DDod "$HOME/.local/wine/crazy-party/drive_c/Program Files" "${cache}/Crazy-Party-beta78.zip" |     exit 0 | ||||||
| rm -fv "$HOME/.local/wine/crazy-party/drive_c/Program Files/Crazy-Party-beta78/nvdaControllerClient32.dll" | fi | ||||||
| sed -i 's/Crazy-Party-beta77/Crazy-Party-beta78/' "$configFile" |  | ||||||
| mv -v "$HOME/.local/wine/crazy-party/drive_c/Program Files/Crazy-Party-beta77/save.bin" "$HOME/.local/wine/crazy-party/drive_c/Program Files/Crazy-Party-beta78/" |  | ||||||
| cp -ruv "$HOME/.local/wine/crazy-party/drive_c/Program Files/Crazy-Party-beta77/"* "$HOME/.local/wine/crazy-party/drive_c/Program Files/Crazy-Party-beta78/" 2> /dev/null | url="http://pragmapragma.free.fr/crazy-party/Crazy-Party-beta${newVersion}.zip" | ||||||
| rm -rf "$HOME/.local/wine/crazy-party/drive_c/Program Files/Crazy-Party-beta77/") | dialog --progressbox "updating Crazy Party, please wait..." -1 -1 | (rm -v "${cache}/Crazy-Party-beta${oldVersion}.zip" | ||||||
|  | wget -O "${cache}/Crazy-Party-beta${newVersion}.zip" "$url" || { echo "Could not download file."; exit 1; } | ||||||
|  | unzip -DDod "${WINEPREFIX}/drive_c/Program Files" "${cache}/Crazy-Party-beta${newVersion}.zip" | ||||||
|  | find "${WINEPREFIX}" -type f -name 'Tolk.dll' -exec cp -v "${cache}/Tolk.dll" "{}" \; | ||||||
|  | find "${WINEPREFIX}" -type f -name 'nvdaControllerClient64.dll' -exec cp -v "${cache}/nvda2speechd64.dll" "{}" \; | ||||||
|  | sed -i "s/Crazy-Party-beta${oldVersion}/Crazy-Party-beta${newVersion}/" "$configFile" | ||||||
|  | cp -v "${WINEPREFIX}/drive_c/Program Files/Crazy-Party-beta${oldVersion}/save.bin" "$HOME/.local/wine/crazy-party/drive_c/Program Files/Crazy-Party-beta${newVersion}/" | ||||||
|  | cp -ruv "${WINEPREFIX}/drive_c/Program Files/Crazy-Party-beta${oldVersion}/"* "$HOME/.local/wine/crazy-party/drive_c/Program Files/Crazy-Party-beta${newVersion}/" 2> /dev/null | ||||||
|  | rm -rf "${WINEPREFIX}/drive_c/Program Files/Crazy-Party-beta${oldVersion}/") | dialog --progressbox "updating Crazy Party, please wait..." -1 -1 | ||||||
|  |  | ||||||
| exit 0 | exit 0 | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user