OpenVMS Tips: Self-Extracting Compressed Images
To create a self-extracting compressed image on OpenVMS, you'll likely use one of two tools available for this purpose. You'll use either FTSV, or zip and unzip.
FTSV, a package available on the OpenVMS Freeware V8.0 distribution, and it performs a variety of functions including spooled file transfer, command execution on completion, and various other functions. This is the tool that creates the AXPEXE and VAXEXE images you've probably seen OpenVMS Engineering use. (There's unfortunately no version for OpenVMS I64 available.) FTSV is a powerful and useful and somewhat arcane tool, and may well be the subject of another future discussion here at HoffmanLabs.
The other approach is to use a self-extracting zip. Technically, a self-extracting unzip. Zip and unzip are also available on the OpenVMS Freeware. To create the self-extracting zip archive, you must first use zip to zip whatever it is that you want to use as the payload. The following example shows how to create a zip archive (preserving OpenVMS file attributes with "-V"; the quotes required) named zipfile.zip, and to then add the self-extracting unzip tool (unzipsfx; sometimes “sfx”) onto the front of the archive.
$ zip "-V" zipfile.zip ddcu:[source...]*.*
$ copy unzipsfx.exe,zipfile.zip zipfile.axpsfxexe
Pretty simple, eh?
You can now run zipfile.axpsfxexe, and the archive will decompress. If you use an extension other than .exe, you will have to specify it on the run command, or (if using a foreign-command or DCL$PATH) specify the filename and extension.
Because it's a version of zip, you can also specify the self-extracting image as a foreign command or DCL$PATH, and pass in arguments into the unzipsfx tool. If you want. Most folks don't bother with this.
Do remember that the zip executable is architecture specific, and users will typically need and want to unzip on the target architecture.
On the OpenVMS Freeware V8.0 distro, look in the zip and unzip directories for zip 2.32 and unzip 5.52. Use of versions prior to 2.32 and of 5.52 is to be discouraged. The most current versions of the zip and unzip tools are available from the Info-ZIP site.
Prior to the planned zip 3 and unzip 6 releases, zip and unzip are limited to a maximum of two gigabytes of compressed data on OpenVMS, and to two and potentially up to to four gigabytes of uncompressed input data. When you get to around two gigabytes for input or file size, zip can encounter failures.
update 12-May-2009: zip 3.0 and unzip 6.0 (or later) are now available at the Info-ZIP site, and at the the Process Software OpenVMS Freeware site. Also see the zip and unzip page here at HoffmanLabs.
For details on unzipsfx and its available options and full command syntax, see the unzipsfx.txt documentation in the unzip directory.