Detecting if an application is installed on a system

  • Thread starter Thread starter Greg Smith
  • Start date Start date
G

Greg Smith

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.
 
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.
 
Family said:
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?
 
"
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
 
Greg Smith said:
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;
 
Back
Top