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 a maker's uninstaller app to be opened, not moved
Țugui Dragoș5c7beba1d44d
diff --git a/Localization/Peel/Localizable.xcstrings b/Localization/Peel/Localizable.xcstringsindex 282d74f1..26a83563 100644--- a/Localization/Peel/Localizable.xcstrings+++ b/Localization/Peel/Localizable.xcstrings@@ -976,6 +976,112 @@}}},+ "%@ documents removing %@ by opening this app, which then removes itself too. Moving only this app would leave %@ behind, so Peel leaves it for you to open." : {+ "localizations" : {+ "cs" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Výrobce %@ uvádí ve své dokumentaci, že se aplikace %@ odstraňuje otevřením této aplikace, která pak odstraní i sama sebe. Kdyby byla do koše přesunuta jen tato aplikace, zůstala by aplikace %@ nainstalovaná, a proto Peel tuto aplikaci ponechává na místě, abyste ji mohli otevřít."+ }+ },+ "de" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "%@ beschreibt, wie „%@“ durch Öffnen dieser App entfernt wird, die sich dann auch selbst entfernt. Würde nur diese App verschoben, bliebe „%@“ zurück, daher lässt Peel die App dort, wo sie ist, damit du sie öffnen kannst."+ }+ },+ "es" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "%@ indica en su documentación que %@ se elimina abriendo esta app, que después también se elimina a sí misma. Si se trasladara solo esta app, %@ se quedaría atrás, así que Peel la deja para que la abras tú."+ }+ },+ "fr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Selon la documentation de %@, %@ se désinstalle en ouvrant cette app, qui se supprime ensuite elle aussi. Placée seule dans la corbeille, cette app laisserait %@ derrière elle : Peel la laisse donc en place pour que vous l’ouvriez."+ }+ },+ "it" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "%@ indica di rimuovere %@ aprendo questa app, che poi rimuove anche sé stessa. Spostando solo questa app, %@ resterebbe sul Mac, quindi Peel lascia l’app dov’è perché tu possa aprirla."+ }+ },+ "ja" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "%@は、このアプリを開いて“%@”を取り除くよう案内しています。このアプリは、最後に自身も取り除きます。このアプリだけをゴミ箱に入れた場合は“%@”が残ってしまうため、Peelはこのアプリを、開けるようにそのままにします。"+ }+ },+ "ko" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "%@은(는) 공식 문서에서 이 앱을 열어 ‘%@’을(를) 제거하도록 안내합니다. 이 앱은 그런 다음 자신도 제거합니다. 이 앱만 휴지통으로 이동하면 ‘%@’이(가) 남게 되므로, Peel은 사용자가 열 수 있도록 이 앱을 그대로 둡니다."+ }+ },+ "nl" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "%@ beschrijft hoe je %@ verwijdert door deze app te openen. Die verwijdert daarna ook zichzelf. Als alleen deze app naar de prullenmand werd verplaatst, zou %@ achterblijven, dus laat Peel de app staan, zodat je die zelf kunt openen."+ }+ },+ "pl" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Według dokumentacji producenta %@ aplikację %@ odinstalowuje się, otwierając ten dezinstalator, który potem usuwa też sam siebie. Przeniesienie do Kosza tylko tego dezinstalatora pozostawiłoby aplikację %@ zainstalowaną, dlatego Peel zostawia go Tobie do otwarcia."+ }+ },+ "pt" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Segundo a documentação de %@, %@ deve ser removido abrindo este app, que depois também se remove. Se apenas este app fosse movido, %@ ficaria para trás, então o Peel deixa o app para você abrir."+ }+ },+ "ro" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "%@ documentează eliminarea produsului %@ prin deschiderea acestei aplicații, care apoi se elimină și ea. Dacă ar fi mutată în Coș doar această aplicație, %@ ar rămâne în urmă, așa că Peel lasă aplicația ca să o deschideți dvs."+ }+ },+ "ru" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "В документации %@ сказано, что для удаления приложения «%@» нужно открыть эту программу удаления, которая затем удалит и себя. Если бы переместили только эту программу, приложение «%@» осталось бы после нее, поэтому Peel оставляет ее на месте, чтобы Вы могли ее открыть."+ }+ },+ "sv" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "%@ beskriver hur %@ tas bort genom att du öppnar den här appen, som sedan även tar bort sig själv. Om bara den här appen flyttades skulle %@ lämnas kvar, så Peel lämnar appen åt dig att öppna."+ }+ },+ "tr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "%@ belgelerine göre, %@ bu uygulama açılarak kaldırılır; uygulama ardından kendini de kaldırır. Yalnızca bu uygulama Çöp Sepeti’ne taşınsaydı %@ geride kalırdı, bu yüzden Peel uygulamaya dokunmaz ve onu açmayı size bırakır."+ }+ },+ "uk" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "%@ у своїй документації описує вилучення програми «%@» відкриттям цього деінсталятора, який потім вилучає також себе. Якби перемістили лише цей деінсталятор, він залишив би по собі програму «%@», тому Peel лишає його на місці, щоб ви його відкрили."+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "%@在文档中说明,“%@”应通过打开此App来移除,该App随后也会移除自己。如果只移走此App,“%@”会被留下,因此Peel会将此App留在原处,供你打开。"+ }+ },+ "zh-Hant" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "%@在說明文件中指出,移除「%@」應打開此App,它隨後也會移除自己。若只移動此App,「%@」就會留下,因此Peel會將此App原地保留,讓你自行打開。"+ }+ }+ }+ },"%@ documents removing %@ with its own uninstaller, which also takes what it keeps in the system and the settings that manage it. Moved from here, those would stay behind, so Peel leaves it and its files where they are." : {"localizations" : {"cs" : {@@ -7409,6 +7515,112 @@}}},+ "%@’s uninstaller for %@" : {+ "localizations" : {+ "cs" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Odinstalátor výrobce %@ pro aplikaci %@"+ }+ },+ "de" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Deinstallationsprogramm von %@ für „%@“"+ }+ },+ "es" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Desinstalador de %@ para %@"+ }+ },+ "fr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Programme de désinstallation de %@ pour %@"+ }+ },+ "it" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Programma di disinstallazione di %@ per %@"+ }+ },+ "ja" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "%@の%@用アンインストーラ"+ }+ },+ "ko" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "%@의 ‘%@’ 제거 프로그램"+ }+ },+ "nl" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "De-installatieprogramma van %@ voor %@"+ }+ },+ "pl" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Dezinstalator producenta %@ dla aplikacji %@"+ }+ },+ "pt" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Desinstalador de %@ para %@"+ }+ },+ "ro" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Programul de dezinstalare de la %@ pentru %@"+ }+ },+ "ru" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Программа удаления от %@ для приложения «%@»"+ }+ },+ "sv" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Avinstalleraren från %@ för %@"+ }+ },+ "tr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "%@ tarafından %@ için hazırlanan yükleme kaldırıcı"+ }+ },+ "uk" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Деінсталятор %@ для програми «%@»"+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "%@的%@卸载器"+ }+ },+ "zh-Hant" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "%@的「%@」解除安裝程式"+ }+ }+ }+ },"%lld kept" : {"localizations" : {"cs" : {diff --git a/Packages/PeelCore/Sources/PeelCommandLine/Commands/AppCommands.swift b/Packages/PeelCore/Sources/PeelCommandLine/Commands/AppCommands.swiftindex 04d47eea..19df64cb 100644--- a/Packages/PeelCore/Sources/PeelCommandLine/Commands/AppCommands.swift+++ b/Packages/PeelCore/Sources/PeelCommandLine/Commands/AppCommands.swift@@ -458,6 +458,9 @@ struct UninstallCommand: AsyncParsableCommand {returncase .byRemovePeel:throw CommandFailure("Peel removes itself from its own settings, which unregisters the helper first. Open Peel and click Remove Peel in Settings.")+ case .byItsMaker(let uninstaller) where uninstaller.removes != nil:+ let product = Output.plain(uninstaller.removes ?? "")+ throw CommandFailure("\(Output.plain(target.name)) is \(uninstaller.maker)'s uninstaller for \(product): open it, and it removes \(product) and then itself. See \(uninstaller.instructions.absoluteString)")case .byItsMaker(let uninstaller):let step = switch uninstaller.step {case .command(let command): "run `\(command)`"diff --git a/Packages/PeelCore/Sources/PeelCore/Removal/MakersUninstaller.swift b/Packages/PeelCore/Sources/PeelCore/Removal/MakersUninstaller.swiftindex df0f9cd0..6d2785f9 100644--- a/Packages/PeelCore/Sources/PeelCore/Removal/MakersUninstaller.swift+++ b/Packages/PeelCore/Sources/PeelCore/Removal/MakersUninstaller.swift@@ -1,7 +1,8 @@public import Foundation-/// A security or management agent whose maker documents removing it with an uninstaller of its own. Moved from its-/// place, what it keeps in the system and the settings that manage it would stay behind.+/// 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+/// would stay behind.public struct MakersUninstaller: Sendable, Hashable {/// What the maker's page says to do.public enum Step: Sendable, Hashable {@@ -15,12 +16,16 @@ public struct MakersUninstaller: Sendable, Hashable {case command(String)case uninstaller(String)case uninstallerInsideTheApp(String)+ /// The app is the uninstaller, which removes the product named here and then itself.+ case itself(removing: String)}public let maker: Stringpublic let step: Step/// The maker's page that says how to remove it.public let instructions: URL+ /// 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.@@ -58,6 +63,12 @@ public struct MakersUninstaller: Sendable, Hashable {.uninstaller("/Applications/FortiClientUninstaller.app"),"https://community.fortinet.com/t5/FortiGate/Technical-Tip-How-to-uninstall-FortiClient-on-macOS/ta-p/229617"),+ // 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",+ .itself(removing: "Chrome Remote Desktop Host"),+ "https://support.google.com/chrome/answer/1649523"+ ),]/// The maker's uninstaller for `app`, known by the team of its checked signature and by its identifier, both as@@ -73,7 +84,9 @@ public struct MakersUninstaller: Sendable, Hashable {case .uninstaller(let path): .uninstaller(URL(filePath: path, directoryHint: .isDirectory))case .uninstallerInsideTheApp(let path):.uninstaller(app.url.appending(path: path, directoryHint: .isDirectory))+ case .itself: .uninstaller(app.url)}- return MakersUninstaller(maker: product.maker, step: step, instructions: instructions)+ 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/Tests/PeelCoreTests/CommandLineTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/CommandLineTests.swiftindex aa76c88a..1cfaf96b 100644--- a/Packages/PeelCore/Tests/PeelCoreTests/CommandLineTests.swift+++ b/Packages/PeelCore/Tests/PeelCoreTests/CommandLineTests.swift@@ -785,6 +785,19 @@ struct CommandLineTests {#expect(failure?.description.contains("uninstall_gp.sh") == true)}+ @Test func refusesToMoveAMakersUninstallerAloneAndSaysToOpenIt() throws {+ let uninstaller = InstalledApp(+ url: URL(filePath: "/Applications/Chrome Remote Desktop Host Uninstaller.app", directoryHint: .isDirectory),+ bundleIdentifier: "com.google.chromeremotedesktop.me2me-host-uninstaller",+ name: "Chrome Remote Desktop Host Uninstaller", teamIdentifier: "EQHXZ8M8AV"+ )++ let failure = #expect(throws: CommandFailure.self) {+ try UninstallCommand.refuseIfRemovedElsewhere(uninstaller)+ }+ #expect(failure?.description == "Chrome Remote Desktop Host Uninstaller is Google's uninstaller for Chrome Remote Desktop Host: open it, and it removes Chrome Remote Desktop Host and then itself. See https://support.google.com/chrome/answer/1649523")+ }+@Test func refusesToUninstallAnAppWhoseSystemExtensionOnlyFinderRemoves() throws {let app = InstalledApp(url: URL(filePath: "/Applications/Example.app", directoryHint: .isDirectory),diff --git a/Packages/PeelCore/Tests/PeelCoreTests/MakersUninstallerTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/MakersUninstallerTests.swiftindex 9e9fbe36..1ca64fb8 100644--- a/Packages/PeelCore/Tests/PeelCoreTests/MakersUninstallerTests.swift+++ b/Packages/PeelCore/Tests/PeelCoreTests/MakersUninstallerTests.swift@@ -32,6 +32,19 @@ struct MakersUninstallerTests {)}+ @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)++ let found = MakersUninstaller.of(uninstaller)+ #expect(found?.maker == "Google")+ #expect(found?.removes == "Chrome Remote Desktop Host")+ #expect(found?.step == .uninstaller(URL(filePath: path, directoryHint: .isDirectory)))+ #expect(MakersUninstaller.of(agent("com.google.chromeremotedesktop.me2me-host-uninstaller", team: "ABCDE12345")) == nil)+ #expect(MakersUninstaller.of(agent("com.google.chromeremotedesktop.me2me-host", team: "EQHXZ8M8AV")) == nil)+ #expect(MakersUninstaller.of(agent("com.google.Chrome", team: "EQHXZ8M8AV")) == nil)+ }+/// An identifier is what a bundle says of itself: alone, it would let any app keep Peel away. The team comes/// from the checked signature, and a maker's other apps share it.@Test func neitherTheIdentifierNorTheTeamIsEnoughAlone() {diff --git a/Peel/Views/MakersUninstallerNotice.swift b/Peel/Views/MakersUninstallerNotice.swiftindex f40dac49..7794edd7 100644--- a/Peel/Views/MakersUninstallerNotice.swift+++ b/Peel/Views/MakersUninstallerNotice.swift@@ -1,18 +1,14 @@import PeelCoreimport SwiftUI-/// The note on the page of a security or management agent: 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 instead.+/// 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.struct MakersUninstallerNotice: View {let app: Stringlet uninstaller: MakersUninstallervar body: some View {- Notice(- title: Text("Removed with \(uninstaller.maker)’s own uninstaller"),- detail: Text("\(uninstaller.maker) documents removing \(app) with its own uninstaller, which also takes what it keeps in the system and the settings that manage it. Moved from here, those would stay behind, so Peel leaves it and its files where they are."),- kind: .note- ) {+ Notice(title: title, detail: detail, kind: .note) {switch uninstaller.step {case .command(let command):CopyButton(text: command, title: "Copy Uninstall Command")@@ -23,4 +19,20 @@ struct MakersUninstallerNotice: View {Link("\(uninstaller.maker)’s Instructions", destination: uninstaller.instructions)}}++ private var title: Text {+ if let product = uninstaller.removes {+ Text("\(uninstaller.maker)’s uninstaller for \(product)")+ } else {+ Text("Removed with \(uninstaller.maker)’s own uninstaller")+ }+ }++ private var detail: Text {+ if let product = uninstaller.removes {+ Text("\(uninstaller.maker) documents removing \(product) by opening this app, which then removes itself too. Moving only this app would leave \(product) behind, so Peel leaves it for you to open.")+ } else {+ Text("\(uninstaller.maker) documents removing \(app) with its own uninstaller, which also takes what it keeps in the system and the settings that manage it. Moved from here, those would stay behind, so Peel leaves it and its files where they are.")+ }+ }}diff --git a/SAFETY.md b/SAFETY.mdindex 1efd9b17..c30121ec 100644--- a/SAFETY.md+++ b/SAFETY.md@@ -291,7 +291,9 @@ listed the same way, and nothing of it can be selected: its page names the makermaker's instructions, since moved from its place, what it keeps in the system and the settings that manage it wouldstay behind. Peel knows it by the team its checked signature names and by its identifier, both as the makerdocuments them, never by the identifier alone, which any app could claim. `peel uninstall` refuses it and names the-same uninstaller.+same uninstaller. An uninstaller its maker documents opening to remove a product, such as Google's Chrome Remote+Desktop Host Uninstaller, is treated the same way: moved on its own, it would leave the product installed, so its+page offers to open it instead.An app carrying a system extension macOS installed, such as a VPN's network extension or a virtual camera, is listedthe same way, and nothing of it can be selected: macOS removes the extension only when the app goes to the Trash in