noxworld-dev / opennox

OpenNox main repository.
GNU General Public License v3.0
462 stars 25 forks source link

Discover game data folder (and allow customizing it) #250

Closed dennwc closed 3 years ago

dennwc commented 3 years ago

Currently the binary assumes that it's already located in data folder, which is simple but not user friendly (requires to clean the folder for this version to work).

Discovering the data folder automatically will allow installing the build to be installed into a separate folder, while keeping the original installation intact.

Need to also figure out how we can detect the installation path for:

For Linux probably only GoG makes sense.

Evengard commented 3 years ago

Most (if not all) Nox versions use this registry path: HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Westwood\Nox (for 32 bits OS use HKEY_LOCAL_MACHINE\SOFTWARE\Westwood\Nox) REG_SZ parameter InstallPath (it explicitely points to the NOX.EXE binary, which in turn is located in the Nox directory).

dennwc commented 3 years ago

@Evengard You guidance definitely helped, I knew where to look for it :)

Tested different installer and found a few more variants. It should be pretty robust now and handle default paths even if you don't have registry records (e.g. reinstalled Windows).