0

I am writing a custom installer in C#.

Can you tell me an easy way to check if the machine has .NET version installed [even 2.0].

In cases where it is not installed, my app doesn't even start.

Thanks

2 Answers 2

2

MSDN has a blog post with sample code to detect if .NET 3 is installed.

[Edit: As mentioned by Stephen Clearly, the author of the blog post also released a tool that can be easily wrapped in a custom installer (and supports all .NET versions)]

Otherwise:

You could always use the file system and check in the %systemroot%\Microsoft.NET\Framework folder.

This will tell you if the following release versions of .NET are installed

  • v3.5
  • v3.0
  • v2.0.50727
  • v1.1.4322
  • v1.0.3705
Sign up to request clarification or add additional context in comments.

1 Comment

The writer of that blog post also released a tool that can be easily wrapped in a custom installer (and supports all .NET versions).
1

I don't know what is your custom installer, but you could use a Setup and Deployment Project in Visual Studio where you can define .NET Framework launch condition.

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.