This is a simple bash script that does the following:
- Define an installation name and a path
- Check if the user likes the default path or not
- Check if installation / copy folder requires root access
- Check if installation file already exists and if it does, ask if it should be overwritten
- If all checks pass, the binary content below the line
#__PROGRAM_BINARY__
are copied into the file at the given location and it is made executable
This bash script can be used to create a very simple installer for, e.g., a CLI tool. Modify the pathes you want to set as a default and the default name.
Then save the file.
Finally copy the binary data at the end.
Let's assume your script is called my_installer.sh
and the binary my_binary
, the following will append the binary content at the end:
cat my_binary >> my_installer.sh
Enjoy!