How to combine multiple files into one single installer file?

Hi experts
I need to distribute one single file to customer so that customer can install my program and all the prerequisites.

What I have are (63 files altogether):
 1. setup.exe
 2. myProgram.msi
 3. Prerequisites_FolderA
 4. Prerequisites_FolderB
 5. Prerequisites_FolderC

What I need is to have some way that allows me to combine all 63 files into one single file. User will run this file which then automatically runs "setup.exe".

Thanks in advance.
Who is Participating?
Joe Winograd - EE Fellow & MVEConnect With a Mentor DeveloperCommented:
Again, I don't use it for this purpose, but based on some web research it seems that 7zsd_extra is needed. Here's a link that discusses it:

The latest stable download is here:

Regards, Joe
Joe Winograd - EE Fellow & MVEDeveloperCommented:
Hi Dominic,
I use the open-source Nullsoft Scriptable Install System (NSIS) to build installers:

It is free and works very well. It also lets you build an uninstaller. AFAIK, there's no limit on the number of files that can be included in the single setup executable that it creates. In other words, your customer will get a single file called <Setup.exe> (or whatever you want to call it). Here's a sample script that creates an installer with a Start Menu shortcut, and also creates an uninstaller (which may be invoked via Control Panel>Programs and Features):

I've used this as a starting point for building installers/uninstallers that contain a large number of files. Regards, Joe
dominicwongAuthor Commented:
Thanks Joe for your suggestion.
I've been checking the Internet for possible solution. I came across with a program "WinRAR SFX". Apparently it allows people to include folders and files, then run a command during extraction. I've yet to explore whether it can do what I want or how to do it. Do you know, by any chance, if WinRAR SFX can do what I want?

Thank you.
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Joe Winograd - EE Fellow & MVEDeveloperCommented:
WinRAR is a file archive/packer/compression utility, along the lines of WinZip and 7-Zip. "SFX" means a self-extracting archive, which WinRAR, WinZip, 7-Zip, and many other archiving utilities can create. I've never used WinRAR to create archives...I use 7-Zip, as well as a third-party file manager with a built-in packer. But none of these is an installer system...WinRAR (and other archivers) can certainly package all of your files into a single file...that's their raison d'être...but for building an installer (and, very importantly, an uninstaller), I use NSIS.

After writing the comment above, I looked at your files list and noticed that you did build an MSI with Windows apologies. I don't know anything about that tool, but it would surprise me if Windows Installer can't create an MSI with lots of files. In any case, I know that a 7-Zip self-extracting archive can do what you want (it can execute a file after unpacking), and WinRAR SFX almost surely can, too, but as I said earlier, I'm not very familiar with it. Regards, Joe
dominicwongAuthor Commented:
Hi Joe,
I'd studied the link. I've the impression that is not what I need. It involves specifying the install location, registry information, etc.

In my situation, the executables "setup.exe" and "myProgram.msi" will do all that. The "setup.exe" checks and installs prerequisites (drivers, etc) if required, then it executes "myProgram.msi" to install the program at the ProgramFiles location.

What I need is quite simple (albeit not sure if easy to achieve). Merge all the files together into one single file, then user takes this single file and executes to run the included "setup.exe".
Joe Winograd - EE Fellow & MVEDeveloperCommented:
Our messages just crossed. I finally realized that you built an MSI installer, so NSIS is not what you want. As I said in the last post, 7-Zip can do it. Notice the "7z Library, SFXs for installers, Plugin for FAR Manager" item at this download link:

I've never used it for this purpose, but it seems straightforward and there are plenty of hits on the web about it. WinRAR can almost surely do it, too. Regards, Joe
dominicwongAuthor Commented:
Thanks Joe for your help. I'd downloaded the 7-Zip program. While I can use it to zip all the files together, I can't find where I can specify the executable ("setup.exe" in my case) to run during extraction by user.
dominicwongAuthor Commented:
I've yet to try but I find a link that talks about how to do it with WinRAR.
dominicwongAuthor Commented:
Thanks Joe for going out of your way to find the solution for me. I appreciate that.

I managed to do what I need with the WinRAR.  But now I am about to try the 7-zip extension that you referred.

Thanks again.
Joe Winograd - EE Fellow & MVEDeveloperCommented:
You're welcome. I hope it all works out well for you. Regards, Joe
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.