Archive: how to check if DotNet Framework 3.0 SP 1 or a higher version is installed


how to check if DotNet Framework 3.0 SP 1 or a higher version is installed
Hi everyone,

Sorry to bothering you. There is a problem I could not solved.

There is an installer I wanna make. One of requirements is "check if DotNet Framework 3.0 SP 1 or a higher version is installed". DotNet Framework 3.0 could be checked with registry. But I have no idea how to check the higher version. I just imaged a foolish way as followed:

Search DotNet Framework 3.0 in registry.
Search DotNet Framework 3.5 in registry.
Search DotNet Framework 4.0 (if exists) in registry.
Search DotNet Framework 4.5 (if exists) in registry.
...
Search the newest version DotNet Framework in registry.


Whether there is a way that could compare the version automaticly not do the foolish way like I made? Could you please give me any good solutions for this requirement? Many thanks.

Have a nice day
Bardy


nothing wrong with the registry method - if nothing else it will tell you if it was installed properly.

Anyway - have you tried a search for 'dotnet' in the forums / google?

http://forums.winamp.com/showthread....ghlight=dotnet
http://forums.winamp.com/showthread....ghlight=dotnet
http://nsis.sourceforge.net/DotNET
http://nsis.sourceforge.net/How_to_D....NET_Framework
http://nsis.sourceforge.net/How_to_D....NET_Framework
http://nsis.sourceforge.net/Get_.NET_Version

Plenty of resources.. up to you which method you use (getCoreversion vs registry), but keep in mind each method's limitations. Several of the above links for example point to a method that will only detect the 'currently installed' version - which will do you no good if it says .NET Framework 3 is installed, but your dependent application needs a Framework 1 API call.


Thanks a lot. I got some ideas from these instructions. Thanks again for your help.