An Alternative to Custom Resource
Here's an alternative to using a custom resource. I know it works in windows, and I think it should work generally. But please comment.
The reason why I developed this idea is because the data I want to pack with my exe is potentially large (i.e. 100's of MBs) and I don't want the machine trying to load all that into memory at once. In fact, my loader problem only loads small sections (blocks of data) from such a file at any one time, and that's how I would want it to work even if it is packed with the exe.
Here's what I do. I write a program to append a data file to an exe file. At the end of file, I place an ID magic number and the position of where the exe ends and the data starts. I.e. my appended exe file looks like this:
[app exe][data file][start of data (int)][magic num (int)]
When the exe is lauched, it looks at the end of its own file for the magic number. If it finds it, then the integer before specifies the start position of the data, which the program seeks to and begins reading.
When I first tried out this idea, my concern was that the whole file data would be loaded in to memory when the exe is launched. However, this seems NOT to be the case and the program runs as normal. Which is what I want obviously, so it seems to work very well.
However, it is true that I don't understand the format of the exe binary, so am not sure why this works as it does. Can anyone enlighten me?