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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Joe Winograd, 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.
Joe Winograd, 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
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

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, 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.
Joe Winograd, Fellow&MVEDeveloperCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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, Fellow&MVEDeveloperCommented:
You're welcome. I hope it all works out well for you. Regards, Joe
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.