Run macOS applications on your Windows desktop, with a background runtime and integrated app windows.
C++
#pragma once
#include <cstdint>
namespace wsm::runtime {
enum class SetupAssistantStep { Unknown, Country, Update, Account, AccountMenu, AccountConfirm, AgeRange, AppleAccount, FileVault, FileVaultConfirm, Welcome, WelcomePending, Analytics };
struct SetupAssistantAction { SetupAssistantStep step = SetupAssistantStep::Unknown; int x = 0, y = 0; };
// Only recognize known setup screens; unknown screens must never cause an automatic click.
SetupAssistantAction recognize_setup_assistant(const uint8_t* rgb, int width, int height);
// Read-only states have no safe button and must never result in a mouse click.
inline bool setup_action_clickable(SetupAssistantStep step) {
return step != SetupAssistantStep::Unknown && step != SetupAssistantStep::Country && step != SetupAssistantStep::WelcomePending;
}
inline bool welcome_restart_due(bool new_install, bool already_attempted, int stable_seconds) {
return new_install && !already_attempted && stable_seconds >= 120;
}
// Recover a first sign-in stall when WSM's SSH account and passwordless sudo already work
// (meaning offline setup succeeded), but macOS has not reached a signed-in Finder desktop
// and no recognised clickable Setup Assistant prompt has made progress for 180 s (or
// WelcomePending has been stable for 120 s). Strictly bounded to one graceful restart on a new install.
inline bool first_sign_in_restart_due(bool new_install, bool already_attempted,
int welcome_pending_seconds, int ssh_stalled_seconds) {
return welcome_restart_due(new_install, already_attempted, welcome_pending_seconds) ||
(new_install && !already_attempted && ssh_stalled_seconds >= 180);
}
}