[aklug] Re: Self-extracting Archive

From: Shane Spencer <shane@bogomip.com>
Date: Fri May 08 2009 - 17:39:25 AKDT

Sorry.. I should be more verbose.

Just specify a new header file with the --header option. Check out
the one they provide for a sample. It gives you everything you need
to make a simple extractable tar file as well as one that autoruns an
install. You can add license compliance through your own means as
well.

If you're simply releasing software.. I recommend you get into the
habit of making deb and rpm files (and the respective source files) so
that other package maintainers that think your program is useful will
do all the work :)

Package: makeself
Description: utility to generate self-extractable archives
 makeself is a small shell script that generates a self-extractable
 archive from a directory. The resulting file appears as a shell script
 (many of those have a .run suffix), and can be launched as is. The
 archive will then uncompress itself to a temporary directory and an
 optional arbitrary command will be executed (for example an installation
 script). This is pretty similar to archives generated with WinZip
 Self-Extractor in the Windows world. Makeself archives also include
 checksums for integrity self-validation (CRC and/or MD5 checksums).
 .
 The makeself script itself is used only to create the archives from a
 directory of files. The resultant archive is actually a compressed
 (using gzip, bzip2, or compress) TAR archive, with a small shell script
 stub at the beginning. This small stub performs all the steps of
 extracting the files, running the embedded command, and removing the
 temporary files when it's all over. All what the user has to do to
 install the software contained in such an archive is to "run" the
 archive, i.e. sh nice-software.run. I recommend using the "run" (which
 was introduced by some Makeself archives released by Loki Software) or
 "sh" suffix for such archives not to confuse the users, since they
 actually are shell scripts (with quite a lot of binary data attached
 to it though!).

On Fri, May 8, 2009 at 5:35 PM, Shane Spencer <shane@bogomip.com> wrote:
> apt-get install makeself
>
> On Fri, May 8, 2009 at 3:53 PM, Christopher Howard <choward@indicium.us> wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> I'm trying to create a self-extracting archive/installer by following
>> some online-instructions, but it doesn't seem to be working. Can anyone
>> tell me what is wrong with this script?
>>
>> #!/bin/bash
>>
>> echo ""
>> echo "Self Extracting Installer"
>> echo ""
>>
>> export TMPDIR=`mktemp -d /tmp/selfextract.1029349304`
>>
>> ARCHIVE=`awk '/^__ARCHIVE_BELOW__/ {print NR + 1; exit 0; }' $0`
>>
>> tail -n+$ARCHIVE $0 | tar xzv -C $TMPDIR
>>
>> CDIR=`pwd`
>> cd $TMPDIR
>> ./installer.sh
>>
>> cd $CDIR
>> rm -rf $TMPDIR
>>
>> exit 0
>>
>> __ARCHIVE_BELOW__
>>
>> I cat a tar.gz archive onto the end of this script, and then execute it
>> to see if it works. When I run it, it outputs the echo message, but then
>> ramps my cpu load up to 100% and hangs there until I kill it. When I
>> kill it, I get this output:
>>
>> tar: option requires an argument -- C
>> Try `tar --help' or `tar --usage' for more information.
>> ./test.bsx: line 14: ./installer.sh: No such file or directory
>>
>> I have an overarching perspective of what the script is doing, but my
>> awk, bash, and tar skills are not very far developed, so I'm not sure
>> what is going wrong.
>>
>> - --
>> Christopher Howard
>> http://indicium.us
>> http://theologia.indicium.us
>>
>> I digitally sign /all/ of my e-mails via PGP. If you receive any e-mail
>> from me without my valid PGP signature, please take additional steps to
>> verify the authenticity of the message.
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.9 (GNU/Linux)
>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>>
>> iEYEARECAAYFAkoExfQACgkQQ5FLNdi0BcVsrwCghghG54ZxWm2rhe+TCE/WOBKe
>> YNwAoI1J1Zhek8fAEHIngTYvLDLO+z7+
>> =RHA9
>> -----END PGP SIGNATURE-----
>> ---------
>> To unsubscribe, send email to <aklug-request@aklug.org>
>> with 'unsubscribe' in the message body.
>>
>>
>
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Fri May 8 17:39:35 2009

This archive was generated by hypermail 2.1.8 : Fri May 08 2009 - 17:39:35 AKDT