Re: Detect .NET presence
Sergey Marakhov <[email protected]> Tue, 2 Sep 2008 14:10:25 -0700
| Newsgroups | gmane.comp.windows.devel.java.advanced |
|---|---|
| Message-ID | <D3149E217D25964D8EF6FA8BA2C32EF10243588D56@alvxmbw02.prod.quest.corp> |
Here's what we ended up doing:
public static boolean isDotNET2Available()
{
RegistryKey r =3D new RegistryKey(RootKey.HKLM, "SOFTWARE\\Microsoft\=
\.NETFramework\\policy\\v2.0");
if (log.isDebug())
log.debug(r + " exists: " + r.exists());
if (r.exists() && r.hasValue("50727"))
{
RegistryValue value =3D r.getValue("50727");
if (log.isDebug())
log.debug("Registry value: " + value);
return value !=3D null && "50727-50727".equals(value.getStringValu=
e());
}
return false;
}
The jRegistryKey library comes from here: http://sourceforge.net/projects/j=
registrykey/.
Thank you,
------------------------------------
Sergey Marakhov
Quest Software
(613) 9811 8083
-----Original Message-----
From: Discussion of advanced Java topics. [mailto:[email protected]=
ELOP.COM] On Behalf Of Ted Neward
Sent: Wednesday, 3 September 2008 3:14 AM
To: [email protected]
Subject: Re: [ADVANCED-JAVA] Detect .NET presence
There's always calling a native method that tries to create an instance of =
a
.NET AppDomain in the same process....
Ted Neward
Java, .NET, XML Services
Consulting, Teaching, Speaking, Writing
http://www.tedneward.com
> -----Original Message-----
> From: Discussion of advanced Java topics. [mailto:ADVANCED-
> [email protected]] On Behalf Of Sergey Marakhov
> Sent: Wednesday, August 20, 2008 11:34 PM
> To: [email protected]
> Subject: [ADVANCED-JAVA] Detect .NET presence
>
> Hi all.
>
> We need to detect from our java application if .NET is installed on the
> box where the application is running, and if it is - what version.
>
> We could read the registry keys (I guess).
> We could also scan the c:\windows\microsoft.net\framework.
>
> I don't like those - I'm looking for something more reliable and
> simple, for example using a 3rd party library that would do it for me.
>
> Any ideas?
>
> Thank you,
> ------------------------------------
> Sergey Marakhov
> Quest Software
> (613) 9811 8083
>
>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> This list is hosted by DevelopMentor. http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
>
> No virus found in this incoming message.
> Checked by AVG.
> Version: 7.5.524 / Virus Database: 270.6.5/1618 - Release Date:
> 8/18/2008 6:51 AM
>
No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.524 / Virus Database: 270.6.14/1647 - Release Date: 9/2/2008
6:02 AM
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
This list is hosted by DevelopMentor(r) http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
This list is hosted by DevelopMentor=AE http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com