views:

49

answers:

3

I have an executable that displays a simple windows form. Unfortunately this application will not run if the user does not have the .NET framework installed.

I would like to be able to detect if the user's machine has the .NET Framework installed, and if not, give them the option to download and install it.

I know that this is possible through the use of an installer project; however, I am not actually installing anything, therefore an installer is not a viable option.

Is there any way to do this?

I would greatly appreciate any ideas or suggestions.

Thank you,

Mattimus

+1  A: 

You can embed a stripped version of .net in your executable using tools like Xenocode: http://www.xenocode.com

Pierre 303
This is a great answer, however I would prefer a free solution.
Mattimus Max
A: 

The simplist way to detect if a computer has the .NET framework installed is to create an unmanaged C++ application in Visual Studio. All the application will need to do is check the %SystemRoot%\Microsoft.Net\Framework directory. There should be subdirectories in here such as "v2.0.50727" (for the .NET 2.0 framework) and "v3.0" (for the .NET 3.0 framework). Check that these directories exist. If they do, then the framework is installed.

icemanind
A: 

You need to create a 'bootstrapper' application in something other than .net. It checks for .net, and if found starts your app, otherwise offers to do the install. Make your 'desktop shortcut' or whatever point to that app instead.

For the install I will suggest SmallestDotNet though I have never used it myself.

BioBuckyBall