0

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

2
  • That's the job of an installer - to detect missing dependencies and install them. Commented Aug 18, 2010 at 21:04
  • You are still "installing" something even if it's just copying one executable to the hard drive. I know Click Once has its detractors, but it would be a quick and easy solution in this case. Commented Aug 18, 2010 at 21:15

3 Answers 3

2

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

Sign up to request clarification or add additional context in comments.

1 Comment

This is a great answer, however I would prefer a free solution.
0

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.

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.