Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to monitor softwares in Java

 
Vid Srini
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Vid Srini
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The File class has a method (exists) that tells you whether a file actually exists
 
Tim LeMaster
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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].
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic