1

I need to create a self-extracting archive for DOS. It's on a legacy project that currently uses lha (by Haruyasu Yoshizaki) to create the self-extractor. This does work, however when it runs it asks if we want to replace ever file. For hundreds of files it is a bit of an issue.

So what I need is a way to create executables that will self-extract and provide a yes to all type option on the extractor. It also obviously has to be able to run on DOS.

I have searched on the internet and can find programs that do it but they all seem to need 32-bit.

1
  • Half-serious suggestion to create a regular lha self-extracting archive, then patch it with Hiew or another similar tool to skip the prompt. Also, I seem to remember both Total Commander and 32-bit WinRAR having MS-DOS-compatible self-extractors.
    – user1686
    Aug 12, 2013 at 7:37

3 Answers 3

1

You can do this with ARJ which you can download from http://arj.sourceforge.net

The trick is to embed command line parameters into the exe which is done by adding a comment which starts with ))

For example, if you create a text file called (for example) options.txt that contains the line

)) -o

and generate your self-extracting exe with the command line

arj A -JE -zoptions.txt TEST.EXE *.*

Then this will automatically overwrite any files (just as if you had specified the -o command line option).

1

I managed to find a way to do this using Infozip

You need to copy the UNZIPSFX.EXE into a suitable location and then merge as follows:

> cd <folder to zip>
> zip -r app .
> copy /b <UNZIPSFX location>\UNZIPSFX.EXE+app.zip app.exe
> zip -A app.exe
0

Options include:

using arj (as mentioned elsewhere on this page)

using unzipsfx (as mentioned elsewhere on this page)

using another program that handles LZH files (instead of using self-extracting files). Most archive programs can handle self-extracting files (by ignoring the self-extractor code at the start of an archive).

Perhaps the self-extracting files supports an option, like -y or /? or -? or -h, e.g.:

program.exe -y

You might get by, with using echo or type. e.g.:

echo Y | program.exe

type fileyyyy.txt | program.exe

That vertical bar is the pipe: shift-backslash

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.