diff --git a/debian/web-eid-firefox.postrm b/debian/web-eid-firefox.postrm
index d4913019..bec4c401 100644
--- a/debian/web-eid-firefox.postrm
+++ b/debian/web-eid-firefox.postrm
@@ -9,6 +9,9 @@ if [ ! -f ${POLICIES}/policies.json ]; then
else
JQARGS=${POLICIES}/policies.json;
fi
+# Block the extension so it can't be reinstalled from AMO without the native app, avoiding a
+# dangling, non-functional extension. Reinstalling web-eid-firefox overwrites this back to
+# "normal_installed" (see debian/web-eid-firefox.postinst), so this is not a permanent block.
jq '.policies.ExtensionSettings["{e68418bc-f2b0-4459-a9ea-3e72b6751b07}"] = {"installation_mode": "blocked"}' ${JQARGS} > ${POLICIES}/policies.tmp
mv ${POLICIES}/policies.tmp ${POLICIES}/policies.json
diff --git a/install/uninstall.sh b/install/uninstall.sh
index 911ca82e..e76e3d2a 100755
--- a/install/uninstall.sh
+++ b/install/uninstall.sh
@@ -1,11 +1,30 @@
#!/bin/bash
+set -euo pipefail
+
+echo "This will remove Web eID and its browser integration files. Administrator" \
+ "privileges are required."
+read -r -p "Continue? [y/N] " confirm
+case "${confirm}" in
+ [yY]|[yY][eE][sS]) ;;
+ *) echo "Aborted."; exit 1 ;;
+esac
+
+# Prompt for the admin password once up front; the sudo calls below reuse this ticket.
+sudo -v
+
sudo rm -rf \
- /Applications/Utilities/web-eid.app \
- /Applications/Utilities/web-eid-safari.app \
- /Library/Google/Chrome/NativeMessagingHosts/eu.webeid.json \
- /Library/Application\ Support/Mozilla/NativeMessagingHosts/eu.webeid.json \
- /Library/Application\ Support/Google/Chrome/External\ Extensions/ncibgoaomkmdpilpocfeponihegamlic.json
+ "/Applications/Utilities/web-eid.app" \
+ "/Applications/Utilities/web-eid-safari.app" \
+ "/Library/Google/Chrome/NativeMessagingHosts/eu.webeid.json" \
+ "/Library/Application Support/Mozilla/NativeMessagingHosts/eu.webeid.json" \
+ "/Library/Application Support/Google/Chrome/External Extensions/ncibgoaomkmdpilpocfeponihegamlic.json"
+
PLIST=/Library/Preferences/org.mozilla.firefox.plist
-sudo defaults write ${PLIST} ExtensionSettings \
+# Block the extension so it can't be reinstalled from AMO without the native app, avoiding a
+# dangling, non-functional extension. Reinstalling Web eID overwrites this back to
+# 'normal_installed' (see install/macos-postinstall.in), so this is not a permanent block.
+sudo defaults write "${PLIST}" ExtensionSettings \
-dict-add "'{e68418bc-f2b0-4459-a9ea-3e72b6751b07}'" "{ 'installation_mode' = 'blocked'; }"
+
+echo "Web eID has been uninstalled."
diff --git a/install/web-eid.wxs b/install/web-eid.wxs
index 8e45aa14..5f2c2645 100644
--- a/install/web-eid.wxs
+++ b/install/web-eid.wxs
@@ -63,6 +63,10 @@
Condition="FIREFOXINSTALL=1 AND NOT REMOVE="ALL"" />
+
@@ -110,12 +114,23 @@
-
+
+
@@ -124,12 +139,15 @@
-
+
+