views:

376

answers:

3

Can you package up the .Net framework in an installer created in Visual Studio? If so how?

I've seen this done with Install4J packaging a JVM but I think that was the JVM to run Install4J.

+5  A: 

This article should help: HOW TO: Distribute the .NET Framework with a Visual Studio .NET Deployment Project (MSDN)

Sunny
let's try to provide both links, and the related content. In the event of an external link change, this answer becomes useless.
TheSoftwareJedi
I updated the link name, so one can google for it. The link itself (if posted in clear text) will not be helpful, if the link is broken. And I doubt that SO is meant to hold another copy of Internet.
Sunny
A: 

Sucky, yeah - I created an installer just recently before realizing that the .Net Framework (which was one of the things I needed to install) was required. I ended up making a c++ program that installed .Net before my installer was launched.

Seems kind of odd to me to offer the ability to create an installer and not have it offer to install what it needs to run. Kinda pointless at that point, eh? Unless you know that every machine you give the installer to will have the necessary components...

Oh well, live and learn

Fry
+1  A: 

I just learned this lesson about deployment projects: the .MSI file delivers the application to the target machine, but that SETUP.EXE is the bootstrapper that installs prerequisites, such as the .NET Framework, MDAC, or Windows Installer. I specified the .NET Framework as a prerequisite but, because I only distributed the .MSI, no checks were run and the app crashed when starting up without the framework.

To ensure your prerequisites are on the target machine, you need to distribute the setup.exe too.

flipdoubt