By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,850 Members | 970 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,850 IT Pros & Developers. It's quick & easy.

Script to tell if .Net is installed or not.

P: n/a
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


Dec 12 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
You can do that...as long as the browser is IE, if you're doing it online.

For an example of that, see :
http://msdn.microsoft.com/library/de.../useragent.asp

If you don't need to detect while online, download sample code here :

http://blogs.msdn.com/astebner/archi...18/231253.aspx

Or, if you want to detect from a Visual Studio deployment project, see this :
http://support.microsoft.com/kb/315291/en-us


Juan T. Llibre
ASP.NET MVP
============
"Rene" <no****@nospam.com> wrote in message news:eo**************@TK2MSFTNGP12.phx.gbl...
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

Dec 12 '05 #2

P: n/a
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
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
You can do that...as long as the browser is IE, if you're doing it online.

For an example of that, see :
http://msdn.microsoft.com/library/de.../useragent.asp

If you don't need to detect while online, download sample code here :

http://blogs.msdn.com/astebner/archi...18/231253.aspx

Or, if you want to detect from a Visual Studio deployment project, see
this :
http://support.microsoft.com/kb/315291/en-us


Juan T. Llibre
ASP.NET MVP
============
"Rene" <no****@nospam.com> wrote in message
news:eo**************@TK2MSFTNGP12.phx.gbl...
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


Dec 12 '05 #3

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

"Rene" <no****@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
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
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
You can do that...as long as the browser is IE, if you're doing it
online.

For an example of that, see :
http://msdn.microsoft.com/library/de.../useragent.asp

If you don't need to detect while online, download sample code here :

http://blogs.msdn.com/astebner/archi...18/231253.aspx

Or, if you want to detect from a Visual Studio deployment project, see
this :
http://support.microsoft.com/kb/315291/en-us


Juan T. Llibre
ASP.NET MVP
============
"Rene" <no****@nospam.com> wrote in message
news:eo**************@TK2MSFTNGP12.phx.gbl...
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



Dec 12 '05 #4

P: n/a
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

Dec 13 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.