########################################################################
# #
# This software is part of the ast package #
# Copyright (c) 1990-2011 AT&T Intellectual Property #
# and is licensed under the #
# Eclipse Public License, Version 1.0 #
# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# (with md5 checksum b35adb5213ca9657e911e9befb180842) #
# #
# Information and Software Systems Research #
# AT&T Research #
# Florham Park NJ #
# #
# Glenn Fowler <gsf@research.att.com> #
# #
########################################################################
args=
cc="ncc -O -Y-Os"
cmd="dir"
ico=
opt=
src=
USAGE=$'
[-?
@(#)$Id: sear (AT&T Labs Research) 2011-03-04 $
]
[+NAME?sear - generate a win32 ratz self extracting archive]
[+DESCRIPTION?\bsear\b generates a win32 self extracting archive that
can be used to install win32 files and applications. \bpax\b(1) is used
to generate a \btgz\b (\btar\b(1) \bgzip\b(1)) archive from the
\afile\a operands that is appended to the self extracting archive. If
no \afile\a operands are specified then the standard input is read.
\bpax\b(1) options (like \b--verbose\b) may be specified after a \b--\b
operand but before the first \afile\a operand.]
[+?When the self extracting archive is executed it creates a temporary
directory and unpacks each \afile\a. If \b--command\b=\acommand\a was
specified when the archive was generated then \acommand\a is executed
by \bCMD.EXE\b. The temporary directory is then removed.]
[+?\b.exe\b files generated by \bsear\b(1) are fully functional
\bratz\b(1) executables, so any \bratz\b option may be used on a
\bsear\b file. This allows \bsear\b file contents to be examined and
extracted without executing any embedded installation scripts.]
[a:args|arguments?The arguments appended to the \bCMD.EXE\b command
string after the runtime sear operands are appended.]:[args]
[b:bootstrap?Bootstrap-sepcific link.]
[i:icon?The resource icon is set to \aicon\a. The default is a 32 or 64
bit icon.]:[icon:=$INSTALLROOT/lib/sear/sear??.ico]
[m:meter?Set the \bratz\b(1) \b--meter\b option when the archive is
extracted.]
[r:ratz?The \bratz\b(1) source file is set to
\apath\a.]:[path:=$INSTALLROOT/lib/sear/ratz.c]
[x:command?The \bCMD.EXE\b command string to run after the top level
[v:verbose?Set the \bratz\b(1) \b--verbose\b option when the archive is
extracted.]
[ -- pax-options ] [ file ] ...
[+EXIT STATUS?]{
[+0?Success.]
[+>0?An error occurred.]
}
[+SEE ALSO?\bratz\b(1), \bgunzip\b(1), \bpax\b(1), \bCMD.EXE\b(m$)]
'
;;
*) ARGV0=""
USAGE="c:[command]i:[icon]o:[output]r:[ratz-src] [ file ] ..."
;;
esac
{
OPTIND=0
exit 2
}
;;
b) dyn=
;;
;;
;;
;;
[[ ${out##*/} != *.?* ]] && out=${out%.}.exe
;;
;;
;;
;;
*) usage
;;
esac
done
if [[ ! $src ]]
then f=ratz.c
if [[ ! $src ]]
then echo "$COMMAND: $f: cannot locate ratz source" >&2
exit 1
fi
elif [[ ! -f $src ]]
exit 1
fi
if [[ ! $ico ]]
w=${w%/*}
[[ $w == 32 || $w == 64 ]] || w=
if [[ ! $ico ]]
then echo "$COMMAND: $f: cannot locate icon source" >&2
exit 1
fi
elif [[ ! -f $ico ]]
exit 1
fi
trap 'rm -f "$obj" $tmp.*' 0 1 2 3
then exit 1
fi
! ${cc/-Bstatic/} --mt-output="$out.manifest" --mt-name="${out%.*}" --mt-administrator -o "$out" "$obj" "$res" $libs
then exit 1
fi
if [[ -f "$out.manifest" ]]
/<dependency>/,/<\/dependency>/d
w
q
!
then exit 1
fi
mt="--mt-input=${out%.*}.manifest --mt-delete"
else mt=
fi
then exit 1
fi
if [[ -f "$out.manifest" ]]
fi
files=0