Make re3 relocatable #967

Open
madebr wants to merge 4 commits from madebr/re3_conan_libsndfile into master
madebr commented 4 years ago (Migrated from github.com)

Hello,

This pr makes re3 relocatable.
By relocatable, I mean that re3 (and its gamedata) should no longer be copied to the installation folder of gta3.
By default, it will look into the following locations (in that order):

  1. command line arguments (not implemented yet)
  2. GTA3DIR environment variable
  3. search path from INI (not implemented yet)
  4. current working directory
  5. exe path (directory where re3 binary resides)
  6. default installation paths: C:\Program Files (x86)\GTA3 or the one from steam.
  7. hard-coded built-in path

To show why this is useful, I added NSIS installer support to the cmake script.
This allows one to install re3 in a default installation folder and run it without manual copying.
Github actions builds these installers. See https://github.com/madebr/re3/actions/runs/494487376 for an example (NSIS only works on Windows)
I had to copy CMake's NSIS template script to modify it to allow installing re3 as ordinary user (instead of requiring Administrator rights. I'll look into upstreaming those modifications.

The FileLoader modification fixes this:
7687ce84ed/src/skel/crossplatform.cpp (L172-L173)

I haven't tested/used relocability with miles yet.
It will probaby need to be modified a bit because the mss32.dll won't be available in re3.exe folder.

By not defining RELOCATABLE, this feature is not enabled.

Hello, This pr makes re3 relocatable. By relocatable, I mean that re3 (and its gamedata) should no longer be copied to the installation folder of gta3. By default, it will look into the following locations (in that order): 1. command line arguments (not implemented yet) 2. `GTA3DIR` environment variable 3. search path from INI (not implemented yet) 4. current working directory 5. exe path (directory where re3 binary resides) 6. default installation paths: `C:\Program Files (x86)\GTA3` or the one from steam. 7. hard-coded built-in path To show why this is useful, I added [NSIS installer support](https://nsis.sourceforge.io/Main_Page) to the cmake script. This allows one to install re3 in a default installation folder and run it without manual copying. Github actions builds these installers. See https://github.com/madebr/re3/actions/runs/494487376 for an example (NSIS only works on Windows) I had to copy CMake's NSIS template script to modify it to allow installing re3 as ordinary user (instead of requiring Administrator rights. I'll look into upstreaming those modifications. The `FileLoader` modification fixes this: https://github.com/GTAmodding/re3/blob/7687ce84ed49e71c1fe3dcfba69ca182e72cc090/src/skel/crossplatform.cpp#L172-L173 I haven't tested/used relocability with miles yet. It will probaby need to be modified a bit because the `mss32.dll` won't be available in `re3.exe` folder. By not defining `RELOCATABLE`, this feature is not enabled.
This repo is archived. You cannot comment on pull requests.
Loading…
There is no content yet.