Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.
Swift cache-cleanercleanerclideveloper-toolsdisk-cleanupdisk-spaceduplicate-finderhomebrewliquid-glassmac-cleanermacosmacos-appmacos-golden-gatemacos-tahoemacos-tweaksswiftswiftuiterminal-themesuninstalluninstaller
Leave VPNs whose makers document their own uninstall to it
Țugui Dragoșcff1c5859b53
diff --git a/ARCHITECTURE.md b/ARCHITECTURE.mdindex 9faa5820..fa0dde86 100644--- a/ARCHITECTURE.md+++ b/ARCHITECTURE.md@@ -132,11 +132,12 @@ the Homebrew page's uninstall and cleanups are Homebrew's own.(`AppExtensions.installed(carriedBy:asking:)`, which also says whether System Settings deletes every one:`AppExtension.systemSettingsDeletesIt`, a network extension on macOS 27, by the category `systemextensionsctl`lists it under).- - A security or management agent whose maker removes it with an uninstaller of its own is left to that+ - A security or management agent, or a VPN, whose maker removes it with an uninstaller of its own is left to thatuninstaller (`RemovedElsewhere.byItsMaker`, `MakersUninstaller`), and so is an uninstaller app its makerdocuments, such as Chrome Remote Desktop Host Uninstaller. Each is known by its checked signing team and the- identifier its maker documents; its page names the maker's step and links the instructions, nothing of it is- selected or moved, and `peel uninstall` refuses it.+ identifier its maker documents or signs; its page names the maker's step, opens the app whose own command removes+ it, or points to the uninstaller on the app's disk image, and links the instructions, nothing of it is selected or+ moved, and `peel uninstall` refuses it.- A program another account runs, root's included, can't be quit by the person or by Peel (`kill(2)` answers`EPERM`), so it is never in the question to quit apps (`RunningCopies.Process.mayBeQuit`), and what it runsfrom stays with a reason of its own (`heldByAnotherAccount`), as does an item only macOS's own programs holddiff --git a/CHANGELOG.md b/CHANGELOG.mdindex d5cd95e5..67de6ea4 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -23,6 +23,10 @@ its changes the way [Keep a Changelog](https://keepachangelog.com/) suggests.- Bitdefender Endpoint Security for Mac and Sophos Endpoint are left to their makers' own uninstallers, and the app'spage gives the maker's step.+- ExpressVPN, Private Internet Access, Cloudflare WARP, ZeroTier, Tunnelblick, and IVPN are left to their makers' own+ uninstallers, which also turn off what they keep in the system, such as a kill switch or a network extension: the+ app's page gives the command, opens the app whose own command removes it, or links the maker's instructions for the+ uninstaller on its disk image.- After a removal, Peel reads the files your shell runs when it starts and names the lines that still point to whatmoved, such as a `PATH` entry or an alias into the app, in the alert and in `peel uninstall`. It changes none of thesefiles.diff --git a/GUIDE.md b/GUIDE.mdindex 14fe9c91..9e3790c6 100644--- a/GUIDE.md+++ b/GUIDE.md@@ -38,8 +38,9 @@ and how to get it, [SAFETY.md](SAFETY.md) what it protects, [PRIVACY.md](PRIVACYwith how to remove them in Finder.- **Some apps go another way.** An app that installed a system extension, such as a VPN or a virtual camera, islisted with its files and nothing selected: only Finder's move to the Trash asks macOS to remove the extension, so- its page says to move it there. A security or management agent whose maker documents an uninstaller of its own,- such as GlobalProtect or Microsoft Defender, is left to that uninstaller, and its page says how. An app that runs+ its page says to move it there. A security or management agent, or a VPN, whose maker documents an uninstaller of+ its own, such as GlobalProtect, Microsoft Defender, or ExpressVPN, is left to that uninstaller, and its page says+ how. An app that runsits own uninstaller once it leaves the Applications folder, such as Mullvad VPN or Citrix Workspace, is moved onlyafter Peel tells you what that uninstaller will do. Peel itself goes only with Remove Peel, in Settings > General.- **Open apps quit first.** Peel asks an app that is open to quit before anything of it moves, and looks again atdiff --git a/Packages/PeelCore/Sources/PeelCommandLine/Commands/AppCommands.swift b/Packages/PeelCore/Sources/PeelCommandLine/Commands/AppCommands.swiftindex e7174d22..987b0bc7 100644--- a/Packages/PeelCore/Sources/PeelCommandLine/Commands/AppCommands.swift+++ b/Packages/PeelCore/Sources/PeelCommandLine/Commands/AppCommands.swift@@ -492,6 +492,8 @@ struct UninstallCommand: AsyncParsableCommand {let step = switch uninstaller.step {case .command(let command): "run `\(command)`"case .uninstaller(let url): "open \(url.path(percentEncoded: false))"+ case .inTheApp: "use the uninstall command in \(Output.plain(target.name))"+ case .onItsDiskImage: "use the uninstaller on the disk image it came on"}throw CommandFailure("\(Output.plain(target.name)) is removed with \(uninstaller.maker)'s own uninstaller, which also takes what it keeps in the system: \(step). See \(uninstaller.instructions.absoluteString)")case .byFinder(let carried):diff --git a/Packages/PeelCore/Sources/PeelCore/Removal/MakersUninstaller.swift b/Packages/PeelCore/Sources/PeelCore/Removal/MakersUninstaller.swiftindex bca0993d..d004289b 100644--- a/Packages/PeelCore/Sources/PeelCore/Removal/MakersUninstaller.swift+++ b/Packages/PeelCore/Sources/PeelCore/Removal/MakersUninstaller.swift@@ -1,7 +1,7 @@public import Foundation-/// A security or management agent whose maker documents removing it with an uninstaller of its own, or such an-/// uninstaller itself. Moved from its place, what the product keeps in the system and the settings that manage it+/// A security or management agent, or a VPN, whose maker documents removing it with an uninstaller of its own, or such+/// an uninstaller itself. Moved from its place, what the product keeps in the system and the settings that manage it/// would stay behind.public struct MakersUninstaller: Sendable, Hashable {/// What the maker's page says to do.@@ -10,6 +10,10 @@ public struct MakersUninstaller: Sendable, Hashable {case command(String)/// An uninstaller to open.case uninstaller(URL)+ /// A command in the app's own windows or menus, so the app is what to open.+ case inTheApp(URL)+ /// An uninstaller that comes on the disk image the app came on rather than on the Mac.+ case onItsDiskImage}private enum Documented: Sendable {@@ -18,6 +22,8 @@ public struct MakersUninstaller: Sendable, Hashable {case uninstallerInsideTheApp(String)/// The app is the uninstaller, which removes the product named here and then itself.case itself(removing: String)+ case inTheApp+ case onItsDiskImage}public let maker: String@@ -27,8 +33,8 @@ public struct MakersUninstaller: Sendable, Hashable {/// The product this app removes, when the app is the uninstaller itself rather than the product.public let removes: String?- /// Each product with the signing team and the identifiers its maker's own deployment pages give, and the step and- /// page of its maker's uninstall instructions. An identifier names itself and any longer one after a dot.+ /// Each product with the signing team and the identifiers its maker's own pages or its signed bundle give, and the+ /// step and page of its maker's uninstall instructions. An identifier names itself and any longer one after a dot.private static let known: [(team: String, identifiers: [String], maker: String, step: Documented, page: String)] = [("PXPZ95SK77", ["com.paloaltonetworks.globalprotect"], "Palo Alto Networks",@@ -73,6 +79,32 @@ public struct MakersUninstaller: Sendable, Hashable {.uninstaller("/Applications/Sophos/Remove Sophos Endpoint.app"),"https://docs.sophos.com/esg/endpoint/help/en-us/help/Uninstall/"),+ (+ "TC292Y5427", ["com.express.vpn"], "ExpressVPN", .inTheApp,+ "https://www.expressvpn.com/support/troubleshooting/uninstall-expressvpn-app/"+ ),+ (+ "5357M5NW9W", ["com.privateinternetaccess.vpn"], "Private Internet Access", .inTheApp,+ "https://helpdesk.privateinternetaccess.com/hc/en-us/articles/46565840048027-macOS-Uninstalling-the-PIA-App-Using-the-In-App-Uninstaller"+ ),+ (+ "68WVV388M8", ["com.cloudflare.1dot1dot1dot1.macos"], "Cloudflare",+ .command("\"/Applications/Cloudflare WARP.app/Contents/Resources/uninstall.sh\""),+ "https://developers.cloudflare.com/cloudflare-one/team-and-resources/devices/cloudflare-one-client/uninstall/"+ ),+ (+ "8ZD9JUCZ4V", ["com.zerotier.zerotier-ui", "com.zerotier.zerotier-one"], "ZeroTier",+ .command("sudo \"/Library/Application Support/ZeroTier/One/uninstall.sh\""),+ "https://docs.zerotier.com/faq/macos-uninstall/"+ ),+ (+ "Z2SG5H3HC8", ["net.tunnelblick.tunnelblick"], "Tunnelblick", .inTheApp,+ "https://tunnelblick.net/cUninstall.html"+ ),+ (+ "WQXXM75BYN", ["com.electron.ivpn-ui", "net.ivpn.client"], "IVPN", .onItsDiskImage,+ "https://www.ivpn.net/knowledgebase/macos/macos-how-do-i-completely-uninstall-or-remove-the-ivpn-application/"+ ),// The uninstaller's identifier, from Chromium's `remoting/branding_Chrome`; the host's own is not listed here.("EQHXZ8M8AV", ["com.google.chromeremotedesktop.me2me-host-uninstaller"], "Google",@@ -95,6 +127,8 @@ public struct MakersUninstaller: Sendable, Hashable {case .uninstallerInsideTheApp(let path):.uninstaller(app.url.appending(path: path, directoryHint: .isDirectory))case .itself: .uninstaller(app.url)+ case .inTheApp: .inTheApp(app.url)+ case .onItsDiskImage: .onItsDiskImage}let removes: String? = if case .itself(let removing) = product.step { removing } else { nil }return MakersUninstaller(maker: product.maker, step: step, instructions: instructions, removes: removes)diff --git a/Packages/PeelCore/Sources/PeelCore/Removal/RemovedElsewhere.swift b/Packages/PeelCore/Sources/PeelCore/Removal/RemovedElsewhere.swiftindex d9312bec..43a37c23 100644--- a/Packages/PeelCore/Sources/PeelCore/Removal/RemovedElsewhere.swift+++ b/Packages/PeelCore/Sources/PeelCore/Removal/RemovedElsewhere.swift@@ -3,7 +3,7 @@public enum RemovedElsewhere: Sendable, Hashable {/// Peel itself: Remove Peel, in Settings, also takes its helper and login item away.case byRemovePeel- /// A security or management agent, which its maker's own uninstaller removes whole.+ /// A security or management agent, or a VPN, which its maker's own uninstaller removes whole.case byItsMaker(MakersUninstaller)/// An app with system extensions macOS installed, which Finder's move asks macOS to remove and Peel's would not.case byFinder(systemExtensions: CarriedSystemExtensions)diff --git a/Packages/PeelCore/Tests/PeelCoreTests/CommandLineTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/CommandLineTests.swiftindex f49c2a00..da215848 100644--- a/Packages/PeelCore/Tests/PeelCoreTests/CommandLineTests.swift+++ b/Packages/PeelCore/Tests/PeelCoreTests/CommandLineTests.swift@@ -841,6 +841,22 @@ struct CommandLineTests {#expect(failure?.description.contains("uninstall_gp.sh") == true)}+ @Test func refusesToUninstallAVPNAndSaysWhereItsOwnUninstallIs() throws {+ func refusal(_ identifier: String, team: String, name: String) -> String? {+ let app = InstalledApp(+ url: URL(filePath: "/Applications/\(name).app", directoryHint: .isDirectory),+ bundleIdentifier: identifier, name: name, teamIdentifier: team+ )+ return #expect(throws: CommandFailure.self) { try UninstallCommand.refuseIfRemovedElsewhere(app) }?+ .description+ }++ #expect(refusal("com.express.vpn", team: "TC292Y5427", name: "ExpressVPN")?+ .contains("use the uninstall command in ExpressVPN") == true)+ #expect(refusal("com.electron.ivpn-ui", team: "WQXXM75BYN", name: "IVPN")?+ .contains("use the uninstaller on the disk image it came on") == true)+ }+@Test func refusesToMoveAMakersUninstallerAloneAndSaysToOpenIt() throws {let uninstaller = InstalledApp(url: URL(filePath: "/Applications/Chrome Remote Desktop Host Uninstaller.app", directoryHint: .isDirectory),diff --git a/Packages/PeelCore/Tests/PeelCoreTests/MakersUninstallerTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/MakersUninstallerTests.swiftindex 2cd9b6c9..2bd6e662 100644--- a/Packages/PeelCore/Tests/PeelCoreTests/MakersUninstallerTests.swift+++ b/Packages/PeelCore/Tests/PeelCoreTests/MakersUninstallerTests.swift@@ -40,6 +40,29 @@ struct MakersUninstallerTests {)}+ @Test func knowsAVPNWhoseMakerDocumentsItsOwnUninstall() {+ let express = agent("com.express.vpn", team: "TC292Y5427", at: "/Applications/ExpressVPN.app")+ let tunnelblick = agent("net.tunnelblick.tunnelblick", team: "Z2SG5H3HC8", at: "/Applications/Tunnelblick.app")++ #expect(MakersUninstaller.of(express)?.step == .inTheApp(express.url))+ #expect(MakersUninstaller.of(agent("com.privateinternetaccess.vpn", team: "5357M5NW9W"))?.step == .inTheApp(+ URL(filePath: "/Applications/Agent.app", directoryHint: .isDirectory)+ ))+ #expect(MakersUninstaller.of(tunnelblick)?.maker == "Tunnelblick")+ #expect(+ MakersUninstaller.of(agent("com.cloudflare.1dot1dot1dot1.macos", team: "68WVV388M8"))?.step+ == .command("\"/Applications/Cloudflare WARP.app/Contents/Resources/uninstall.sh\"")+ )+ #expect(+ MakersUninstaller.of(agent("com.zerotier.ZeroTier-UI", team: "8ZD9JUCZ4V"))?.step+ == .command("sudo \"/Library/Application Support/ZeroTier/One/uninstall.sh\"")+ )+ #expect(MakersUninstaller.of(agent("com.zerotier.ZeroTier-One", team: "8ZD9JUCZ4V"))?.maker == "ZeroTier")+ #expect(MakersUninstaller.of(agent("com.electron.ivpn-ui", team: "WQXXM75BYN"))?.step == .onItsDiskImage)+ #expect(MakersUninstaller.of(agent("net.ivpn.client.IVPN", team: "WQXXM75BYN"))?.maker == "IVPN")+ #expect(MakersUninstaller.of(agent("com.electron.ivpn-ui", team: "ABCDE12345")) == nil)+ }+@Test func knowsAnUninstallerItsMakerDocumentsOpeningToRemoveAProduct() {let path = "/Applications/Chrome Remote Desktop Host Uninstaller.app"let uninstaller = agent("com.google.chromeremotedesktop.me2me-host-uninstaller", team: "EQHXZ8M8AV", at: path)diff --git a/Peel/Views/MakersUninstallerNotice.swift b/Peel/Views/MakersUninstallerNotice.swiftindex 7794edd7..828c7c7a 100644--- a/Peel/Views/MakersUninstallerNotice.swift+++ b/Peel/Views/MakersUninstallerNotice.swift@@ -1,8 +1,9 @@import PeelCoreimport SwiftUI-/// The note on the page of a security or management agent, or of such an uninstaller: its maker's own uninstaller-/// removes it whole, so Peel leaves it and its files where they are and offers the maker's step and instructions.+/// The note on the page of a security or management agent or a VPN, or of such an uninstaller: its maker's own+/// uninstaller removes it whole, so Peel leaves it and its files where they are and offers the maker's step and+/// instructions.struct MakersUninstallerNotice: View {let app: Stringlet uninstaller: MakersUninstaller@@ -15,6 +16,10 @@ struct MakersUninstallerNotice: View {case .uninstaller(let url):Button("Open Uninstaller") { NSWorkspace.shared.open(url) }.disabled(!FileManager.default.fileExists(atPath: url.path(percentEncoded: false)))+ case .inTheApp(let url):+ Button("Open \(app)") { NSWorkspace.shared.open(url) }+ case .onItsDiskImage:+ EmptyView()}Link("\(uninstaller.maker)’s Instructions", destination: uninstaller.instructions)}diff --git a/SAFETY.md b/SAFETY.mdindex 4c1b8070..1a0cf8ce 100644--- a/SAFETY.md+++ b/SAFETY.md@@ -330,12 +330,14 @@ Only matches Peel is `certain` or `likely` about, and only when nothing else inshelper when its files went that way; one with anything left inside, a hidden file included, one with another name,and the Library folder itself stay.-A security or management agent whose maker documents removing it with an uninstaller of its own (GlobalProtect, Cortex-XDR, Cisco Secure Client, ESET Endpoint Security, Microsoft Defender, Netskope Client, FortiClient, Bitdefender-Endpoint Security for Mac, and Sophos Endpoint) is listed the same way, and nothing of it can be selected: its page-names the maker's uninstaller and links to the maker's instructions, since moved from its place, what it keeps in the-system and the settings that manage it would stay behind. Peel knows it by the team its checked signature names and by-its identifier, both as the maker documents them, never by the identifier alone, which any app could claim.+A security or management agent, or a VPN, whose maker documents removing it with an uninstaller of its own+(GlobalProtect, Cortex XDR, Cisco Secure Client, ESET Endpoint Security, Microsoft Defender, Netskope Client,+FortiClient, Bitdefender Endpoint Security for Mac, Sophos Endpoint, ExpressVPN, Private Internet Access, Cloudflare+WARP, ZeroTier, Tunnelblick, and IVPN) is listed the same way, and nothing of it can be selected: its page names the+maker's uninstaller, or opens the app whose own command removes it, and links to the maker's instructions, since moved+from its place, what it keeps in the system and the settings that manage it would stay behind. Peel knows it by the+team its checked signature names and by its identifier, both as the maker documents or signs them, never by the+identifier alone, which any app could claim.`peel uninstall` refuses it and names the same uninstaller. An uninstaller its maker documents opening to remove aproduct, such as Google's Chrome Remote Desktop Host Uninstaller, is treated the same way: moved on its own, it wouldleave the product installed, so its page offers to open it instead.