diff --git a/CHANGELOG.md b/CHANGELOG.md index ff407ef..8e32ff8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.0.1] - 2024-12-05 +### Changed +- Added a preinstall script that will uninstall version 1.X if found. + ## [2.0.0] - 2024-12-02 ### AKA the Swift Update diff --git a/SupportCompanion.xcodeproj/project.pbxproj b/SupportCompanion.xcodeproj/project.pbxproj index e2b2b0a..9495e1e 100644 --- a/SupportCompanion.xcodeproj/project.pbxproj +++ b/SupportCompanion.xcodeproj/project.pbxproj @@ -145,6 +145,7 @@ export.plist, payload/Library/LaunchDaemons/com.github.macadmins.SupportCompanion.helper.plist, scripts/postinstall, + scripts/preinstall, ); target = F6F3BEB82CE1E7BA0036ADB9 /* SupportCompanion */; }; diff --git a/SupportCompanion/Info.plist b/SupportCompanion/Info.plist index 0194c5a..d792057 100644 --- a/SupportCompanion/Info.plist +++ b/SupportCompanion/Info.plist @@ -19,9 +19,9 @@ LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) CFBundleShortVersionString - 2.0.0 + 2.0.1 CFBundleVersion - 2.0.0 + 2.0.1 CFBundleURLTypes diff --git a/SupportCompanion/pkgbuild/scripts/preinstall b/SupportCompanion/pkgbuild/scripts/preinstall new file mode 100755 index 0000000..a7b5fd9 --- /dev/null +++ b/SupportCompanion/pkgbuild/scripts/preinstall @@ -0,0 +1,18 @@ +#!/bin/zsh + +v1AppPath="/Applications/Utilities/SupportCompanion.app" + +# Check if the app exists +if [[ -d "$v1AppPath" ]]; then + # Check if the uninstall script exists + uninstallScript="$v1AppPath/Contents/Resources/Uninstall.sh" + if [[ -f "$uninstallScript" ]]; then + "$uninstallScript" + else + echo "Uninstall script not found at $uninstallScript." + fi +else + echo "Support Companion not found at $v1AppPath." +fi + +exit 0