We've been getting reports that the beta version of the Steam client is installing DFHack in a folder labeled "Dwarf Fortress 2346660" instead of in "Dwarf Fortress", which is breaking the way that we make our dfhooks library visible to Dwarf Fortress
After some discussion on discord the following approach seems to me to be the best method for dealing with this:
- Let Steam install DFHack wherever it likes
- The DFHack launcher will, each time it is launched, locate the DF installation and if necessarily push
dfhooks.dll/dfhooks.ld.so into that folder, along with a dfhooks.ini that contains the path of the DFHack installation
dfhooks will be modified to read this dfhooks.ini and use it to locate dfhack.dll/dfhack.ld.so and load it. This location will also be passed to the dfhack initialization and will be used as the dfhack app root folder location.
- If the launcher is being launched in "show-activity" mode (because the game was launched from DF, not from DFHack) it will check to see if an update to dfhooks.dll is needed and will schedule that update after DF exits (to avoid a locked file conflict) when needed
Backward compatibility:
- If
dfhooks.ini is missing assume DFHack is installed in the same folder as DF
- If the parameter for passing the dfhack root folder to dfhack.dll is missing, assume DFHack is installed in the current working directory