python-lnp icon indicating copy to clipboard operation
python-lnp copied to clipboard

macOS: Support embedded Dwarf Fortress

Open Pidgeot opened this issue 4 years ago • 0 comments

I'm going to go forward with the plan to embed DF inside the PyLNP app bundle, and then copy it to the user's filesystem when the app is launched. This will work around Mac security restrictions.

Inside PyLNP.app/Contents/Resources/Game I will put the LNP and Dwarf Fortress x.yy.zz directories, as well as a version.txt file that contains a unique string for the starter pack release.

When PyLNP runs, it will read the version.txt file. Suppose it says 0.44.12-r02-mac, then PyLNP will be directed to look at ~/Library/Application\ Support/Dwarf\ Fortress/0.44.12-r02-mac.

If this directory does not exist yet, then the Game directory is recursively copied to ~/L/AS/DF/0.44.12-r02-mac.

In order to run a migration step, it will check for a symlink in ~/L/AS/DF/Previous to another DF directory. If this symlink exists, then it will offer to migrate saved games. After migration, it will offer to delete the old installation. The Previous symlink is updated to the new directory.

PyLNP then changes the current working directory to ~/L/AS/DF/0.44.12-r02-mac and continues.


Does that sound reasonable?

[Issue created by rgov: 2018-07-20]

[Comment created by rgov: 2018-07-20] Downsides:

  • If there are any files that PyLNP does not know how to automatically migrate, then the user will face data loss when we offer to delete the old directory.

  • If the user declines to delete the old directory, then they may not know how to find it later. We can put a shortcut in the Folders menu.

  • The DF inside the app bundle is going to take up space after the initial copy. Perhaps it could instead be a compressed tarball that gets recursively copied, which would save a bit of space. Or perhaps it could do something crazy with symlinks, but that doesn't seem reliable.

Pidgeot avatar Apr 04 '20 15:04 Pidgeot