There are a number of commercial self-extracting installer products out there. I really like Paquet Builder. Unfortunately it is $50. That is about $40 more than I'm willing to pay.
To do this for FREE you need the 7-zip installer and "7z Library, SFXs for installers, Plugin for FAR Manager" from the 7-zip download page. Also you may optionally want Resource Hacker. This lets you change the .EXE icon to something pretty.
Procedure:
- Install 7-zip.
- Open the folder with the batch file and files.
- Compress the files into archive.7z
- Select the require files
- right-click, 7-Zip, Add To Archive.
- Name the 7-zip file archive.7z.
- The avg installer is already well compressed so the best compression method for it is just "store". It makes decompression fast too.
- Select the require files
- Open the 7-zip extras package and copy 7zSD.sfx and config.txt into the same directory as the archive.7z folder. The config.txt file is in the /installer directory.
- Edit config.txt and change it to run your batch file. Here is my example.
;!@Install@!UTF-8!
Title="GlobalOptions AVG8 Distributable v1.0"
BeginPrompt="Do you want to install AVG8?"
RunProgram="AVGSetup.Bat"
;!@InstallEnd@! - Finally "compile" the self-extracting EXE. This is actually just concatenating the files together.
- Open a command prompt.
- Change to the directory with archive.7z, 7zsd.sfx, and config.txt
- Run this command.
copy /b 7zSD.sfx + config.txt + archive.7z AvgSetup.exe
- Open a command prompt.
That's it. That command copies the .sfx "stub", the config file, and the archive into a single .EXE file.
Finally and optionally the .exe needs a pretty icon. :D For Anti-virus software I am rather fond of this one. "Symbol". Note: it is not free for commercial use.
To change the icon:
- Open ResHack.exe.
- File-> Open -> open the executable.
- Expand the "icon" group and expand Icon 1.
- Right-click the icon and select Replace Resource.
- Click "Open File with new Icon".
- Navigate to your .ico file.
- Click Replace.
- Save the executable.
That's it,
I hope this helps,
-Ellie