Homebrew/homebrew-cask · warning

Unable to forcibly close GameMaker LTS #{version.major}.app

Error message

Unable to forcibly close GameMaker LTS #{version.major}.app

What it means

Printed by the terminate_process step in gamemaker@lts's postflight_steps (Casks/g/gamemaker@lts.rb:32). The GameMaker LTS .pkg postinstall runs `open "$APP_PATH"&`, so Homebrew runs `/usr/bin/pkill -f "/Applications/GameMaker LTS #{version.major}.app"` up to 3 times, 1 second apart. Note the interpolated path: the bundle name embeds version.major, so the pattern is only correct while the vendor's install folder still ends with the same major number. pkill exits non-zero when no live process's command line contains the interpolated path; after the last attempt Homebrew prints this failure_message as a `Warning:`, and with `must_succeed: false` the install proceeds.

Source

Thrown at Casks/g/gamemaker@lts.rb:32

  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 LTS #{version.major}.app",
      match:           :full,
      attempts:        3,
      must_succeed:    false,
      notices:         [
        "The GameMaker package postinstall script launches the GameMaker app",
        "Attempting to close com.yoyogames.gm-lts#{version.major} to avoid unwanted user intervention",
      ],
      failure_message: "Unable to forcibly close GameMaker LTS #{version.major}.app",
    )
  end

  uninstall pkgutil: "com.yoyogames.gm-lts#{version.major}",
            delete:  "/Applications/GameMaker LTS #{version.major}.app"

  zap trash: "/Users/Shared/GameMakerStudio2-LTS#{version.major}"
end

View on GitHub (pinned to 8587086220)

Solutions

  1. If brew completed, treat the warning as benign (`must_succeed: false`); quit any leftover app with `pkill -f '/Applications/GameMaker LTS'`.
  2. Quit GameMaker LTS before the operation: `osascript -e 'quit app "GameMaker LTS"'`, then re-run `brew reinstall --cask gamemaker@lts`.
  3. After any version bump, confirm the installed folder really is `/Applications/GameMaker LTS <version.major>.app` (ls /Applications | grep -i gamemaker); if the vendor renamed it, `brew edit --cask gamemaker@lts` and update the interpolated path, notices and failure_message together, then open a PR.
  4. Check `pgrep -fl GameMaker` to see the real running command line when in doubt.
  5. Maintainers: increase `attempts:` if slow IDE launches regularly outrun the retry window.

Example fix

# before (Casks/g/gamemaker@lts.rb) - pattern breaks when the vendor's folder
# no longer ends with version.major (e.g. renames to 'GameMaker.app')
terminate_process "/Applications/GameMaker LTS #{version.major}.app",
  match: :full, attempts: 3, must_succeed: false,
  failure_message: "Unable to forcibly close GameMaker LTS #{version.major}.app"

# after - keep the pattern byte-identical to the path the pkg actually installs
terminate_process "/Applications/GameMaker.app",
  match: :full, attempts: 3, must_succeed: false,
  failure_message: "Unable to forcibly close GameMaker.app"
Defensive patterns

Strategy: validation

Validate before calling

# See what is actually running, then quit it before the brew operation:
pgrep -fl '/Applications/GameMaker LTS' || true
osascript -e 'quit app "GameMaker LTS"' 2>/dev/null || true
brew reinstall --cask gamemaker@lts

Try / catch

begin
  Homebrew::SystemCommand.run!("/usr/bin/pkill",
    args: ["-f", "/Applications/GameMaker LTS #{version.major}.app"])
rescue ErrorDuringExecution
  # Pattern matched no process: not launched yet, or versioned path is stale.
  warn "Unable to forcibly close GameMaker LTS #{version.major}.app"
end

Prevention

When it happens

Trigger: `brew install|upgrade|reinstall --cask gamemaker@lts` where no process ever matches: app never launched (headless install, postinstall `open` failed), launch took longer than the ~3s window, or — specific to this cask — version.major changed or the vendor renamed the install folder so the interpolated path no longer matches the running executable's command line. Every pkill attempt fails; after the third the warning is shown and installation continues.

Common situations: Version bumps where the LTS major (e.g. 2023 → 2024) changes the folder suffix in /Applications; vendor drops the ' LTS <major>' suffix from the bundle name; SSH/CI installs with no GUI; a stale running copy from a previous LTS major under a differently-versioned path.

Related errors


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