views:

1732

answers:

3

When you create a Setup project for a Windows/Console application, you find that there are two outputs.

  1. Setup.exe
  2. .msi

What does setup.exe and .MSI do? Which one should be used for installation?

I have seen that I can install the application using both. But Setup.exe is fairly small file compared to the .MSI file.

Questions

  1. If I have to ship to the client. I cannot send two files. What's the best approach to merge these two files into one Setup file?

  2. I have read that Setup.exe is a bootstrapper which checks the .NET framework and then calls the .MSI file. Is it correct?

  3. I couldn't test for the unavailability of .NET framework because I'm a .NET developer and also my team works on .NET and have .NET installed. I didn't want to risk the Visual Studio by uninstalling the .NET framework and testing the setup application.

How does it install .NET framework? It is 200 MB odd, but my setup is less than 3 MB.

Does it give a option to download or something?

Any help appreciated.

Thanks,

+5  A: 

The MSI is the installer for you application. The setup file is a bootstrap that will check for pre-reqs. Like correct version of the windows installer. I think it is also the setup.exe that will allow download of the right version of the .NET framework. You can use the .MSI on its own, you can't use just the setup.exe.

You are correct that the setup allows the download of the correct version of .NET framework.

There are ways to merge the MSI and the Setup.exe to create a single exe. Things like a self-extracting zip or iexpress.

Why can't you send them both files though? I think if you publish the setup and msi on a server for download the setup will find and download your MSI when it is required.

pipTheGeek
Good answer, but afaik it's not totally correct. One MSI is not allowed to launch another MSI due to the transactional character of an installation (at least up to the current MSI version). Therefore your own MSI cannot launch the .NET Framework setup, it must be launched by a separate bootstrapper.
0xA3
I would be very interested if you have any further information on how bootstrapper and MSI can be merged into a new MSI. I think this is not possible. However, you can use tools like WinZip or IExpress to create a self-extracting installer.
0xA3
@divo - 1) you are right, I have corrected my answer. and 2) i meant combined into an exe, not an MSI. I have clarified my answer.
pipTheGeek
+1  A: 

Setup.exe is indeed a bootstrapper that checks if the prerequisites are available on the client's machine. This includes the .Net Framework, but also for example SQL Compact Edition when you select this in the project's properties. It will not uninstall anything. When a prerequisite is needed, it will give the option to download that from the Internet or stop the installation.

The MSI file is a Windows Installer file containing your software. This MSI takes care of installing your product on the client's machine. If you ship only the MSI, the product will only install on a machine that has all prerequisites installed before launching the MSI.

If you want to do a single file distribution, you can combine the 2 files in a single EXE using iexpress. (Iexpress is a piece of software that is distributed with Windows and allows you to create setup packages.)

Hope this helps.

Jeroen Landheer
+1  A: 

The reason for the separate setup.exe I think is due to the fact that you cannot have two MSI installations running at the same time. Therefore if your application requires prerequisites installed by the MSI your installation will run into trouble.

With regards to setting up the framework you could in the project settings include the .NET framework as a prerequisite of your application and will this get installed if not already present on the target machine. You can further choose to package the installation or download it from the internet

Conrad