Open elenakrittik opened 1 month ago
Do you plan for the godot.lnk
shortcut to be executed via CLI by your users to open Godot, and you want to give them the option to invoke just godot
instead?
If so, and if you are planning to create some kind of installer script for gdtk, you could potentially alter the PATHEXT
environment variable to include .lnk files, which would allow the shortcut to be invoked without having to specify the extension. Example on SO.
I've manually set this on my test VM and it works fine, so I expect it can be done via script.
I'm not how users would feel about your installer altering this environment variable, however. While most users probably wouldnt care, some might find it quite intrusive.
Do you plan for the
godot.lnk
shortcut to be executed via CLI by your users to open Godot, and you want to give them the option to invoke justgodot
instead?If so, and if you are planning to create some kind of installer script for gdtk, you could potentially alter the
PATHEXT
environment variable to include .lnk files, which would allow the shortcut to be invoked without having to specify the extension. Example on SO.
Wow, that's super useful, thanks! My main aim with exposing a global godot
executable is to make tools like the GDScript VSCode extension work. (The extension requires a Godot binary to work, and it's hardly convenient to set up the binary path manually.) Allowing the user to type godot
instead of gdtk godot run
happens to come as a nice bonus.
I'm not how users would feel about your installer altering this environment variable, however. While most users probably wouldnt care, some might find it quite intrusive.
I think a good way would be to check PATHEXT
when setting up the global Godot version and if doesn't include .lnk
, print out a warning with a command that the user can run to add .lnk
to PATHEXT
.
Currently, you have to use
godot.lnk
(.lnk
meaning "link", or in Windows terms - shortcut). This is necessary because Windows runs symlinks with the current directory set to the symlink's directory, not the symlink's target's directory, which results in a crash for mono installation because Godot can't findGodotSharp
in~/.local/bin
).The only solution i see is to ship a platform-specific script (likely cmd or a native binary (for Windows, since only it is affected)) that will simply run
gdtk godot run default
, similar to what Scoop does with it's "shims".