Skip to content

Conversation

@VerneStudiosGit
Copy link

Problem

The VSCode extension was always defaulting to Windows platform when running GameMaker projects on macOS, causing runtime failures due to incorrect platform detection and missing Mono dependencies.

Solution

This PR adds comprehensive macOS support by:

1. Platform Detection

  • Added defaultTargetPlatform utility function that correctly maps darwin to mac
  • Updated runtime commands to use the detected OS platform instead of hardcoded windows

2. macOS Runtime Discovery

  • Enhanced listGameMakerRuntimeDirs() to search macOS-specific paths:
    • /Users/Shared/GameMakerStudio2/Cache/runtimes/
    • User-specific paths in ~/Library/Application Support/GameMakerStudio2/
  • Added support for macOS runtime executable detection (Igor without .exe)

3. Cross-Platform Compatibility

  • Maintained backward compatibility with existing Windows functionality
  • Improved path handling for both Windows and macOS environments
  • Enhanced IDE and component detection for both platforms

Changes Made

  • packages/launcher/src/lib/GameMakerRuntime.command.ts: Updated platform detection logic
  • packages/launcher/src/lib/utility.ts: Added macOS path support and platform utilities
  • packages/launcher/src/lib/GameMakerComponent.ts: Enhanced cross-platform component detection
  • packages/vscode/src/lib.mts: Improved IDE discovery for macOS

Testing

  • Verified runtime detection works correctly on macOS
  • Confirmed GameMaker projects run with correct -- mac Run command instead of -- windows Run
  • Validated backward compatibility with existing Windows workflows

Impact

This enables GameMaker developers on macOS to use the Stitch VSCode extension without platform-related runtime errors, significantly improving the developer experience for Mac users.

@adam-coster
Copy link
Member

Rad, I appreciate your work on this! From a cursory look things look solid but I'll need some time to review everything and make sure stuff still works on Windows. I'll try to get that done by the end of the week!

@VerneStudiosGit
Copy link
Author

Sure! take your time! Nice project btw, I've been using it for a week now. I'd love to keep helping with the macOS support.

@adam-coster
Copy link
Member

I appreciate all the help I can get! We don't use Mac at all so the only way Stitch will support it is with outside help :D

};
} else {
// Fallback for other platforms
const prefix = `${process.env.HOME}/.gamemaker`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know that this fallback works on some platform? E.g. does this work on Linux?

installer.on('exit', resolve);
});
} else if (process.platform === 'darwin') {
// For now, display a helpful message to the user
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing you added this to prevent the error from being thrown, but since it doesn't actually run the IDE installer on Mac it probably should still throw. Maybe this should get handled at the caller instead? Presumably there's some step you're trying to prevent from erroring out in VSCode or something.

continue;
} else if (process.platform === 'darwin') {
// macOS: Search for runtimes in /Users/Shared/GameMakerStudio2/Cache/runtimes/
const sharedRuntimesDir = new Pathy('/Users/Shared/GameMakerStudio2/Cache/runtimes');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seems to be redundancy here. The original windows code calls listGameMakerRuntimes(), which you aren't doing here. But you did update the listGameMakerRuntimes() function to work on MacOS -- can that have been used here instead?

Basically it'd be easier to review and maintain if any redundancies like this were removed. I don't want to make any such edits myself since I won't actually be able to test them, but it'd be very helpful for readability and future maintenance.

@webb-version-control
Copy link

On mac here - M3 latest OS 26.0.1.
Struggling to get stitch to find the runtime.
Would be great to get this working on mac - lmk if I can help test anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants