This commit is contained in:
Sannidhya 2025-06-20 21:05:25 +02:00 committed by GitHub
commit 2d54a957c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

101
install.sh Normal file → Executable file
View file

@ -16,18 +16,10 @@ desktop_in_local_applications="$local_application_path/$app_name.desktop"
icon_path="$app_installation_directory/browser/chrome/icons/default/default128.png"
executable_path=$app_installation_directory/zen
echo "Welcome to Zen tarball installer, just chill and wait for the installation to complete!"
sleep 1
install() {
echo "We're installing Zen, just chill and wait for the installation to complete!\n"
echo "Downloading the latest package"
curl -L -o $tar_location $official_package_location
if [ $? -eq 0 ]; then
echo OK
else
echo "Download failed. Curl not found or not installed"
exit
fi
curl -L --progress-bar -o $tar_location $official_package_location
echo "Extracting Zen Browser..."
tar -xvJf $tar_location
@ -35,20 +27,7 @@ tar -xvJf $tar_location
echo "Untarred successfully!"
echo "Checking to see if an older installation exists"
if [ -f "$app_bin_in_local_bin" ]; then
echo "Old bin file detected, removing..."
rm "$app_bin_in_local_bin"
fi
if [ -d "$app_installation_directory" ]; then
echo "Old app files are found, removing..."
rm -rf "$app_installation_directory"
fi
if [ -f "$desktop_in_local_applications" ]; then
echo "Old app files are found, removing..."
rm "$desktop_in_local_applications"
fi
remove
if [ ! -d $universal_path_for_installation_directory ]; then
echo "Creating the $universal_path_for_installation_directory directory for installation"
@ -111,3 +90,75 @@ echo "Installation is successful"
echo "Done, and done, have fun! 🐷"
exit 0
}
parseTwilight() {
if [ "${1:-}" == "--twilight" ]; then
official_package_location="https://github.com/zen-browser/desktop/releases/download/twilight/zen.linux-x86_64.tar.xz"
echo "You're currently in Twilight mode, this means you're downloading the latest experimental features and updates."
fi
}
remove() {
if [ -f "$app_bin_in_local_bin" ]; then
echo "Old bin file detected, removing..."
rm "$app_bin_in_local_bin"
fi
if [ -d "$app_installation_directory" ]; then
echo "Old app files are found, removing..."
rm -rf "$app_installation_directory"
fi
if [ -f "$desktop_in_local_applications" ]; then
echo "Old desktop files are found, removing..."
rm "$desktop_in_local_applications"
fi
}
uninstall() {
read -p "WARN: This will remove Zen Browser from your system. Do you wish to proceed? [y/N]: " confirm
if [[ ! "$confirm" =~ ^[Yy]$ ]]; then
echo "Nice save! We didn't remove Zen from your system."
echo "Exiting..."
exit 0
fi
echo "Uninstalling Zen Browser..."
remove
echo "Keeping your profile data will let you continue where you left off if you reinstall Zen later."
read -p "Do you want to delete your Zen Profiles? This will remove all your bookmarks, history, and settings. [y/N]: " remove_profile
if [[ "$remove_profile" =~ ^[Yy]$ ]]; then
echo "Removing Zen Profiles data..."
rm -rf "$HOME/.zen"
else
echo "Keeping Zen Profiles data..."
fi
echo "Zen Browser has been uninstalled."
exit 0
}
echo -e "Welcome to Zen tarball installer!\n"
sleep 1
echo "What would you like to do?"
echo "1) Install/Update Zen Browser"
echo "2) Uninstall Zen Browser"
echo "3) Exit"
read -rn1 -p "Enter your choice [1/2/3]: " choice
echo
case $choice in
1)
parseTwilight "$@"
install
;;
2)
uninstall
;;
3)
echo "Exiting... Bye! 🐷"
exit 0
;;
*)
echo "Invalid choice. Exiting."
exit 1
;;
esac