bmoyer Posted November 19, 2008 Report Share Posted November 19, 2008 Hello everyone, I have a project where I use a .NET call to automatically determine version information of the software (for display purposes in the About box). The problem I've come across is that sometimes, people have not installed .NET on their computers (I think it's considered an optional Windows update) and the program calls the .NET functions the program gets forever stuck in the call and freezes up the program. Is there a way to determine if .NET is installed programmatically? I should probably just list this as a requirement for the program to run properly but I would still like to prevent the program from freezing up. So far, my use of .NET hasn't been critical to my program so I could even remove the .NET calls but I really don't want to go down this road if I don't have to. Thanks, Bruce Quote Link to comment
PWilliams Posted November 19, 2008 Report Share Posted November 19, 2008 The easiest way to so check the Windows Registry. If the following key exists, the .NET framework has been installed: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework If you need to know if a specific version has been installed, you can check the sub keys for version numbers. Patrick QUOTE (bmoyer @ Nov 18 2008, 02:08 PM) Hello everyone,I have a project where I use a .NET call to automatically determine version information of the software (for display purposes in the About box). The problem I've come across is that sometimes, people have not installed .NET on their computers (I think it's considered an optional Windows update) and the program calls the .NET functions the program gets forever stuck in the call and freezes up the program. Is there a way to determine if .NET is installed programmatically? I should probably just list this as a requirement for the program to run properly but I would still like to prevent the program from freezing up. So far, my use of .NET hasn't been critical to my program so I could even remove the .NET calls but I really don't want to go down this road if I don't have to. Thanks, Bruce Quote Link to comment
TobyD Posted November 19, 2008 Report Share Posted November 19, 2008 QUOTE (bmoyer @ Nov 18 2008, 06:08 AM) Is there a way to determine if .NET is installed programmatically? You can also check the file version of mscorlib.dll. It will be located in a subfolder of C:\Windows\Microsoft.NET\Framework. The file version is the .net version - there may be more than one version installed. Quote Link to comment
bmoyer Posted November 19, 2008 Author Report Share Posted November 19, 2008 Thanks, I created a VI that uses the registry to get the folder that .NET is installed in, and then using info from a MS knowledgebase article (http://support.microsoft.com/kb/318785) to determine the versions installed (I currently don't care which version at this point but it may be useful later on). Bruce QUOTE (PWilliams @ Nov 18 2008, 09:58 AM) The easiest way to so check the Windows Registry. If the following key exists, the .NET framework has been installed:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework If you need to know if a specific version has been installed, you can check the sub keys for version numbers. Patrick Quote Link to comment
crelf Posted November 19, 2008 Report Share Posted November 19, 2008 QUOTE (bmoyer @ Nov 18 2008, 11:34 AM) Thanks, I created a VI... Nice job. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.