This is my default approach to writing installers for the Unices. The program is compressed and added to the end of the script, and the script does the unpacking and any needed setup/configuration for the specific platform it's getting installed on.
I don't append it in binary form, though. I uuencode it. That way, there is no danger in using text editors.
Sorry, I did mean base64. I have a bad habit of calling all "binary as text" encodings "uuencode". I usually catch myself before I put it in writing, though.
I don't append it in binary form, though. I uuencode it. That way, there is no danger in using text editors.