2020-09-05 16:11:01 -04:00
#!/bin/bash
2020-12-16 17:16:16 -05:00
#
# âe contents of this file are subject to the Common Public Attribution
# License Version 1.0 (the âcenseâ you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# https://opensource.org/licenses/CPAL-1.0. The License is based on the Mozilla Public License Version
# 1.1 but Sections 14 and 15 have been added to cover use of software over a
# computer network and provide for limited attribution for the Original
# Developer. In addition, Exhibit A has been modified to be consistent with
# Exhibit B.
#
# Software distributed under the License is distributed on an â ISâasis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
2022-01-16 16:27:28 -05:00
# for THE SPecific language governing rights and limitations under the
2020-12-16 17:16:16 -05:00
# License.
#
# The Original Code is audiogame manager.
#
# The Original Developer is not the Initial Developer and is . If
# left blank, the Original Developer is the Initial Developer.
#
# The Initial Developer of the Original Code is Billy "Storm Dragon" Wolfe. All portions of
# the code written by Billy Wolfe are Copyright (c) 2020. All Rights
# Reserved.
#
# Contributor Michael Taboada.
#
# Attribution Copyright Notice: Audiogame manager copyright 2020 Storm Dragon. All rights reserved.
#
# Attribution Phrase (not exceeding 10 words): A Stormux project
#
# Attribution URL: https://stormgames.wolfe.casa
#
# Graphic Image as provided in the Covered Code, if any.
#
# Display of Attribution Information is required in Larger
# 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.
2022-02-28 07:36:07 -05:00
cache = " ${ XDG_CACHE_HOME :- $HOME /.cache } /audiogame-manager "
2022-01-16 16:08:04 -05:00
updateURL = "https://www.kaldobsky.com/audiogames"
2022-08-07 16:51:42 -04:00
updateFiles = ( "SwampPatch.zip" )
2020-09-05 16:11:01 -04:00
2022-01-24 01:41:45 -05:00
dialog --backtitle "Audiogame manager" --yesno "If you do not have a full 32 bit gstreamer installation, the Swamp music can cause stuttering and crashes. Would you like to remove the music directory after installation?" -1 -1 --stdout
deleteMusic = $?
2022-01-16 16:08:04 -05:00
# Back up configuration files.
for i in losers.txt muted.txt scriptkeys.txt keyconfig.ini ; do
2022-01-24 00:05:02 -05:00
cp -v ~/" .local/wine/aprone/drive_c/Program Files/swamp/ ${ i } " ~/" .local/wine/aprone/drive_c/Program Files/swamp/ ${ i } .agm "
2022-01-16 16:08:04 -05:00
echo " ${ i } backed up as ${ i } .agm "
done | dialog --progressbox "Backing up configuration files. They can be found in your swamp directory." -1 -1
2020-09-05 16:11:01 -04:00
2022-01-16 16:08:04 -05:00
sleep 3
2020-09-05 16:11:01 -04:00
2022-01-16 16:08:04 -05:00
# Download and extract updates
for i in " ${ updateFiles [@] } " ; do
2022-01-16 20:21:10 -05:00
wget -O " ${ cache } / $i " " ${ updateURL } / $i "
2022-01-23 23:58:15 -05:00
unzip -o -d ~/".local/wine/aprone/drive_c/Program Files/swamp" " ${ cache } / ${ i } "
2022-01-16 16:08:04 -05:00
done | dialog --progressbox "Updating Swamp, please wait..." -1 -1
2020-09-05 16:11:01 -04:00
2022-01-24 01:41:45 -05:00
# Delete music if requested.
if [ [ $deleteMusic -eq 0 ] ] ; then
rm -frv ~/".local/wine/aprone/drive_c/Program Files/swamp/sounds/Music/"
fi
2020-09-05 16:11:01 -04:00
exit 0