I have seen some installation files (huge ones, install.sh for Matlab or Mathematica, for example) for Unix-like systems, they must have embedded quite a lot of binary data, such as icons, sound, graphics, etc, into the script. I am wondering how that can be done, since this can be potentially useful in simplifying file structure.
I am particularly interested in doing this with Python and/or Bash.
Existing methods that I know of in Python:
- Just use a byte string:
x = b'\x23\xa3\xef' ...
, terribly inefficient, takes half a MB for a 100KB wav file. - base64, better than option 1, enlarge the size by a factor of 4/3.
I am wondering if there are other (better) ways to do this?