cancel
Showing results for 
Search instead for 
Did you mean: 

How to make a self-installing

SOLVED
Go to solution
JUAN VIDAL_1
Advisor

How to make a self-installing

Hi,
I got some files compressed into a tar.gz file and I'd like to make a self-installing for them. I see there are some examples like:

#!/usr/bin/sh

export OUTPUT_PATH=${1}
cd ${OUTPUT_PATH}
uudecode <<'@eof'
begin 644 my_file.tar.gz
M'XL("(ESP$$``T]3+4M%4DY%3%\W+C
`N-2U24#`U+C%?-RXQ+C$M4E`P,BXSM
+G1A<@#L/?MS&D?2]S-#\FRJB!V!2%L
*Y:`;T%)7':*6F!!>UIVADEF4ÑLKMC1
...
8_=_H^C]RT^'H^K\AM?X/`/?*``>`4`
`
end

@eof

How to make the tar.gz binary fit into the file in that way?

Thanks in advance for your support.

Regards,

Juan.
10 REPLIES
Steven E. Protter
Exalted Contributor

Re: How to make a self-installing

Shalom Juan,

I make tar.gz files the old fashioned way.

First I tar a bunch of files into a tar file

tar cvf myinstall.tar /project/*
gzip myinstall.tar

ending up with myinstall.tar.gz

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Matti_Kurkela
Honored Contributor

Re: How to make a self-installing

Script-based self-extracting files are known as "shell archives" or "shar" files. The free GNU sharutils package can be used to create them:

http://hpux.connect.org.uk/hppd/hpux/Gnu/sharutils-4.2.1/

NOTE: self-extracting files may be harder to transmit in email than regular tar.gz packages, because of virus checkers on many email servers. Any executable attachment in email is regarded as suspicious, particularly if it can be identified as a compressed package.

If you are going to distribute self-extracting packages, you should also provide cryptographic signatures, checksums or other means to verify that the self-extractor envelope has not been tampered with by a malicious person.

If you are packaging software for HP-UX, I'd recommend creating standard swinstall .depot files instead: *every* HP-UX sysadmin should know what to do with them. If you do this, the command you'll need is "swpackage".

MK
MK
Steven Schweda
Honored Contributor

Re: How to make a self-installing

How to make a self-installing _what_?

What, exactly, are you trying to do? (And on
what?) What, exactly, does "install" mean to
you?

Info-ZIP Zip and UnZip can be used to create
self-extracting Zip archives, but that method
uses an executable program, which is not the
best way to make a self-extractor which will
run on different system architectures.
James R. Ferguson
Acclaimed Contributor

Re: How to make a self-installing

Hi Juan:

As Matti noted, 'shar(1)' might be very helpful to your goal. The utility is part of your HP-UX environment:

http://docs.hp.com/en/B2355-60130/shar.1.html

Regards!

...JRF...
JUAN VIDAL_1
Advisor

Re: How to make a self-installing

Hi Everybody,
thanks a lot for your support. I saw a self-installing archive, i.e. run_me.sh, its content is:

#!/usr/bin/sh

uudecode <<'@eof'
begin 644 my_files.tar.gz
M'XL("(ESP$$``T]3+4M%4DY%3%\W
+C`N-2U24#`U+C%?-RXQ+C$M4E`P,B
XSM+G1A<@#L/?MS&D?2]S-!50P#\F
... (big file...)
RJB!V!2%L*Y:`;T%)7':*6F!!>UIV
end

@eof

PKG_SUM="`cksum my_fyles.tar.gz | awk '{print $1}'`"

if [ "${PKG_SUM}" = "3985840691" ] ; then

echo "INSTALLATION....."
echo " UNZIPPING ....."

gzcat my_files.tar.gz | tar xvf -
fi
exit 0

My question was how to insert the binary tar.gz into the script run_me.sh in order to install it automatically.
I'll test shar and let you know!

Thanks again.

Juan.
OldSchool
Honored Contributor
Solution

Re: How to make a self-installing

in your script, where you have:

uudecode <<'@eof'
#---------------insert uuencoded file here-------<<<<<
@eof



once you have your tar/gzip file, you uuencode it to a file and place the results where indicated above (removing the commented line)

Steven Schweda
Honored Contributor

Re: How to make a self-installing

> [...] I saw a self-installing archive [...]

Ok. That's called a self-extracting archive.
("Installing" is different from
"extracting".)

> My question was how to insert the binary
> tar.gz into the script [...]

The stuff between "@eof" and "@eof"? Well,
in the script, it's being fed into uudecode,
so I'd bet that one could use uuencode to
create the stuff.

> ... (big file...)

You could try running some tests on a small
file.
Armin Kunaschik
Esteemed Contributor

Re: How to make a self-installing

Instead of creating a self-extracting self-installing voodoo thing you should consider creating a depot from your software.
The advantages are:
- automatic installation and deinstallation with possible pre-install scripts etc
- ability to check the integrity of the installed software
- maintain version/installation history

The tool to do this is available for free. Look for SPB (Software package builder).

My 2 cents,
Armin

PS: Please assign points!
And now for something completely different...
Steven Schweda
Honored Contributor

Re: How to make a self-installing

> [...] you should consider creating a depot
> from your software.

This is another case where my weak psychic
powers cause me nothing but trouble. I had
no idea that the question involved "software"
which should be installed using the usual
HP-UX software installation tools. So, while
I was left asking what the questioner really
wanted to do, someone else, who knew more
than I possibly could have known, could zip
right in with the correct answer.

Sometimes I find my inferiority in these
cases quite depressing.
JUAN VIDAL_1
Advisor

Re: How to make a self-installing

Hi Everybody,
finally I used shar to create the self-extracting archive. It was also possible to do the same with uuencode but editing a shell script.
Thanks to all for your support!

Best regards,

Juan.