Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# New Script

##### I've created a new and improved Proton Manager, take a look here: https://github.com/Termuellinator/Proton-Community-Updater

# CProton - Custom Proton Installscript
Script to make it easier to update Proton GE to the latest version.

Expand Down
58 changes: 56 additions & 2 deletions cproton.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,60 @@ InstallProtonGE() {
installComplete=true
}

Wanttodelete() {
read -r -p "Do you want to delete intalled versions? <y/N> " prompt
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]; then
DeleteProtonCheck
else
RestartSteamCheck
fi
}

DeleteProtonCheck() {
echo "Installed runners:"
installed_versions=($(ls -d "$dstpath"/*/))
for((i=0;i<${#installed_versions[@]};i++)); do
inumber=$(("$i" + 1))
folder=$(echo "${installed_versions[i]}" | rev | cut -d/ -f2 | rev)
echo "$inumber. $folder"
done
echo ""
echo -n "Please choose an option to remove [1-${#installed_versions[@]}]:"
read -ra option_remove

case "$option_remove" in
[1-9])
if (( $option_remove<= ${#installed_versions[@]} )); then
remove_option=${installed_versions[$option_remove -1]}
echo "removing $remove_option"
DeleteProtonPrompt
else
echo "That is not a valid option"
fi
;;
*)
echo "Not a valid option"
;;
esac
}

DeleteProtonPrompt() {
read -r -p "Do you really want to permanently delete this version? <y/N> " prompt
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]; then
DeleteProton
else
echo "Operation canceled"
Wanttodelete
fi
}

DeleteProton() {
rm -rf $remove_option
echo "removed $remove_option"
installComplete=true
Wanttodelete
}

RestartSteam() {
if [ "$( pgrep steam )" != "" ]; then
echo "Restarting Steam"
Expand Down Expand Up @@ -77,9 +131,10 @@ InstallationPrompt() {
read -r -p "Do you want to try to download and (re)install this release? <y/N> " prompt
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]; then
InstallProtonGE
Wanttodelete
else
echo "Operation canceled"
exit 0
Wanttodelete
fi
fi
}
Expand All @@ -105,5 +160,4 @@ fi

if [ ! "$parameter" == "-l" ]; then
InstallationPrompt
RestartSteamCheck
fi