Add analytics for install, update, uninstall

This commit is contained in:
wheaney 2023-10-18 11:22:06 -07:00
parent 22a6fd00fc
commit ee5a73939c
4 changed files with 27 additions and 9 deletions

View File

@ -3,6 +3,9 @@
# exit when any command fails
set -e
XREAL_DRIVER_DIR=modules/xrealAirLinuxDriver
source $XREAL_DRIVER_DIR/bin/inject_ua
# check out submodules, recursively for nested ones
git submodule update --init --recursive
@ -25,9 +28,11 @@ fi
# build vkBasalt
VKBASALT_MODULE_DIR=$VULKAN_MODULES/vkBasalt
VKBASALT_BUILD_DIR=$VKBASALT_MODULE_DIR/out
pushd $VKBASALT_MODULE_DIR
./docker-build
popd
if [ ! -d "$VKBASALT_BUILD_DIR" ] || [ "$1" != "--skip-module-builds" ]; then
pushd $VKBASALT_MODULE_DIR
./docker-build
popd
fi
# copy vkBasalt binaries and configs
mkdir -p $PACKAGE_DIR/{vkBasalt.64,vkBasalt.32}
@ -41,15 +46,17 @@ wget -P $PACKAGE_DIR https://raw.githubusercontent.com/crosire/reshade-shaders/3
wget -P $PACKAGE_DIR https://raw.githubusercontent.com/crosire/reshade-shaders/384465d0287999caa6190b5ebea506200b4f4a0a/Shaders/ReShadeUI.fxh
# copy vulkan setup scripts and configs
cp -r $VULKAN_DIR/bin $PACKAGE_DIR
mkdir -p $PACKAGE_DIR/bin
copy_and_inject_ua "$XREAL_DRIVER_DIR/bin/ua.sh" "$PACKAGE_DIR/bin" "$VULKAN_DIR/bin/setup" "$VULKAN_DIR/bin/breezy_vulkan_uninstall"
cp -r $VULKAN_DIR/config $PACKAGE_DIR
# build xreal driver
XREAL_DRIVER_DIR=modules/xrealAirLinuxDriver
XREAL_BINARY=$XREAL_DRIVER_DIR/build/xrealAirLinuxDriver.tar.gz
pushd $XREAL_DRIVER_DIR
bin/package
popd
if [ ! -e "$XREAL_BINARY" ] || [ "$1" != "--skip-module-builds" ]; then
pushd $XREAL_DRIVER_DIR
bin/package
popd
fi
# copy xreal binary and setup script
cp $XREAL_BINARY $PACKAGE_DIR

@ -1 +1 @@
Subproject commit d79fde9c0c30cad1ed869a3582199c1551cb3084
Subproject commit ee5af8dcc611eb9a4442e22a97518dac2d67c54d

View File

@ -16,6 +16,11 @@ fi
USER=${SUDO_USER:-$USER}
USER_HOME=$(getent passwd $USER | cut -d: -f6)
if [ "$for_install" -eq 0 ]; then
UA_EVENT_NAME="uninstall"
UA_CLIENT_ID="BreezyVulkan"
#INJECT_UA_CALL
fi
[ "$for_install" -eq 0 ] && echo "Removing vkBasalt binaries from $USER_HOME/.local/lib[32]/"
rm $USER_HOME/.local/lib/libvkbasalt.so

View File

@ -5,13 +5,19 @@
USER=${SUDO_USER:-$USER}
USER_HOME=$(getent passwd $USER | cut -d: -f6)
UA_EVENT_NAME="install"
if [ -e "$USER_HOME/bin/breezy_vulkan_uninstall" ]; then
echo "Cleaning up the previous installation"
# ` || true` will ensure that this can't cause a failure, even with `set -e`
$USER_HOME/bin/breezy_vulkan_uninstall --for-install || true
UA_EVENT_NAME="update"
fi
UA_CLIENT_ID="BreezyVulkan"
#INJECT_UA_CALL
echo "Copying the breezy_vulkan scripts to ${USER_HOME}/bin"
if [ ! -d "$USER_HOME/bin" ]; then
su -c 'mkdir -p '$USER_HOME'/bin' $USER