As I could not easily
add an icon to old executable files, I decided to wrap them into a PE executable. The embedded file is extracted, run and optionally deleted afterwards.
In fact, any file can be embedded, like text or images, but then a
file association must have been set up on the machine, so that the computer knows which program to use in order to open the file. (Or else you get a message asking you to choose the program yourself). In addition, it may be better not to delete the file after use in this case: If anybody edits the file, but does not save the update in a file of a different name, the changes will be lost as soon as they exit the editor.
The
addicon program is provided so that you can change the embedded file or icon in
stub.exe, the latter extracting and running the file wrapped.
You can get more information at the DOS prompt by typing:
addIcon /h
There are some drawbacks I will not hide:
-
If you have disabled custom icons on your computer, you will only see the standard executable icon.
-
Even though the embedded program may only need a DOS console, the extractor needs Windows.
-
Some 4096 bytes are added to your file, plus a 766 byte icon. (Some of the former are really empty, and I should look at this more closely the next time.)
-
You may rename the wrapper file, but not use the same name as the embedded file- clearly, the extractor cannot copy a file on the extractor.
-
The wrapped file cannot be extracted under some circumstances, for example on a write-protected floppy disc.
-
This is my first try at C++ and I will be disappointed if you cannot improve on it!
I have used a free
C++ compiler for this project (
alternate download).
If you have downloaded the old version of
addIcon.zip, please rename
master.exe to
mastermind.exe to avoid a clash between the wrapper and extracted filenames.
Up to this point:
Valid XHTML 1.0!