How To Create A Bash Install Script

Posted by suvi under Programming

Have you ever wanted to create an installer program on a Linux system, but didn’t want all the hassle of an actual install builder? I have. I recently had need of a simple, no frills installation that could:

1. ask the user a few questions
2. extract some binary files and
3. do some stuff with those binary files.

So I’m going to show you how you can create such an installer with very little hassle. I can’t actually claim credit for this method though; I actually got the idea from Sun’s JDK installer for the Linux platform. You download a “.bin” file, change the file mode so that it is executable and then run it. It displays the end user license agreement, gets some feedback and then goes about installing Java for you. Well, if you open that .bin file up in a text editor (say vi) you’ll see that it’s nothing more than a shell script with a binary chunked onto the end. Thus my plans for world domination were born…

Read more at franzone.com

Leave a Reply

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word