Link to home
Start Free TrialLog in
Avatar of dominicwong
dominicwong

asked on

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.
Avatar of Joe Winograd
Joe Winograd
Flag of United States of America image

Hi Dominic,
I use the open-source Nullsoft Scriptable Install System (NSIS) to build installers:
http://sourceforge.net/projects/nsis/

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):
http://nsis.sourceforge.net/A_simple_installer_with_start_menu_shortcut_and_uninstaller

I've used this as a starting point for building installers/uninstallers that contain a large number of files. Regards, Joe
Avatar of dominicwong
dominicwong

ASKER

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.
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 Installer...my 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
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".
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:
http://www.7-zip.org/download.html

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
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.
I've yet to try but I find a link that talks about how to do it with WinRAR.
http://stackoverflow.com/questions/9265639/how-do-i-make-a-self-installing-executable-using-winrar
ASKER CERTIFIED SOLUTION
Avatar of Joe Winograd
Joe Winograd
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
You're welcome. I hope it all works out well for you. Regards, Joe