Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - Detecting if an application is installed on a system

Reply
 
Old 05-05-2008   #1 (permalink)
Greg Smith


 
 

Detecting if an application is installed on a system

I have a series of applications that assume other applications are
installed. Is there a way to detect the installation of a specific
application?



Any help is greatly appreciated.



My System SpecsSystem Spec
Old 05-06-2008   #2 (permalink)
Family Tree Mike


 
 

RE: Detecting if an application is installed on a system

There is no general rule to identifying whether a particular application is
installed. Some broadcast their availability by a registry key, others
don't. You may want to post the software title you are testing for and
someone may recognize a test that will identify the presence of it on the
system.

"Greg Smith" wrote:
Quote:

> I have a series of applications that assume other applications are
> installed. Is there a way to detect the installation of a specific
> application?
>
>
>
> Any help is greatly appreciated.
>
>
>
My System SpecsSystem Spec
Old 05-06-2008   #3 (permalink)
Greg Smith


 
 

Re: Detecting if an application is installed on a system

Family Tree Mike wrote:
Quote:

> There is no general rule to identifying whether a particular application is
> installed. Some broadcast their availability by a registry key,
These do. How would you identify the app?
My System SpecsSystem Spec
Old 05-06-2008   #4 (permalink)
Cor Ligthert[MVP]


 
 

Re: Detecting if an application is installed on a system


"
Quote:

>
> These do. How would you identify the app?
By reading the registry with the proper rights, what is not always the
situation.

Your question is a little bit from 1980, now you have to be more precice in
what your searching and create proper security rigths to see that.


Cor

My System SpecsSystem Spec
Old 05-06-2008   #5 (permalink)
Family Tree Mike


 
 

Re: Detecting if an application is installed on a system

"Greg Smith" wrote:
Quote:

>
> These do. How would you identify the app?
>
For example, the following code finds the current version of Java, and the
install path to it:

string key = @"SOFTWARE\JavaSoft\Java Runtime Environment";

Microsoft.Win32.RegistryKey keyJRE =
Microsoft.Win32 .Registry .LocalMachine .OpenSubKey (key, false);

string version = (string) keyJRE.GetValue("CurrentVersion");

Microsoft.Win32.RegistryKey keyJREactive = keyJRE.OpenSubKey(version);

string javahome =
System.IO.Path.Combine((string) keyJREactive.GetValue("JavaHome"),
@"bin\java.exe");

return javahome;

My System SpecsSystem Spec
Old 05-06-2008   #6 (permalink)
Family Tree Mike


 
 

Re: Detecting if an application is installed on a system

Sorry... Add checks for whether the keys exist of course!

"Family Tree Mike" wrote:
Quote:

> "Greg Smith" wrote:
>
Quote:

> >
> > These do. How would you identify the app?
> >
>
> For example, the following code finds the current version of Java, and the
> install path to it:
>
> string key = @"SOFTWARE\JavaSoft\Java Runtime Environment";
>
> Microsoft.Win32.RegistryKey keyJRE =
> Microsoft.Win32 .Registry .LocalMachine .OpenSubKey (key, false);
>
> string version = (string) keyJRE.GetValue("CurrentVersion");
>
> Microsoft.Win32.RegistryKey keyJREactive = keyJRE.OpenSubKey(version);
>
> string javahome =
> System.IO.Path.Combine((string) keyJREactive.GetValue("JavaHome"),
> @"bin\java.exe");
>
> return javahome;
>

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Detecting system shutdown. PowerShell
Detecting system shutdown PowerShell
System is not detecting Mic Vista hardware & devices
System stops detecting mic Vista networking & sharing
detecting changes to the system Vista account administration


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46