How to create a linux installer for a Xojo app

Tim Jones

I use a combination of a script and a tarball. The script handles checking that the user has the proper authorizations and then extracts the tarball content into their proper location. There are dozens of variations out there if you search, and this could be enhanced into a GUI using zenity or xdialog.


id | grep uid=0
if [ $? -ne 0 ]
  echo "Must be root or use sudo to execute this installer."
  exit 1

installer="$(pwd)/$(basename $BASH_SOURCE)"

echo "Installing OWC ArGest Backup ..."

ARCHIVE=`awk '/^__ARCHIVE_BELOW__/ {print NR + 1; exit 0; }' $0`

tail -n+$ARCHIVE $0 | tar xzP

# notice the upper case P in that extract command
# This allows tar to retain the parent path elements instead
# of stripping them off.

# run post installation steps
## place any commands that should be executed after the
## tarball is extracted here.

echo "Installation complete!"
exit 0


Now, create your tarball using the same -P (upper case P), and then concat the two files into a .run file, and set the execute bit:

cat MyApp.tgz >>
sudo chmod +x
zip -f MyApp_Document.pdf

Share the file with your users.

This works with any platform type redardless of the package manager. You’ll finde a lot of commercial apps use this type of installer.

source dec 2022