Click to See Complete Forum and Search --> : Check if .NET is installed


NoHero
July 28th, 2004, 04:31 AM
Ok here my question: Is there any safe way to check if the .NET framework is installed?

Because I have to write a database application and I will use VB.NET or CS. And then I want to create a C program wich checks if the application can be executed on the target machine by check if the .NET is installed. if not the program should give a MessageBox or something like that, or run the Framework installer.

Does anybody know how to do this?

Thx for reading this!

Jinto
August 19th, 2004, 02:40 AM
There is a registry key. That contains the version if that exists then its installed

HKLM\SOFTWARE\Microsoft\.NETFramework\policy\v1.0
HKLM\SOFTWARE\Microsoft\.NETFramework\policy\v1.1

If a version key exists in policy then that version is installed.



If it containts a version different to that of the framework your installing. Then you need to install it.

If it contains no value then it needs to be installed.

Hope this helps. Also check MSDN for a sample application ( Bootstrapper ) that installs the .NET Framework if it needs to then runs a msi install package.