diff --git a/README.md b/README.md index ad16766..f7f0ef9 100644 --- a/README.md +++ b/README.md @@ -5,20 +5,11 @@ If you get a `permission denied` on any script present in this repository, even a simple set of shell scripts to Install\Remove the latest version of wine from winehq's official repositories without any error. To install wine, Simply copy this: -Ubuntu 22.04: +Ubuntu: ``` sudo apt install wget -wget https://raw.githubusercontent.com/RishonDev/get-wine-latest.sh/main/get-wine-7.10-ubuntu_22_04.sh -chmod +x get-wine-7.10-ubuntu_22_04.sh -./get-wine-7.10-ubuntu_22_04.sh +wget https://raw.githubusercontent.com/RishonDev/get-wine-latest.sh/main/wine-installer-ubuntu.sh +chmod +x wine-installer-ubuntu.sh +./wine-installer-ubuntu ``` -Ubuntu 20.04: -``` -sudo apt install wget -wget https://raw.githubusercontent.com/RishonDev/get-wine-latest.sh/main/get-wine-7.10-ubuntu_20_04.sh -chmod +x get-wine-7.10-ubuntu_20_04.sh -./get-wine-7.10-ubuntu_20_04.sh -``` - -I won't be adding support for 21.10 since it's reaching it's end of life. i won't be adding for 18.04 xenial as well since it doesn't have the rquired pakages in it's repositories to make wine function properly. diff --git a/get-wine-7.10-ubuntu_20_04.sh b/get-wine-7.10-ubuntu_20_04.sh deleted file mode 100644 index 3174d51..0000000 --- a/get-wine-7.10-ubuntu_20_04.sh +++ /dev/null @@ -1,15 +0,0 @@ -echo "Setting up dependencies..." -sudo dpkg --add-architecture i386 -wget -nc https://dl.winehq.org/wine-builds/ubuntu/dists/focal/winehq-focal.sources -sudo mv winehq-focal.sources /etc/apt/sources.list.d/ -sudo apt update -wget -nc https://dl.winehq.org/wine-builds/winehq.key -sudo mv winehq.key /usr/share/keyrings/winehq-archive.key -sudo apt update -echo "\nInstalling wine 7.11 ...." -sudo apt install winehq-stable winetricks - -echo "\nSetting up wine..." -winecfg -echo "\nDone!" - diff --git a/get-wine-7.10-ubuntu_22_04.sh b/get-wine-7.10-ubuntu_22_04.sh deleted file mode 100644 index f7ab66c..0000000 --- a/get-wine-7.10-ubuntu_22_04.sh +++ /dev/null @@ -1,16 +0,0 @@ -echo "Setting up dependencies..." -sudo add-apt-repository universe -sudo dpkg --add-architecture i386 -wget -nc https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources -sudo mv winehq-jammy.sources /etc/apt/sources.list.d/ -sudo apt update -wget -nc https://dl.winehq.org/wine-builds/winehq.key -sudo mv winehq.key /usr/share/keyrings/winehq-archive.key -sudo apt update -echo "Installing wine 7.10 ...." -sudo apt install winehq-stable winetricks - -echo "Setting up wine..." -winecfg -echo "Done!" - diff --git a/wine-installer-ubuntu.sh b/wine-installer-ubuntu.sh new file mode 100755 index 0000000..5b70d0f --- /dev/null +++ b/wine-installer-ubuntu.sh @@ -0,0 +1,44 @@ +#!/bin/bash +RELEASE=$(lsb_release -sr) +#Creates Logs +mkdir ./logs +touch ./logs/repoLog.txt +touch ./logs/repoLog2.txt +touch ./logs/installLog.txt +touch ./logs/configLog.txt +echo "Enabling 32-bit support..." +sudo dpkg --add-architecture i386 +echo "Adding the repositories..." +sudo add-apt-repository universe -y &>> ./logs/repoLog2.txt +{ +if [ "$RELEASE" = "20.04" ]; then + sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/focal/winehq-focal.sources + sudo apt update +fi + +if [ "$RELEASE" = "22.04" ]; then + sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources + sudo apt update +fi + +if [ "$RELEASE" = "22.10" ]; then + sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/kinetic/winehq-kinetic.sources + sudo apt update +else + echo "Unsupported release" +fi + sudo mkdir -pm755 /etc/apt/keyrings + sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key + sudo apt update +} &> ./logs/repoLog.txt + +read -p "Install wine? [Y/n]:" -n 1 -r +if [[ $REPLY =~ ^[Yy]$ ]] + then + sudo apt install winehq-stable winetricks &> ./logs/installLog.txt + winecfg &> ./logs/configLog.txt +else + echo + echo "Abort." +fi +echo "The logs can be found at" $(pwd)"/" \ No newline at end of file diff --git a/uninstall-wine.sh b/wine-uninstaller.sh similarity index 100% rename from uninstall-wine.sh rename to wine-uninstaller.sh