diff --git a/.idea/changes.txt b/.idea/changes.txt new file mode 100644 index 0000000..42a916d --- /dev/null +++ b/.idea/changes.txt @@ -0,0 +1,4 @@ +Added Interactive shell for : uninstall +New feature: repair +Small tweaks. +Fedora script has been fixed. \ No newline at end of file diff --git a/.idea/idea.txt b/.idea/idea.txt index 6b84350..46584ab 100644 --- a/.idea/idea.txt +++ b/.idea/idea.txt @@ -4,4 +4,5 @@ - Improve Efficiency - Add flags to uninstall, reinstall, repair - Add flags to list a distrubution, and list help --GUI version (Released 5.0) \ No newline at end of file +-GUI version (Released 5.0) +-Build wine and install \ No newline at end of file diff --git a/core/wine-installer-debian.sh b/core/wine-installer-debian.sh index 0acc05f..4b9a657 100644 --- a/core/wine-installer-debian.sh +++ b/core/wine-installer-debian.sh @@ -1,8 +1,10 @@ -while getopts ":v:" opt; do +log_path ="" +while getopts ":vl:" opt; do case $opt in v) echo "4.0.1" ;; + \?) echo "Invalid option: -$OPTARG" >&2 echo "-v Displays the version" @@ -83,6 +85,7 @@ echo "1)Stable build (Recommended)" echo "2)Development build (Recommended for testing use only)" echo "3)Staging build (Recommended for testing use only)" read -p "Select build channel:" build -n 1 -r + if [ "$build" = "1" ] build = "stable" fi @@ -99,10 +102,10 @@ if [[ $REPLY =~ ^[Yy]$ ]] spin & SPIN_PID=$! 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 else echo echo "Abort." fi -echo "The logs can be found at" $(pwd)"/" +echo "The logs can be found at" $(pwd)"/logs/" diff --git a/core/wine-installer-fedora.sh b/core/wine-installer-fedora.sh index c202cb2..89dcac1 100644 --- a/core/wine-installer-fedora.sh +++ b/core/wine-installer-fedora.sh @@ -1,3 +1,4 @@ +RELEASE=$(lsb_release -sr) while getopts ":v:" opt; do case $opt in v) @@ -11,7 +12,6 @@ while getopts ":v:" opt; do esac done -RELEASE=$(lsb_release -sr) spin() { spinner="/|\\-/|\\-" @@ -36,7 +36,7 @@ echo "Enabling 32-bit support... " spin & SPIN_PID=$! 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 @@ -44,34 +44,18 @@ echo "Adding the repositories... " spin & SPIN_PID=$! 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 - sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/focal/winehq-focal.sources +if [ "$RELEASE" = "41" ]; then + 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 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" = "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 +} &> ./logs/repoLog.txt || &> /dev/null kill -9 $SPIN_PID clear echo "1)Stable build (Recommended)" @@ -94,10 +78,10 @@ if [[ $REPLY =~ ^[Yy]$ ]] spin & SPIN_PID=$! 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 else echo echo "Abort." fi -echo "The logs can be found at" $(pwd)"/" +echo "The logs can be found at" $(pwd)"/logs/" diff --git a/core/wine-installer-ubuntu.sh b/core/wine-installer-ubuntu.sh index 0bb658f..5d1be48 100644 --- a/core/wine-installer-ubuntu.sh +++ b/core/wine-installer-ubuntu.sh @@ -101,4 +101,4 @@ else echo echo "Abort." fi -echo "The logs can be found at" $(pwd)"/" +echo "The logs can be found at" $(pwd)"/logs/" diff --git a/core/wine-repair.sh b/core/wine-repair.sh index e69de29..69daaa7 100644 --- a/core/wine-repair.sh +++ b/core/wine-repair.sh @@ -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 diff --git a/core/wine-uninstaller.sh b/core/wine-uninstaller.sh index a35824a..f0a4997 100644 --- a/core/wine-uninstaller.sh +++ b/core/wine-uninstaller.sh @@ -1,3 +1,4 @@ +path=$(pwd) spin() { spinner="/|\\-/|\\-" @@ -11,23 +12,32 @@ spin() 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 -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 - -kill -9 $SPIN_PID \ No newline at end of file + kill -9 $SPIN_PID + cd $path || exit 1 +fi diff --git a/gui_installer.sh b/gui_installer.sh new file mode 100644 index 0000000..e2c3c3c --- /dev/null +++ b/gui_installer.sh @@ -0,0 +1 @@ +echo "GUI releasing soon in 5.0 update" \ No newline at end of file diff --git a/winehq-installer.sh b/winehq-installer.sh index 220969c..7c15e37 100644 --- a/winehq-installer.sh +++ b/winehq-installer.sh @@ -36,4 +36,5 @@ while getopts 'abf:v' flag; do *) print_usage exit 1 ;; esac -done \ No newline at end of file +done +echo \ No newline at end of file