1
0
Fork 0
This commit is contained in:
Rishon 2024-12-22 17:23:44 +05:30
parent a8a83bc019
commit 7eec12dd25
7 changed files with 103 additions and 81 deletions

View File

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

View File

@ -5,4 +5,6 @@
- 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 -Build wine and install
- Autopass with gpg encryption, can be turned on or off
- Revert to the regular wine

4
core/setup.sh Normal file
View File

@ -0,0 +1,4 @@
#Add password setup here
while getopts ":a:bc:" flag;do
echo "flag -$flag, Argument $OPTARG";
done

View File

@ -1,15 +1,12 @@
log_path ="" log_path =""
while getopts ":vl:" opt; do while true; do
case $opt in case "$1" in
v) -v | --verion ) VERBOSE=true; shift ;;
echo "4.0.1" -l | --log ) DEBUG=true; shift ;;
;; -m | --memory ) MEMORY="$2"; shift 2 ;;
--debugfile ) DEBUGFILE="$2"; shift 2 ;;
\?) -- ) shift; break ;;
echo "Invalid option: -$OPTARG" >&2 * ) break ;;
echo "-v Displays the version"
exit 1
;;
esac esac
done done

View File

@ -1,4 +1,9 @@
#!/bin/bash
# Get the release version
RELEASE=$(lsb_release -sr) RELEASE=$(lsb_release -sr)
# Parse command-line options
while getopts ":v:" opt; do while getopts ":v:" opt; do
case $opt in case $opt in
v) v)
@ -12,13 +17,11 @@ while getopts ":v:" opt; do
esac esac
done done
spin() # Spinner function for progress indication
{ spin() {
spinner="/|\\-/|\\-" spinner="/|\\-/|\\-"
while : while :; do
do for i in $(seq 0 7); do
for i in `seq 0 7`
do
echo -n "${spinner:$i:1}" echo -n "${spinner:$i:1}"
echo -en "\010" echo -en "\010"
sleep 0.1 sleep 0.1
@ -26,62 +29,67 @@ spin()
done done
} }
#Creates Logs # Create logs directory and log files
mkdir ./logs mkdir -p ./logs
touch ./logs/repoLog.txt touch ./logs/repoLog.txt ./logs/repoLog2.txt ./logs/installLog.txt ./logs/configLog.txt
touch ./logs/repoLog2.txt
touch ./logs/installLog.txt # Enable 32-bit support
touch ./logs/configLog.txt echo "Enabling 32-bit support..."
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 || { echo 'ERROR: Unable to enable 32-bit support.' ; exit 1; } sudo dpkg --add-architecture i386 || {
echo 'ERROR: Unable to enable 32-bit support.'
exit 1
}
kill -9 $SPIN_PID kill -9 $SPIN_PID
# Add the appropriate repository based on release version
echo "Adding the repositories... " 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)
{ {
if [ "$RELEASE" = "41" ]; then if [ "$RELEASE" = "41" ]; then
dnf5 config-manager addrepo --from-repofile=https://dl.winehq.org/wine-builds/fedora/41/winehq.repo sudo dnf5 config-manager addrepo --from-repofile=https://dl.winehq.org/wine-builds/fedora/41/winehq.repo
sudo dnf update sudo dnf update
fi elif [ "$RELEASE" = "40" ]; then
sudo dnf config-manager --add-repo https://dl.winehq.org/wine-builds/fedora/40/winehq.repo
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
} &> ./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 fi
} &> ./logs/repoLog.txt || &> /dev/null # Display log directory path
kill -9 $SPIN_PID echo "The logs can be found at $(pwd)/logs/"
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/"

1
setup.sh Normal file
View File

@ -0,0 +1 @@
#Add password setup here

View File

@ -16,22 +16,36 @@ fedora(){
} }
print_usage() { print_usage() {
echo "Options:" echo "Options:"
echo "-ubuntu Enters the Ubuntu installer of wine" echo "--ubuntu | -u Enters the Ubuntu installer of wine"
echo "-fedora Enters the Fedora installer of wine" echo "-fedora Enters the Fedora installer of wine"
echo "-debian Enters the Debian installer of wine" echo "-debian | -d Enters the Debian installer of wine"
echo "-version Prints app information" echo "-version | -v Prints app information"
echo "-upgrade Upgrades your Wine. Ubuntu updates may be applied for the smooth experience for wine." 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 "-verbose | Displays all the logs on screen."
echo "-silent Finishes All the processes with no output. Useful for using it in the background.." 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 "-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 case "${flag}" in
ubuntu) ubuntu ;; u) ubuntu ;;
fedora) fedora ;; fedora) fedora ;;
debian) debian ;; debian) debian ;;
version) printversion ;; ve) printversion ;;
verbose) flags="$flags -v" ;; verbose) flags="$flags -v" ;;
*) print_usage *) print_usage
exit 1 ;; exit 1 ;;