1
0
Fork 0
Changes:
Added Interactive shell for : uninstall
New feature: repair
Small tweaks.
Fedora script has been fixed.
This commit is contained in:
Rishon 2024-12-15 22:26:17 +05:30
parent cf86832877
commit 37c514523f
9 changed files with 80 additions and 53 deletions

4
.idea/changes.txt Normal file
View File

@ -0,0 +1,4 @@
Added Interactive shell for : uninstall
New feature: repair
Small tweaks.
Fedora script has been fixed.

View File

@ -4,4 +4,5 @@
- Improve Efficiency - Improve Efficiency
- Add flags to uninstall, reinstall, repair - Add flags to uninstall, reinstall, repair
- Add flags to list a distrubution, and list help - Add flags to list a distrubution, and list help
-GUI version (Released 5.0) -GUI version (Released 5.0)
-Build wine and install

View File

@ -1,8 +1,10 @@
while getopts ":v:" opt; do log_path =""
while getopts ":vl:" opt; do
case $opt in case $opt in
v) v)
echo "4.0.1" echo "4.0.1"
;; ;;
\?) \?)
echo "Invalid option: -$OPTARG" >&2 echo "Invalid option: -$OPTARG" >&2
echo "-v Displays the version" echo "-v Displays the version"
@ -83,6 +85,7 @@ echo "1)Stable build (Recommended)"
echo "2)Development build (Recommended for testing use only)" echo "2)Development build (Recommended for testing use only)"
echo "3)Staging build (Recommended for testing use only)" echo "3)Staging build (Recommended for testing use only)"
read -p "Select build channel:" build -n 1 -r read -p "Select build channel:" build -n 1 -r
if [ "$build" = "1" ] if [ "$build" = "1" ]
build = "stable" build = "stable"
fi fi
@ -99,10 +102,10 @@ if [[ $REPLY =~ ^[Yy]$ ]]
spin & spin &
SPIN_PID=$! SPIN_PID=$!
trap "kill -9 $SPIN_PID" `seq 0 15` trap "kill -9 $SPIN_PID" `seq 0 15`
sudo apt install winehq-"$build" winetricks &> ./logs/installLog.txt sudo apt install winehq-"$build" winetricks &> ./logs/installLog.txt || {echo "ERROR: dpkg locked" && exit 1}
winecfg &> ./logs/configLog.txt winecfg &> ./logs/configLog.txt
else else
echo echo
echo "Abort." echo "Abort."
fi fi
echo "The logs can be found at" $(pwd)"/" echo "The logs can be found at" $(pwd)"/logs/"

View File

@ -1,3 +1,4 @@
RELEASE=$(lsb_release -sr)
while getopts ":v:" opt; do while getopts ":v:" opt; do
case $opt in case $opt in
v) v)
@ -11,7 +12,6 @@ while getopts ":v:" opt; do
esac esac
done done
RELEASE=$(lsb_release -sr)
spin() spin()
{ {
spinner="/|\\-/|\\-" spinner="/|\\-/|\\-"
@ -36,7 +36,7 @@ echo "Enabling 32-bit support... "
spin & spin &
SPIN_PID=$! SPIN_PID=$!
trap "kill -9 $SPIN_PID" `seq 0 15` trap "kill -9 $SPIN_PID" `seq 0 15`
sudo dpkg --add-architecture i386 sudo dpkg --add-architecture i386 || { echo 'ERROR: Unable to enable 32-bit support.' ; exit 1; }
kill -9 $SPIN_PID kill -9 $SPIN_PID
@ -44,34 +44,18 @@ echo "Adding the repositories... "
spin & spin &
SPIN_PID=$! SPIN_PID=$!
trap "kill -9 $SPIN_PID" `seq 0 15` trap "kill -9 $SPIN_PID" `seq 0 15`
#Insert interactive shell here
sudo add-apt-repository universe -y &>> ./logs/repoLog2.txt
{ {
if [ "$RELEASE" = "20.04" ]; then if [ "$RELEASE" = "41" ]; then
sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/focal/winehq-focal.sources dnf5 config-manager addrepo --from-repofile=https://dl.winehq.org/wine-builds/fedora/41/winehq.repo
sudo dnf update
fi
if [ "$RELEASE" = "40" ]; then
dnf config-manager --add-repo https://dl.winehq.org/wine-builds/fedora/40/winehq.repo
sudo apt update sudo apt update
fi fi
if [ "$RELEASE" = "22.04" ]; then } &> ./logs/repoLog.txt || &> /dev/null
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" = "23.10" ]; then
sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/mantic/winehq-mantic.sources
sudo apt update
fi
if [ "$RELEASE" = "23.04" ]; then
sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/lunar/winehq-lunar.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
kill -9 $SPIN_PID kill -9 $SPIN_PID
clear clear
echo "1)Stable build (Recommended)" echo "1)Stable build (Recommended)"
@ -94,10 +78,10 @@ if [[ $REPLY =~ ^[Yy]$ ]]
spin & spin &
SPIN_PID=$! SPIN_PID=$!
trap "kill -9 $SPIN_PID" `seq 0 15` trap "kill -9 $SPIN_PID" `seq 0 15`
sudo apt install winehq-"$build" winetricks &> ./logs/installLog.txt sudo dnf install winehq-"$build" winetricks &> ./logs/installLog.txt
winecfg &> ./logs/configLog.txt winecfg &> ./logs/configLog.txt
else else
echo echo
echo "Abort." echo "Abort."
fi fi
echo "The logs can be found at" $(pwd)"/" echo "The logs can be found at" $(pwd)"/logs/"

View File

@ -101,4 +101,4 @@ else
echo echo
echo "Abort." echo "Abort."
fi fi
echo "The logs can be found at" $(pwd)"/" echo "The logs can be found at" $(pwd)"/logs/"

View File

@ -0,0 +1,23 @@
echo "Backup Wine Cache?"
read -p "Ready? [Y/n]: " -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]
then
mv ~/.wine ~/.wine.bak
fi
rm -r ~/.wine
sudo apt-get purge wine
while getopts "vsdt" n
do
case "$n" in
v) echo "1.0.0" ;;
s) sudo apt-get purge winehq-stable
sudo apt-get install winehq-devel;;
d) sudo apt-get purge winehq-devel
sudo apt-get install winehq-devel;;
t) sudo apt-get purge winehq-devel
sudo apt-get install winehq-devel;;
\?) usage;;
esac
done

View File

@ -1,3 +1,4 @@
path=$(pwd)
spin() spin()
{ {
spinner="/|\\-/|\\-" spinner="/|\\-/|\\-"
@ -11,23 +12,32 @@ spin()
done done
done done
} }
read -p "Are you sure to uninstall wine? [Y/n]: " -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]
then
read -p "Backup wine cache? [Y/n]: " -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]
then
mv ~/.wine ~/.wine.bak
fi
cd $HOME
echo "Uninstalling Wine... "
{
spin &
SPIN_PID=$!
trap "kill -9 $SPIN_PID" `seq 0 15`
rm -r .wine
rm .config/menus/applications-merged/wine*
rm -r .local/share/applications/wine
rm .local/share/desktop-directories/wine*
rm .local/share/icons/????_*.xpm
sudo apt purge --autoremove winehq-stable -y
sudo apt-get update
sudo apt-get autoclean -y
sudo apt-get clean -y
sudo apt-get autoremove -y
} &> /dev/null
cd $HOME kill -9 $SPIN_PID
echo "Uninstalling Wine... " cd $path || exit 1
{ fi
spin &
SPIN_PID=$!
trap "kill -9 $SPIN_PID" `seq 0 15`
rm -r .wine
rm .config/menus/applications-merged/wine*
rm -r .local/share/applications/wine
rm .local/share/desktop-directories/wine*
rm .local/share/icons/????_*.xpm
sudo apt purge --autoremove winehq-stable -y
sudo apt-get update
sudo apt-get autoclean -y
sudo apt-get clean -y
sudo apt-get autoremove -y
} &> /dev/null
kill -9 $SPIN_PID

1
gui_installer.sh Normal file
View File

@ -0,0 +1 @@
echo "GUI releasing soon in 5.0 update"

View File

@ -36,4 +36,5 @@ while getopts 'abf:v' flag; do
*) print_usage *) print_usage
exit 1 ;; exit 1 ;;
esac esac
done done
echo