diff --git a/openstan.desktop b/openstan.desktop deleted file mode 100644 index 6b69de1..0000000 --- a/openstan.desktop +++ /dev/null @@ -1,12 +0,0 @@ -[Desktop Entry] -Version=1.0 -Type=Application -Name=openstan -GenericName=Bank Statement Analyser -Comment=Secure statement analysis — configurable, accurate, flexible & extendable -Exec=openstan -Icon=/usr/local/share/icons/hicolor/scalable/apps/openstan.svg -Categories=Office;Finance; -Keywords=bank;statement;pdf;analysis;finance; -StartupNotify=true -StartupWMClass=openstan diff --git a/packaging/post-uninstall.sh b/packaging/post-uninstall.sh index 77405d2..3b93ecb 100644 --- a/packaging/post-uninstall.sh +++ b/packaging/post-uninstall.sh @@ -1,9 +1,23 @@ #!/bin/sh # Post-uninstall script for openstan RPM/DEB package. # Removes the .desktop entry and icon, then refreshes caches. +# +# On upgrade the new package's post-install.sh runs first, then this script +# runs as part of removing the old package. If any openstan-* versioned +# directory still exists under /usr/lib, we are mid-upgrade and must not +# tear down desktop integration — the new version handles that. set -e +# If another openstan version directory exists with a valid binary, +# this is an upgrade — skip cleanup. The new package's post-install.sh +# will handle desktop integration. +for _d in /usr/lib/openstan-*; do + if [ -d "$_d/openstan" ] && [ -x "$_d/openstan/openstan" ]; then + exit 0 + fi +done + rm -f /usr/bin/openstan rm -f /usr/share/applications/openstan.desktop rm -f /usr/share/icons/hicolor/scalable/apps/openstan.svg