Click here to Skip to main content
15,116,253 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi All,

I have a clickonce application published to an internal website. I want to have a landing page that allows the user to install the application. This is not a problem.

However, is there some Javascript I can run to determine if .NET 4 Full is installed? I want to disable the install button if it is not installed and show a link to it.

I can only find info on finding out whether 3.5 is installed and have had no success with 4.0

Thanks in advance!!

You should be able to check the User Agent to determine what versions are installed, e.g. this script checks for version of the framework - you could modify for version 4.0[^]

My user agent in IE is

Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E; InfoPath.2).

The agent you're interested in are

.NET4.0C .NET framework
Version : 4.0 Client Profile

.NET4.0E .NET framework
Version : 4.0 Extended

You'll get these in IE, but not definitely in all browsers....e.g[^]
Dave Kerr 5-May-11 10:36am
Perfect, thank you!
My 5.

Please see the Tip by OriginalGriff I just referenced.
This is a way suggested by OriginalGriff:

A safe way to get the user to check if the .NET framework is installed[^].

Please, all credit goes to him!


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900