Run Windows games on Apple Silicon — free, open source, with an open compatibility database that tells you what actually works.
Swift apple-silicond3dmetaldxmtdxvkfexgame-porting-toolkitgamingmac-gamingmacosmetalmoltenvksteamswiftuivkd3d-protonwhisky-alternativewindows-gameswinewine-wrapper
Offer to install Rosetta when an existing install has lost it (#101, #106)
Gauthier Piarrettef1ab2d3bdb8f
diff --git a/Sources/HighballApp/AppState.swift b/Sources/HighballApp/AppState.swiftindex b45142f..af7045a 100644--- a/Sources/HighballApp/AppState.swift+++ b/Sources/HighballApp/AppState.swift@@ -79,6 +79,17 @@ final class AppState {// Onboardingvar rosettaInstalled = true+ /// Rosetta stopped working on a Mac that already has an engine: the app asks to install it.+ var rosettaMissing = false++ /// Installs Rosetta for an existing install, from the ask that rosettaMissing raises.+ func installRosettaNow() {+ rosettaMissing = false+ runBusy(L("Installing Rosetta, Apple's compatibility layer"), expected: L("a minute or two")) { [self] in+ try await Self.installRosetta()+ await MainActor.run { self.rosettaInstalled = true; self.appendLog("Rosetta installed"); self.refresh() }+ }+ }var needsOnboarding = falsevar showGPTKLicense = falsevar gptkLicenseText = ""@@ -493,6 +504,9 @@ final class AppState {damagedBottles = (try? bottleStore.damaged()) ?? []needsOnboarding = engines.isEmpty && homeUnavailable == nil // an unplugged drive is not a first runrosettaInstalled = Self.rosettaWorks()+ // An existing install can lose Rosetta (two Macs did after the macOS 27 update, #101 and+ // #106) and onboarding is the only place that used to install it. Offer it here instead.+ rosettaMissing = !rosettaInstalled && !engines.isEmpty// Drop a selection whose bottle is gone, not merely a nil one: a delete that threw after// the bottle had in fact been removed (the losing side of a race) left the selection// pinned to a name nothing could resolve.diff --git a/Sources/HighballApp/HighballApp.swift b/Sources/HighballApp/HighballApp.swiftindex 7302025..b57f4c4 100644--- a/Sources/HighballApp/HighballApp.swift+++ b/Sources/HighballApp/HighballApp.swift@@ -23,6 +23,11 @@ struct HighballApp: App {.frame(minWidth: 820, minHeight: 560).onAppear { state.refresh(); state.sweepTrash(); delegate.appState = state }.onOpenURL { url in state.open(url: url) }+ .alert(L("Rosetta is not working on this Mac"),+ isPresented: Binding(get: { state.rosettaMissing }, set: { if !$0 { state.rosettaMissing = false } })) {+ Button(L("Install Rosetta")) { state.installRosettaNow() }+ Button(L("Not now"), role: .cancel) { state.rosettaMissing = false }+ } message: { Text(L("Highball's Wine engine is Intel code and needs Rosetta, Apple's translation layer. A macOS update can remove it. Highball can install it now, or run in Terminal: softwareupdate --install-rosetta --agree-to-license")) }.alert(String(format: L("Open %@ in Highball?"), state.pendingPlayLink?.title ?? ""),isPresented: Binding(get: { state.pendingPlayLink != nil }, set: { if !$0 { state.pendingPlayLink = nil } })) {Button(L("Play")) { if let item = state.pendingPlayLink { state.pendingPlayLink = nil; state.play(item) } }diff --git a/Sources/HighballApp/L10n.swift b/Sources/HighballApp/L10n.swiftindex 0a3419e..b5fdfcc 100644--- a/Sources/HighballApp/L10n.swift+++ b/Sources/HighballApp/L10n.swift@@ -217,6 +217,11 @@ enum L10n {"Keep current": "Garder l’actuel","Make a shortcut…": "Créer un raccourci…","Remove the shortcut": "Supprimer le raccourci",+ "Rosetta is not working on this Mac": "Rosetta ne fonctionne pas sur ce Mac",+ "Install Rosetta": "Installer Rosetta",+ "Installing Rosetta, Apple's compatibility layer": "Installation de Rosetta, la couche de compatibilité d'Apple",+ "a minute or two": "une minute ou deux",+ "Highball's Wine engine is Intel code and needs Rosetta, Apple's translation layer. A macOS update can remove it. Highball can install it now, or run in Terminal: softwareupdate --install-rosetta --agree-to-license": "Le moteur Wine de Highball est du code Intel et a besoin de Rosetta, la couche de traduction d'Apple. Une mise à jour de macOS peut la retirer. Highball peut l'installer maintenant, ou lancez dans le Terminal : softwareupdate --install-rosetta --agree-to-license","Moves this game's shortcut app in ~/Applications/Highball to the Trash.": "Place le raccourci de ce jeu (dans ~/Applications/Highball) dans la corbeille.","Uninstall Windows programs…": "Désinstaller des programmes Windows…","Opens Windows' Add/Remove Programs for this environment, for programs you installed into it.": "Ouvre Ajout/Suppression de programmes de Windows pour cet environnement, pour les programmes que vous y avez installés.",