diff --git a/.idea/changes.txt b/.idea/changes.txt index fdad124..e69de29 100644 --- a/.idea/changes.txt +++ b/.idea/changes.txt @@ -1,4 +0,0 @@ -Added Interactive shell for : uninstall -New feature: repair -Small tweaks. -Fedora script has been fixed. diff --git a/.idea/idea.txt b/.idea/idea.txt index 46584ab..0a8274b 100644 --- a/.idea/idea.txt +++ b/.idea/idea.txt @@ -5,4 +5,6 @@ - Add flags to uninstall, reinstall, repair - Add flags to list a distrubution, and list help -GUI version (Released 5.0) --Build wine and install \ No newline at end of file +-Build wine and install +- Autopass with gpg encryption, can be turned on or off +- Revert to the regular wine \ No newline at end of file diff --git a/core/setup.sh b/core/setup.sh new file mode 100644 index 0000000..eabfe77 --- /dev/null +++ b/core/setup.sh @@ -0,0 +1,4 @@ +#Add password setup here +while getopts ":a:bc:" flag;do + echo "flag -$flag, Argument $OPTARG"; +done \ No newline at end of file diff --git a/core/wine-installer-debian.sh b/core/wine-installer-debian.sh index 4b9a657..534a174 100644 --- a/core/wine-installer-debian.sh +++ b/core/wine-installer-debian.sh @@ -1,15 +1,12 @@ 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" - exit 1 - ;; +while true; do + case "$1" in + -v | --verion ) VERBOSE=true; shift ;; + -l | --log ) DEBUG=true; shift ;; + -m | --memory ) MEMORY="$2"; shift 2 ;; + --debugfile ) DEBUGFILE="$2"; shift 2 ;; + -- ) shift; break ;; + * ) break ;; esac done diff --git a/core/wine-installer-fedora.sh b/core/wine-installer-fedora.sh index 89dcac1..6b9418c 100644 --- a/core/wine-installer-fedora.sh +++ b/core/wine-installer-fedora.sh @@ -1,4 +1,9 @@ +#!/bin/bash + +# Get the release version RELEASE=$(lsb_release -sr) + +# Parse command-line options while getopts ":v:" opt; do case $opt in v) @@ -12,13 +17,11 @@ while getopts ":v:" opt; do esac done -spin() -{ +# Spinner function for progress indication +spin() { spinner="/|\\-/|\\-" - while : - do - for i in `seq 0 7` - do + while :; do + for i in $(seq 0 7); do echo -n "${spinner:$i:1}" echo -en "\010" sleep 0.1 @@ -26,62 +29,67 @@ spin() done } -#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... " +# Create logs directory and log files +mkdir -p ./logs +touch ./logs/repoLog.txt ./logs/repoLog2.txt ./logs/installLog.txt ./logs/configLog.txt + +# Enable 32-bit support +echo "Enabling 32-bit support..." spin & SPIN_PID=$! -trap "kill -9 $SPIN_PID" `seq 0 15` -sudo dpkg --add-architecture i386 || { echo 'ERROR: Unable to enable 32-bit support.' ; exit 1; } +trap "kill -9 $SPIN_PID" $(seq 0 15) +sudo dpkg --add-architecture i386 || { + echo 'ERROR: Unable to enable 32-bit support.' + exit 1 +} kill -9 $SPIN_PID - -echo "Adding the repositories... " +# Add the appropriate repository based on release version +echo "Adding the repositories..." spin & SPIN_PID=$! -trap "kill -9 $SPIN_PID" `seq 0 15` +trap "kill -9 $SPIN_PID" $(seq 0 15) { -if [ "$RELEASE" = "41" ]; then - dnf5 config-manager addrepo --from-repofile=https://dl.winehq.org/wine-builds/fedora/41/winehq.repo + if [ "$RELEASE" = "41" ]; then + sudo 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 + elif [ "$RELEASE" = "40" ]; then + sudo dnf config-manager --add-repo https://dl.winehq.org/wine-builds/fedora/40/winehq.repo sudo apt update + fi +} &> ./logs/repoLog.txt || true +kill -9 $SPIN_PID + +clear + +# Prompt user to select build type +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 + +case $build in + 1) build="stable" ;; + 2) build="devel" ;; + 3) build="staging" ;; + *) echo "Invalid selection. Exiting."; exit 1 ;; +esac + +# Confirm before proceeding +read -p "Ready? [Y/n]: " -n 1 -r +echo +if [[ $REPLY =~ ^[Yy]$ ]]; then + echo "Installing WineHQ $build build..." + spin & + SPIN_PID=$! + trap "kill -9 $SPIN_PID" $(seq 0 15) + sudo dnf install winehq-"$build" winetricks &> ./logs/installLog.txt + winecfg &> ./logs/configLog.txt + kill -9 $SPIN_PID +else + echo "Abort." + exit 1 fi -} &> ./logs/repoLog.txt || &> /dev/null -kill -9 $SPIN_PID -clear -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 -if ["$build" = "2"] - build = "devel" -fi -if ["$build" = "3"] - build = "staging" -fi -read -p "Ready? [Y/n]: " -n 1 -r -if [[ $REPLY =~ ^[Yy]$ ]] - then - echo - spin & - SPIN_PID=$! - trap "kill -9 $SPIN_PID" `seq 0 15` - 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)"/logs/" +# Display log directory path +echo "The logs can be found at $(pwd)/logs/" diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..ae10540 --- /dev/null +++ b/setup.sh @@ -0,0 +1 @@ +#Add password setup here \ No newline at end of file diff --git a/winehq-installer.sh b/winehq-installer.sh index 7c15e37..db1751d 100644 --- a/winehq-installer.sh +++ b/winehq-installer.sh @@ -16,22 +16,36 @@ fedora(){ } print_usage() { echo "Options:" - echo "-ubuntu Enters the Ubuntu installer of wine" - echo "-fedora Enters the Fedora installer of wine" - echo "-debian Enters the Debian installer of wine" - echo "-version Prints app information" - echo "-upgrade Upgrades your Wine. Ubuntu updates may be applied for the smooth experience for wine." - echo "-verbose Displays all the logs on screen." - echo "-silent Finishes All the processes with no output. Useful for using it in the background.." - echo "-log Adds debug logs to process any errors." + echo "--ubuntu | -u Enters the Ubuntu installer of wine" + echo "-fedora Enters the Fedora installer of wine" + echo "-debian | -d Enters the Debian installer of wine" + echo "-version | -v Prints app information" + echo "-upgrade | -u Upgrades your Wine. Ubuntu updates may be applied for the smooth experience for wine." + echo "-verbose | Displays all the logs on screen." + echo "-silent Finishes All the processes with no output. Useful for using it in the background.." + echo "-log Adds debug logs to process any errors." } -while getopts 'abf:v' flag; do +while true; do + case "$1" in + --verbose ) VERBOSE=true; shift ;; + -u |--ubuntu ) DEBUG=true; shift ;; + -fedora ) MEMORY="$2"; shift 2 ;; + --debugfile ) DEBUGFILE="$2"; shift 2 ;; + --minheap ) + JAVA_MISC_OPT="$JAVA_MISC_OPT -XX:MinHeapFreeRatio=$2"; shift 2 ;; + --maxheap ) + JAVA_MISC_OPT="$JAVA_MISC_OPT -XX:MaxHeapFreeRatio=$2"; shift 2 ;; + -- ) shift; break ;; + * ) break ;; + esac +done +while getopts 'udfv:ve' flag; do case "${flag}" in - ubuntu) ubuntu ;; + u) ubuntu ;; fedora) fedora ;; debian) debian ;; - version) printversion ;; + ve) printversion ;; verbose) flags="$flags -v" ;; *) print_usage exit 1 ;;