Script to tell if .Net is installed or not.

R

Rene

Our company provides two downloads for our program, one includes the .Net
and the other does not. The problem is that the most of the times the user
has no idea if he or she already has the .Net installed on their local
computers or not so they are never sure if they should take the time to
download .Net only to find out that is already installed.

Is there a way to implement a button on a web page that a user can click and
popup a message box indicating if the .Net is already installed in their
local computer?

Thanks
 
J

Juan T. Llibre

R

Rene

Thanks I will play around with this. By the way, we use Firefox as our
default browser and preliminary testing appear that it also works in Firefox
unless I am doing something wrong!

Am I missing something, why did you say the html version only works on IE?
Just curios.

Thanks
 
R

Rene

Actually, the sample script does not work at all...... mmmm I wonder if I am
I doing something wrong.
 
P

prabhupr

Hope that will help (I got it from somebody recently, did not try
though :))

The user agent string of Internet Explorer is changed to contain e.g.
..NET CLR 2.0.50727 so with script inside of IE you could parse
navigator.userAgent to look for that substring to check whether the
..NET framework runtime is installed:

function checkNETFramework (version)
{
var pattern = new RegExp('.NET CLR ' + version);
return pattern.test(navigator.userAgent);
}

if (checkNETFramework('2.0')) { ... }

But don't expect other browsers to expose the MS .NET framework version
in the user agent string.
And there is no need to depend on client-side script to check the user
agent string, it is usually sent as a HTTP request header and that is
exposed server side in ASP.NET e.g. you could check
Request.UserAgent.IndexOf(".NET CLR " + "2.0") > -1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,111
Latest member
VetaMcRae
Top