The game tries to use a ui context while setting up a platform environment. Let the platform environment be created before looking for the RCT2 directory. This is a bit hacky at the moment, but a necessary fix until it can be cleaned up.
Not all files were necessarily _changed_, but all were touched, see https://github.com/OpenRCT2/OpenRCT2/pull/4932