views:

949

answers:

4

I have created a setup project in VS2008. My WinForms app uses .NET 2.0, so I chose .NET 2.0 Prerequisity and built the setup project.

When I run my Setup.msi on a clean PC, it correctly detects that the .NET is missing and asks if it should be installed. After a successful installation of the .NET, the installer simply exits and doesn't continue with installation of my app (I think it should).

When I run the MSI file on a PC with .NET already installed, my app installs correctly.

Is there any way how to install .NET 2.0 and my app together in one step?

+5  A: 

Hi,

How did you install the product?

The setup project will output two files:

  • a Windows Installer package (.msi), and
  • a so-called bootstrapper (setup.exe)

The bootstrapper will check for the presence of any pre-requisite that you specified and possibly download and install it if it is not installed yet and then continue to install your application (by calling the .msi). Therefore you should always start the setup.exe to install your application and not the .msi file (unless you know that all pre-requisites are on the target system).

As Krakkos says, the bootstrapper will install both the pre-requisites and your application (i.e. your .msi file). However, I'm not aware of any configuration settings which would prevent the bootstrapper from installing the msi.

To troubleshoot you could try to create a log of your installation and look for any problems in the log file.

0xA3
A: 

The MSI intaller will do it, but perhaps you need to configure it more precisely.

Sorry not much help, but i know its possible.

Krakkos
+1  A: 

Thanks Divo,

I was running the MSI file.

Are there any limitations when running the Setup.EXE file? If I remeber correctly, I tried once to run it on Windows 2000 and it didn't run. I was able to run only the MSI file. I am going to check on a PC with clean Win2000 and come back.

EDIT: I have tried it on clean Windows 2000 SP4 and here are the results:

  • Setup.exe will not run with a message about missing HeapSetInformation in Kernel32.dll
  • Setup.msi will aso not run (the .msi extension is unknown)

Then I manually installed Windows Installer 3.1:

  • Setup.exe will still not run with the same error message
  • Setup.msi will run successfuly (but will install only .NET without my app...my initial problem)

On Windows XP, the Setup.exe runs without any problems.

It seems that users with Win2000 will have to install my app manually by installing Windows Installer 3.1, .NET 2.0 and then my app. Even when .NET is manually installed, the Setup.exe will still show the same error message under Win2000 SP4.

EDIT: The Win 2000 issue can be fixed by installing the Update Rollup 1 for Windows 2000 SP4 (KB891861).

A: 

This episode of Hanselminutes goes into great detail about how Paint.Net arranges for downloading & installing the required .NET framework on demand, and integrating with the application installation. Admittedly this is probably way more complex that most applications require, but is an interesting discussion nonetheless.

Chris Ballard