From 3d778bd429a0687e9373ad069a6fe6c47dcd5e59 Mon Sep 17 00:00:00 2001 From: Gun <6913739+GunGunGun@users.noreply.github.com> Date: Sun, 10 Nov 2024 19:18:55 +0700 Subject: [PATCH] Auto detect generic and specific --- install.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index a1d45d2..2bfa91c 100644 --- a/install.sh +++ b/install.sh @@ -4,7 +4,9 @@ app_name=zen literal_name_of_installation_directory=".tarball-installations" universal_path_for_installation_directory="$HOME/$literal_name_of_installation_directory" app_installation_directory="$universal_path_for_installation_directory/zen" -official_package_location="https://github.com/zen-browser/desktop/releases/latest/download/zen.linux-generic.tar.bz2" +official_package_location_generic="https://github.com/zen-browser/desktop/releases/latest/download/zen.linux-generic.tar.bz2" +official_package_location_specific="https://github.com/zen-browser/desktop/releases/latest/download/zen.linux-specific.tar.bz2" +official_package_location="$official_package_location_generic" tar_location=$(mktemp /tmp/zen.XXXXXX.tar.bz2) open_tar_application_data_location="zen" local_bin_path="$HOME/.local/bin" @@ -14,6 +16,19 @@ 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 +# Function to check if AVX2 is supported +check_avx2_support() { + if grep -q avx2 /proc/cpuinfo; then + return 0 # AVX2 supported + else + return 1 # AVX2 not supported + fi +} + +if check_avx2_support; then + official_package_location="$official_package_location_specific" +fi + echo "Welcome to Zen tarball installer, just chill and wait for the installation to complete!" sleep 1