-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
51 lines (44 loc) · 1.93 KB
/
install.sh
File metadata and controls
51 lines (44 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# scriptlet:_common/download.sh
# scriptlet:_common/os_like.sh
##
# Install Glorious Eggroll's Proton fork on a requested version
#
# https://github.com/GloriousEggroll/proton-ge-custom
#
# Will install Proton into /opt/script-collection/GE-Proton${VERSION}
# with its pfx directory in /opt/script-collection/GE-Proton${VERSION}/files/share/default_pfx
#
# @arg $1 string Proton version to install
#
# CHANGELOG:
# 2026.04.26 - Supress command output on Ubuntu
# 2026.04.23 - Register proton path in alternatives to /usr/local/bin/proton
# 2025.11.23 - Use download scriptlet for downloading
# 2024.12.22 - Initial version
#
function install_proton() {
VERSION="${1:-9-21}"
PROTON_URL="https://github.com/GloriousEggroll/proton-ge-custom/releases/download/GE-Proton${VERSION}/GE-Proton${VERSION}.tar.gz"
PROTON_TGZ="$(basename "$PROTON_URL")"
PROTON_NAME="$(basename "$PROTON_TGZ" ".tar.gz")"
# We will use this directory as a working directory for source files that need downloaded.
[ -d /opt/script-collection ] || mkdir -p /opt/script-collection
# Grab Proton from Glorious Eggroll
if ! download "$PROTON_URL" "/opt/script-collection/$PROTON_TGZ" --no-overwrite; then
echo "install_proton: Cannot download Proton from ${PROTON_URL}!" >&2
return 1
fi
# Extract GE Proton into /opt
if [ ! -e "/opt/script-collection/$PROTON_NAME" ]; then
tar -x -C /opt/script-collection/ -f "/opt/script-collection/$PROTON_TGZ"
fi
# Update distro registrations for alternative software.
if os_like debian; then
update-alternatives --install "/usr/local/bin/proton" "proton" "/opt/script-collection/$PROTON_NAME/proton" 1 >&2
elif os_like rhel; then
alternatives --install "/usr/local/bin/proton" "proton" "/opt/script-collection/$PROTON_NAME/proton" 1 >&2
elif os_like suse; then
update-alternatives --install "/usr/local/bin/proton" "proton" "/opt/script-collection/$PROTON_NAME/proton" 1 >&2
fi
echo "/opt/script-collection/$PROTON_NAME"
}