File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes How to monitor softwares in Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to monitor softwares in Java" Watch "How to monitor softwares in Java" New topic
Author

How to monitor softwares in Java

Vid Srini
Ranch Hand

Joined: Aug 17, 2006
Posts: 35
Is there any class in Java to identify the status of the software installation.

I need to check whether a particular software is installed in the system.How can I do this in Java

Please can any one help me out to find the solution for this pbm.



Regards,
Vidhya
[ December 04, 2006: Message edited by: Vid Srini ]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41600
    
  55
The software would install particular files somewhere - if you know what those are you can check for their presence. Not foolproof, but should be pretty reliable. This won't work in situations where a SecurityManager is present (applets, possibly web apps depending on the servlet container setup), because permission to access arbitrary files won't be given.


Ping & DNS - my free Android networking tools app
Vid Srini
Ranch Hand

Joined: Aug 17, 2006
Posts: 35
Hi Ulf,
Thanks for your reply.

Is there any specific class in Java to do this checking...

Can I get a detailed input of how to proceed.

Thanks,
Vidhya
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3489
    
  13
The File class has a method (exists) that tells you whether a file actually exists


Joanne
Tim LeMaster
Ranch Hand

Joined: Aug 31, 2006
Posts: 226
This would seem highly unreliable to me, I rarely install things in the default location on Windows as "Program Files" is too long and has a space. If you are calling a third party application I would ask the user where its is installed and if you can't find the program there, give the user an warning/error as the case may be.
[ December 05, 2006: Message edited by: Tim LeMaster ]
Amir Kamran
Ranch Hand

Joined: Apr 21, 2002
Posts: 48
whenever some software installs on windows operating system it adds some information in the windows registry...So the first thing you need to know which registry entries a particular software adds to the windows registry.
than you can easily read information from windows registry using java.util.prefs.Preferences class
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41600
    
  55
I didn't see anything in the question that indicates that a Windows-only solution like reading the registry will suffice. But anyway, the Preferences class can not read arbitrary registry entries, only a very limited subset of entries generated by other applications also using this class. For a way of reading all registry entries, [URL=How to read the Windows Registry]look here[/url].
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to monitor softwares in Java