Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I detect when the .NET Framework feature is "turned off" in Windows 7 / Vista?

My application requires the .NET Framework version 3.5. I recently ran into a customer that had the .NET Framework installed but turned off on Windows Vista (also applies to Windows 7).

In this case, my installer (InstallShield 2009) does not prompt the user to install the Framework (because it is already installed) and when my application runs it crashes immediately. I tried another .NET application and it also crashes immediately.

Is there any way to detect this situation and handle it more gracefully? Just detecting this during install is not ideal since the .NET Framework can be turned off at any time. Ideally, the application would be able to check and display a friendly message to the user telling them they need to turn on the .NET Framework.

EDIT: "Turning off" the .NET Framework in Windows Vista or Windows 7 is not the same as uninstalling it. The Framework can be simply turned back on without reinstalling: http://windows.microsoft.com/en-US/windows-vista/Turn-Windows-features-on-or-off

like image 804
John Myczek Avatar asked Apr 19 '10 18:04

John Myczek


People also ask

Where is .NET Framework in Windows 7?

NET Framework 3.5. 1 on Windows 7: Select Start > Control Panel > Programs > Programs and Features.

How do I find out when .NET Framework is installed?

If you go to Programs and Features, there will be a "View Installed Updates" on the upper left... It lists the date installed... You can also go to Settings... Windows Update and select "View Installed Update History"..

Does Windows 7 come with .NET Framework?

Microsoft . NET Framework version 3.5. 1 is included with Windows 7. Follow the steps below to enable it.


1 Answers

When I turned off the feature, the value in the registry that indicated the framework is installed got deleted. You could check that value.

Take a look at: HKLM\Software\Microsoft\NET Framework Setup\NDP\v3.5

like image 178
KevinH Avatar answered Oct 14 '22 00:10

KevinH