Homebrew/homebrew-cask · warning

Unable to forcibly close GameMaker.app

Error message

Unable to forcibly close GameMaker.app

What it means

Printed by the terminate_process step in gamemaker's postflight_steps (Casks/g/gamemaker.rb:33). The GameMaker .pkg postinstall auto-launches the app with `open "$APP_PATH"&`; Homebrew then runs `/usr/bin/pkill -f /Applications/GameMaker.app` up to 3 times, 1 second apart, to suppress the GUI. pkill exits non-zero when no running process's full command line contains /Applications/GameMaker.app (or the signal is denied); after the final attempt Homebrew prints this failure_message as a `Warning:`. Because `must_succeed: false` is set, the step can never fail the install.

Source

Thrown at Casks/g/gamemaker.rb:33

  depends_on :macos

  pkg "GameMaker-#{version}.pkg"

  postflight_steps do
    # Description: Ensure console variant of postinstall is non-interactive.
    # This is because `open "$APP_PATH"&` is called from the postinstall
    # script of the package and we don't want any user intervention there.
    terminate_process(
      "/Applications/GameMaker.app",
      match:           :full,
      attempts:        3,
      must_succeed:    false,
      notices:         [
        "The GameMaker package postinstall script launches the GameMaker app",
        "Attempting to close com.yoyogames.gms2 to avoid unwanted user intervention",
      ],
      failure_message: "Unable to forcibly close GameMaker.app",
    )
  end

  uninstall pkgutil: "com.yoyogames.gms2",
            delete:  "/Applications/GameMaker.app"

  zap trash: "/Users/Shared/GameMakerStudio2"
end

View on GitHub (pinned to 8587086220)

Solutions

  1. If brew finished, ignore the warning — it is advisory (`must_succeed: false`); just quit any leftover IDE with `pkill -f /Applications/GameMaker.app`.
  2. Quit GameMaker first (`osascript -e 'quit app "GameMaker"'`), then re-run `brew reinstall --cask gamemaker`.
  3. Confirm success with `brew list --cask --versions gamemaker`.
  4. If a process is running but under another path (`pgrep -fl GameMaker`), fix the literal path in the cask (`brew edit --cask gamemaker`) and open a PR.

Example fix

# before
brew upgrade --cask gamemaker
# Warning: Unable to forcibly close GameMaker.app

# after: quit the IDE first, then upgrade
osascript -e 'quit app "GameMaker"' || pkill -f '/Applications/GameMaker.app'
brew upgrade --cask gamemaker
Defensive patterns

Strategy: validation

Validate before calling

# Quit the IDE before brew install/upgrade --cask gamemaker:
osascript -e 'quit app "GameMaker"' 2>/dev/null || pkill -f '/Applications/GameMaker.app' 2>/dev/null || true
brew reinstall --cask gamemaker

Try / catch

begin
  Homebrew::SystemCommand.run!("/usr/bin/pkill", args: ["-f", "/Applications/GameMaker.app"])
rescue ErrorDuringExecution
  # No matching process: the app was not running. Non-fatal by design.
  warn "Unable to forcibly close GameMaker.app"
end

Prevention

When it happens

Trigger: `brew install|upgrade|reinstall --cask gamemaker` where all three pkill attempts find no match: the app was never launched (no GUI session for postinstall's `open`, or the pkg stopped auto-opening), the launch outlasted the ~3s retry window, or a running copy executes from a different path (renamed bundle, ~/Applications install). The warning then appears and installation continues.

Common situations: Headless/SSH or CI installs; vendor renames GameMaker.app or changes its install location in a pkg revision; user already quit the app before the retry loop sampled it; IDE slow start losing the race.

Related errors


AI-assisted analysis of Homebrew/homebrew-cask@8587086220 (2026-08-21). Data as JSON: /api/errors/2c39492bd86289ec. Report an issue: GitHub.