79 lines
3 KiB
Bash
Executable file
79 lines
3 KiB
Bash
Executable file
#!/bin/bash
|
|
echo this script will install Project Polygon 2010-2012 clients
|
|
echo the script assumes a .wine prefix
|
|
echo press ctrl^c to exit
|
|
echo or enter to continue
|
|
read
|
|
|
|
#Download game
|
|
rm -f "Polygon2010.exe"
|
|
rm -f "Polygon2011.exe"
|
|
rm -f "Polygon2012.exe"
|
|
wget "https://setup2010.pizzaboxer.xyz/Polygon2010.exe"
|
|
wget "https://setup2011.pizzaboxer.xyz/Polygon2011.exe"
|
|
wget "https://setup2012.pizzaboxer.xyz/Polygon2012.exe"
|
|
wine "Polygon2010.exe"
|
|
wine "Polygon2011.exe"
|
|
wine "Polygon2012.exe"
|
|
echo "Clients done downloading!"
|
|
|
|
#Create .desktop files
|
|
#Roblox 2010
|
|
DESKTOPFILE10=$HOME/.local/share/applications/PolygonURL10.desktop
|
|
MIMETYPE10=x-scheme-handler/polygon-ten
|
|
echo "[Desktop Entry]" > $DESKTOPFILE10
|
|
echo "Version=1.0" >> $DESKTOPFILE10
|
|
echo "Type=Application" >> $DESKTOPFILE10
|
|
echo "Name=Polygon URL 10" >> $DESKTOPFILE10
|
|
echo "Comment=Play Polygon games!" >> $DESKTOPFILE10
|
|
echo "Exec=wine $HOME/.wine/drive_c/users/$USER/AppData/Local/Project\ Polygon/Versions/version-386164ab165b55af/Polygon.exe %u" >> $DESKTOPFILE10
|
|
echo "Categories=Game;" >> $DESKTOPFILE10
|
|
echo "MimeType=$MIMETYPE10;" >> $DESKTOPFILE10
|
|
|
|
#Roblox 2011
|
|
DESKTOPFILE11=$HOME/.local/share/applications/PolygonURL11.desktop
|
|
MIMETYPE11=x-scheme-handler/polygon-eleven
|
|
echo "[Desktop Entry]" > $DESKTOPFILE11
|
|
echo "Version=1.0" >> $DESKTOPFILE11
|
|
echo "Type=Application" >> $DESKTOPFILE11
|
|
echo "Name=Polygon URL 11" >> $DESKTOPFILE11
|
|
echo "Comment=Play Polygon games!" >> $DESKTOPFILE11
|
|
echo "Exec=wine $HOME/.wine/drive_c/users/$USER/AppData/Local/Project\ Polygon/Versions/version-9512c515176f9859/Polygon.exe %u" >> $DESKTOPFILE11
|
|
echo "Categories=Game;" >> $DESKTOPFILE11
|
|
echo "MimeType=$MIMETYPE11;" >> $DESKTOPFILE11
|
|
|
|
#Roblox 2012
|
|
DESKTOPFILE12=$HOME/.local/share/applications/PolygonURL12.desktop
|
|
MIMETYPE12=x-scheme-handler/polygon-twelve
|
|
echo "[Desktop Entry]" > $DESKTOPFILE12
|
|
echo "Version=1.0" >> $DESKTOPFILE12
|
|
echo "Type=Application" >> $DESKTOPFILE12
|
|
echo "Name=Polygon URL 12" >> $DESKTOPFILE12
|
|
echo "Comment=Play Polygon games!" >> $DESKTOPFILE12
|
|
echo "Exec=wine $HOME/.wine/drive_c/users/$USER/AppData/Local/Project\ Polygon/Versions/version-f9324578ab26456f/Polygon.exe %u" >> $DESKTOPFILE12
|
|
echo "Categories=Game;" >> $DESKTOPFILE12
|
|
echo "MimeType=$MIMETYPE12;" >> $DESKTOPFILE12
|
|
|
|
update-desktop-database "$HOME/.local/share/applications"
|
|
echo "Created desktop files"
|
|
|
|
#Add entries for URL handlers
|
|
MIMEAPPS=$HOME/.local/share/applications/mimeapps.list
|
|
MIMEAPPSBAK=$HOME/.local/share/applications/mimeapps.list.bak
|
|
if [ -f "$MIMEAPPS" ]; then
|
|
echo "$MIMEAPPS already exists"
|
|
echo "Making a backup as mimeapps.list.bak"
|
|
echo "In case the script messes it up"
|
|
cp $MIMEAPPS $MIMEAPPSBAK
|
|
else
|
|
echo "[Default Applications]" > $MIMEAPPS
|
|
fi
|
|
|
|
MIMEENTRY10="$MIMETYPE10=$(basename "$DESKTOPFILE10")"
|
|
MIMEENTRY11="$MIMETYPE11=$(basename "$DESKTOPFILE11")"
|
|
MIMEENTRY12="$MIMETYPE12=$(basename "$DESKTOPFILE12")"
|
|
echo $MIMEENTRY10 >> $MIMEAPPS
|
|
echo $MIMEENTRY11 >> $MIMEAPPS
|
|
echo $MIMEENTRY12 >> $MIMEAPPS
|
|
echo "Created URL handlers"
|
|
update-mime-database "$HOME/.local/share/mime"
|