From a8ee44dda63325a4112acf12793b9e29e4eb65d1 Mon Sep 17 00:00:00 2001 From: Tom Moroney Date: Mon, 18 Nov 2024 14:32:30 +0000 Subject: [PATCH] Added uninstall script --- scripts/postinstall.sh | 24 ++++++++++++++---------- scripts/uninstaller.sh | 26 ++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 10 deletions(-) create mode 100755 scripts/uninstaller.sh diff --git a/scripts/postinstall.sh b/scripts/postinstall.sh index 3857fb5..fe987b3 100755 --- a/scripts/postinstall.sh +++ b/scripts/postinstall.sh @@ -1,11 +1,15 @@ #!/bin/bash -UNINSTALLER="/Library/Application Support/Blackmagic Design/DaVinci Resolve/Fusion/AutoSubs-Uninstaller.sh" -cat < "$UNINSTALLER" -#!/bin/bash -echo "Removing AutoSubs files..." -rm -rf "/Library/Application Support/Blackmagic Design/DaVinci Resolve/Fusion/Scripts/Utility/AutoSubs" -echo "AutoSubs uninstalled successfully!" -EOF -chmod +x "$UNINSTALLER" -echo "Uninstaller created at: $UNINSTALLER" -exit 0 + +# Path to the uninstaller script +UNINSTALLER_SCRIPT="/tmp/uninstaller.sh" + +# Copy the uninstaller script to a temporary location +cp "${PWD}/uninstaller.sh" "$UNINSTALLER_SCRIPT" + +# Execute the uninstaller script +bash "$UNINSTALLER_SCRIPT" + +# Clean up +rm -f "$UNINSTALLER_SCRIPT" + +exit 0 \ No newline at end of file diff --git a/scripts/uninstaller.sh b/scripts/uninstaller.sh new file mode 100755 index 0000000..ee3d176 --- /dev/null +++ b/scripts/uninstaller.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +echo "Uninstalling AutoSubs..." + +# Define paths to remove +AUTOSUBS_DIR="/Library/Application Support/Blackmagic Design/DaVinci Resolve/Fusion/AutoSubs" +LUA_SCRIPT="/Library/Application Support/Blackmagic Design/DaVinci Resolve/Fusion/Scripts/Utility/AutoSubs V2.lua" + +# Remove the AutoSubs directory +if [ -d "$AUTOSUBS_DIR" ]; then + rm -rf "$AUTOSUBS_DIR" + echo "Removed directory: $AUTOSUBS_DIR" +else + echo "Directory not found: $AUTOSUBS_DIR" +fi + +# Remove the Lua script +if [ -f "$LUA_SCRIPT" ]; then + rm -f "$LUA_SCRIPT" + echo "Removed file: $LUA_SCRIPT" +else + echo "File not found: $LUA_SCRIPT" +fi + +echo "Uninstallation complete." +exit 0 \ No newline at end of file