Move the System file resource-reading code out of GetSystemVersion and
into a new ReadSystemResources method which stores the resources in a
new member variable so that it can be used by multiple methods.
* Convert all field values from host order to big-endian so they aren't
byte-swapped when created on little-endian systems.
* Pack the struct so the compiler doesn't insert padding on 64-bit
systems.
* Fix the volume and file creation timestamps by converting them from
UNIX to Macintosh time base, using a function copied from hfsutils.
* Pad volume and file names with null bytes instead of random memory.
* Add the "end of variable-length data" marker so the OS doesn't crash
when trying to resolve the alias.
* Set the alias flag so the OS treats the file as an alias.
This allows generated rez files to be listed in add_application by their
full path in the build directory, e.g. ${CMAKE_CURRENT_BINARY_DIR}/foo.r
Closes#176
On all macOS versions, Mini vMac would launch behind other applications
because it was being launched by running the executable within the
application bundle directly. The solution is to let the OS launch the
app normally by using the open utility. This eliminates the 30 lines of
code that laboriously determined the executable name.
On macOS 10.12 and later, Mini vMac could not find the ROM or disk
files. These files were being placed in the same directory as the Mini
vMac application, but a new macOS security measure called Gatekeeper
Path Randomization or App Translocation prevents that from working
anymore. See https://www.gryphel.com/c/minivmac/osx_note.html. The
solution is to place the ROM and disk files within the mnvm_dat
directory in the Contents directory in the application bundle.
The code that copies Mini vMac into the temporary directory had to be
moved earlier so that when the ROM file is symlinked and the disk image
is created the mnvm_dat directory into which they go will be there.
Since more than one method needed to know whether Mini vMac was an app
bundle, a Boolean instance var was added on macOS to indicate that.