–2 votes

I'm creating a retro console with Godot, and I want to have a open with functionality. Specifically to drop a file onto executable in file manager, or right click a file, open with "retro console" or something.

Godot version 3.2.3-stable
in Engine by (97 points)

This is not a question, especially "or something" part.

That is a question!

how would open with functionality look

I wrote "or something" cos there was no picture or other clear description. It could be implemented differently, but the idea is the same.

Well, then the question does not relates to a Godot, and it's very platform-dependent.

Google, how to handle file-associations in OS' shell where you want to deploy your application.

I thought that Godot might have this functionality built-in.
For me working with Godot doesn't mean doing anything such low-level, it isn't made for that. Recompiling the engine is not an option, I can only use gdscript and whatever Godot has to offer.

It very much relates to Godot, if not I would have put this question here. Difference working with native tooling and Godot is that I don't have to do what you said I need to do. Rather it's just there.

You're opening file (your made-in-Godot executable) from the file manager (not your executable).
It's a question about file manager, not Godot.

1 Answer

+1 vote
Best answer

What is your targeted OS?

If windows that information is stored in the regristry and you can set it using Godot's OS.execute() with a VB or PoweShell script. A neat trick would be to do the file association on your PC then in the registry editor do a search for your game name then export the .reg file which you can later use for the distribution of your game by resetting it.

Have not used windows since v7 but it used to be somewhere inHKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorerand may have changed in recent years

by (4,644 points)
selected by

Can the similar thing be done for Linux and macOS?

Yes Linux is much simpler Simply create a .desktop file and assign the mime type, can't remember how Apple products operate but it gets autoset, similarly Android has an Intent filter located in the AndroidManifest file

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.