Skip to content

Update install #508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 31 additions & 33 deletions install
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

rm ~/x

echo "Installing termux-am"
zenity --info --text="Installing termux-am"
pkg install termux-am -y &>/dev/null

termux-setup-storage & sleep 4 &>/dev/null
Expand All @@ -11,16 +11,22 @@ while true; do
if [ -d ~/storage/shared ]; then
break
else
echo "Storage permission denied"
zenity --warning --text="Storage permission denied"
fi
sleep 3
done

echo "Installing termux packages"
zenity --info --text="Installing termux packages"
apt-get clean
apt-get update >/dev/null 2>&1
apt-get -y --with-new-pkgs -o Dpkg::Options::="--force-confdef" upgrade >/dev/null 2>&1
pkg install x11-repo -y &>/dev/null

# Install Zenity if not already installed
if ! pkg list-installed | grep -q zenity; then
pkg install zenity -y &>/dev/null
fi

pkg install pulseaudio -y &>/dev/null
pkg install xwayland -y &>/dev/null
pkg install wget -y &>/dev/null
Expand All @@ -34,66 +40,58 @@ pkg install hashdeep -y &>/dev/null
pkg install termux-x11-nightly -y &>/dev/null

if [ -e $PREFIX/glibc ]; then
echo -n "Removing previous glibc. Continue? (Y/n) "
read i
if [ "$i" = "Y" ] || [ "$i" = "y" ]; then
if zenity --question --text="Removing previous glibc. Continue?"; then
rm -rf $PREFIX/glibc
else
return 1
exit 1
fi
fi

INSTALL_WOW64=0

echo "Select an option"
echo "1) Install previous mobox with box86"
echo "2) Install new mobox wow64 version"
echo ""
echo -n "Selected number: "
read i
case "$i" in
1)
OPTION=$(zenity --list --title="Select an option" --column="Options" \
1 "Install previous mobox with box86" \
2 "Install new mobox wow64 version")

if [ "$OPTION" = "1" ]; then
INSTALL_WOW64=0
;;
2)
elif [ "$OPTION" = "2" ]; then
INSTALL_WOW64=1
;;
*)
return 1
;;
esac
else
exit 1
fi

echo "Installing mobox"
zenity --info --text="Installing mobox"

function wget-git-q {
wget -q --retry-connrefused --tries=0 --header "PRIVATE-TOKEN: $PRIVATE_TOKEN" "https://gitlab.com/api/v4/projects/$PROJECT_ID/repository/files/$1/raw?ref=main" -O $2
return $?
}

echo "Updating package manager"
zenity --info --text="Updating package manager"
mkdir -p $PREFIX/glibc/opt/package-manager/installed

if [ "$INSTALL_WOW64" = "1" ]; then
echo "PRIVATE_TOKEN=glpat-h5r7HjKoPKZPxmfg79xs
PROJECT_ID=54240888">$PREFIX/glibc/opt/package-manager/token
echo "PRIVATE_TOKEN=glpat-h5r7HjKoPKZPxmfg79xs
PROJECT_ID=54240888" > $PREFIX/glibc/opt/package-manager/token
else
echo "PRIVATE_TOKEN=glpat-Xs4HfrCkMpbedkPycqzP
PROJECT_ID=52465323">$PREFIX/glibc/opt/package-manager/token
echo "PRIVATE_TOKEN=glpat-Xs4HfrCkMpbedkPycqzP
PROJECT_ID=52465323" > $PREFIX/glibc/opt/package-manager/token
fi

. $PREFIX/glibc/opt/package-manager/token
if ! wget-git-q "package-manager" "$PREFIX/glibc/opt/package-manager/package-manager"; then
echo "Download failed"
return 1
zenity --error --text="Download failed"
exit 1
fi
. $PREFIX/glibc/opt/package-manager/package-manager
sync-all

if [ "$INSTALL_WOW64" = "1" ]; then
sync-package wine-9.3-vanilla-wow64
sync-package wine-9.3-vanilla-wow64
else
sync-package wine-ge-custom-8-25
sync-package wine-ge-custom-8-25
fi

ln -sf $PREFIX/glibc/opt/scripts/mobox $PREFIX/bin/mobox
echo "To start - type \"mobox\""
zenity --info --text="To start - type \"mobox\""