For reasons (I'm giving a talk at a local university on getting started with writing GLSL, and might want to use Godot as part of it, due to the lack of licensing), I need to have Godot running with the following restrictions:
- the student machines are running M1 Macs (specifically, they all use Mac Studios)
- Usage of the C# Godot Editor (due to Java being so prevalent, and Java -> C# being a pretty easy migration)
- No admin rights on any machines
- No local installation of .NET
- Can execute unsigned applications from any directory on disk (this is macOS, install directories are more of a vibe than a science)
So! How do we solve this?
Godot doesn't come bundled with .NET

Pretty big starter issue here: Godot doesn't come bundled with .NET. This isn't usually an issue, and Godot gives you this helpful prompt. Let's do this then!
Every developer tool assumes you have admin rights

For anyone who has ever tried teaching, or anyone who was ever a kid trying to play video games on the school computer, you'll know intimately that basically everything assumes you have admin rights. With .NET, this is fair - it tries to install itself to somewhere in /usr/local, as that's where every program using it assumes it will be.
Installing .NET without admin

(note to self: check if "well known C# user" is libellous)
.NET can actually be installed without admin! Microsoft provide binaries, on their website, and they come in a .tar.gz. We can just place it somewhere, and setup our DOTNET_ROOT and PATH environment variables to point to the right directory.
(Thanks to everyone who has contributed to this GitHub issue, and specifically GitHub users Splitwirez and definitelyokay!)
Pointing Godot at this new .NET path
We now have a copy of .NET, and, a copy of Godot. But - launching Godot straight from the .app file still gives us the same issue. What gives?
Turns out, there's a hint in that GitHub issue! Specifically, this comment from definitelyokay
Commenting here because running Godot from Finder/macOS doesn't respect the path to dotnet set in .zshrc. Opening Godot from the terminal does allow it to find the dotnet sdk from the path specified in the .zshrc file. Godot 3.4.4.mono.stable.
I verify this by running ~/Applications/Godot_mono.app/Contents/MacOS/Godot, and, yup! .NET is found... and I get "Application is damaged" from macOS. A simple xattr -d com.apple.quarantine -r . where I've extracted .NET will fix this.
Not needing the terminal
For anyone who doesn't use a Mac, .app files that look like a flat file in the Finder, but, in reality, are just directories. If someone wanted to go and replace the binary, they can just replace YourCoolApp.app/Contents/MacOs/YourCoolApp.
As it's Just a Directory, we can do some cool stuff here! Specifically, we can move Contents/MacOS/Godot to Contents/MacOs/GodotBin, and then add a new Contents/MacOS/Godot to be our launcher. This launcher will setup the environment variables for us, so launching Godot from the Finder / Spotlight / Dock will execute this lanucher, which will then in turn launch Godot proper. The script should be something like this:
#!/bin/bash
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
# Let Godot find .NET!
export PATH=$PATH:~/.bin/dotnet-sdk-7/
export DOTNET_ROOT="~/.bin/dotnet-sdk-7/"
# "$@" is because Godot opening a project will execute itself with some command line arguments
# So, we pass all arguments to the real Godot binary
$SCRIPT_DIR/GodotBin "$@"
Then, we just mark this executable with chmod +x Contents/MacOS/Godot. Now you can load Godot from the dock, and it finds .NET, all without a care in the world
Making this more friendly for education
So, this is all good, but, this is a lot of hardcoded paths. Instead, I'd love a copy of Godot I can put on a bunch of machines using a USB drive shortly before a workshop, all setup with the environment variables and a copy of .NET.
This isn't actually too hard. We can move our dotnet-sdk-7 folder into the Godot_Mono.app/Contents/ folder, and then setup our paths to be local. The modification of the script to do this is as follows!
#!/bin/bash
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
# Let Godot find .NET!
export PATH=$PATH:$SCRIPT_DIR/../dotnet-sdk-7/
export DOTNET_ROOT="$SCRIPT_DIR/../dotnet-sdk-7/"
# "$@" is because Godot opening a project will execute itself with some command line arguments
# So, we pass all arguments to the real Godot binary
$SCRIPT_DIR/GodotBin "$@"
Some thoughts, and wrapping up

Godot is really close to being a great starter tool for teaching C# based gamedev. It's not got any licensing issues (universities, and way more schools, can be odd when it comes to requiring sign in for use of apps), an integrated IDE, and separation of 2D & 3D modes, for when you just want to teach fundamentals in 2D.
But, I think more effort could be done into supporting this usecase where the person installing Godot may not have admin rights. Unity doesn't require you to install .NET, and the Unity Hub can totally work without admin rights, and lots of work goes into this.
This isn't just a Godot issue by the way - VS Code always prompts you to enter your password to install "Helper tools" on macOS, and so many hacks on macOS assume you have the rights to go change what has accessibility permissions.
But! Hopefully this post can help some people in a similar boat - including you, Mr Beast.
