Java - Awareness of other programs installed on PC  
Author Message
adeelmahmood





PostPosted: 2007-2-14 6:10:00 Top

java-programmer, Java - Awareness of other programs installed on PC Is there way in JAVA to access information about the installed
programs on the PC. I mean somehow you could grab some information
about all items in (lets say for windows) the Start-Programs.
Thanks for ur help

 
Andrew Thompson





PostPosted: 2007-2-14 6:39:00 Top

java-programmer >> Java - Awareness of other programs installed on PC On Feb 14, 9:10 am, "adeelmahmood" <email***@***.com> wrote:
> Is there way in JAVA to access information about the installed
> programs on the PC. I mean somehow you could grab some information
> about all items in (lets say for windows) the Start-Programs.

Why? What does this program give to the end user?

Andrew T.

 
adeelmahmood





PostPosted: 2007-2-14 6:42:00 Top

java-programmer >> Java - Awareness of other programs installed on PC On Feb 13, 4:38 pm, "Andrew Thompson" <email***@***.com> wrote:
> On Feb 14, 9:10 am, "adeelmahmood" <email***@***.com> wrote:
>
> > Is there way in JAVA to access information about the installed
> > programs on the PC. I mean somehow you could grab some information
> > about all items in (lets say for windows) the Start-Programs.
>
> Why? What does this program give to the end user?
>
> Andrew T.

well there are many possibilities .. thats not the point .. is it
possible and how ???

 
 
Brandon McCombs





PostPosted: 2007-2-14 7:29:00 Top

java-programmer >> Java - Awareness of other programs installed on PC adeelmahmood wrote:
> On Feb 13, 4:38 pm, "Andrew Thompson" <email***@***.com> wrote:
>> On Feb 14, 9:10 am, "adeelmahmood" <email***@***.com> wrote:
>>
>>> Is there way in JAVA to access information about the installed
>>> programs on the PC. I mean somehow you could grab some information
>>> about all items in (lets say for windows) the Start-Programs.
>> Why? What does this program give to the end user?
>>
>> Andrew T.
>
> well there are many possibilities .. thats not the point .. is it
> possible and how ???
>

You'll have to forgive Andrew. He seems to avoid answering questions
asked by the poster and ask his own instead if he thinks his are more
relevant. Your reasons don't matter to me but they seem to matter to
him. Until it is determined that it matters to help you with your
problem it's really none of my business *why* you want to do something.


Anyway, in the specific case of Start menu entries, these entries are
shortcuts that exist as files (like any other Windows shortcut) in a
User's profile directory. Each user has a Start Menu folder that
contains programs that were installed only for them (most apps are
installed under the All Users profile). So you could just use Java to
look at a user's start menu entries by looking at the Start Menu folder
for that user. If you need anything else like accessing the Windows
registry through Java I can't help you. I seem to recall looking for
something like that a few weeks ago and I think I found some libraries
that could do that but they weren't free.


hope that helps
Brandon
 
 
Arne Vajh鴍





PostPosted: 2007-2-14 7:56:00 Top

java-programmer >> Java - Awareness of other programs installed on PC adeelmahmood wrote:
> Is there way in JAVA to access information about the installed
> programs on the PC. I mean somehow you could grab some information
> about all items in (lets say for windows) the Start-Programs.

To access the Windows registry you will need JNI.

You can find the items in the start menu by just
listing files and directories, but if you need to
read the content of the .lnk files I believe you are
in unsupported land. There are probably some Win32 API
to access the info and this will also require
JNI.

I think the bottom line is that Java is not a god
choice for the task.

Arne

 
 
Andrew Thompson





PostPosted: 2007-2-14 16:37:00 Top

java-programmer >> Java - Awareness of other programs installed on PC On Feb 14, 10:29 am, Brandon McCombs <email***@***.com> wrote:
> adeelmahmood wrote:
..
> You'll have to forgive Andrew.

The OP can do anything they like.

Andrew T.

 
 
Alex Hunsley





PostPosted: 2007-2-14 18:29:00 Top

java-programmer >> Java - Awareness of other programs installed on PC Arne Vajh鴍 wrote:
> adeelmahmood wrote:
>> Is there way in JAVA to access information about the installed
>> programs on the PC. I mean somehow you could grab some information
>> about all items in (lets say for windows) the Start-Programs.
>
> To access the Windows registry you will need JNI.

He could always use System.execute() with some native commands for
accessing the registry etc. Doesn't sound very nice though.

>
> You can find the items in the start menu by just
> listing files and directories, but if you need to
> read the content of the .lnk files I believe you are
> in unsupported land. There are probably some Win32 API
> to access the info and this will also require
> JNI.
>
> I think the bottom line is that Java is not a god
> choice for the task.

Agreed....
(I had a giggle at 'god' choice btw! Started imaging Sun's other
products, e.g. Sun Jehova.)
 
 
Chris Uppal





PostPosted: 2007-2-15 2:41:00 Top

java-programmer >> Java - Awareness of other programs installed on PC Brandon McCombs wrote:

> Anyway, in the specific case of Start menu entries, these entries are
> shortcuts that exist as files (like any other Windows shortcut) in a
> User's profile directory.

And elsewhere ('All users' as it's called on my Windows installation, though I
imagine that name varies with language).

And I wouldn't put it past MS to include "magic" entries in there too.

But that (even when generalised) doesn't sound very useful to me. The nearest
thing to a correct list of installed software in Windows is the one used by the
"Add/Remove programs" application. But even that isn't really correct (I have
many apps on this box which weren't "installed" in the normal sense -- Eclipse,
for one).

So, it really comes down to what the OP is /really/ trying to do. Which is
what Andew asked.

-- chris


 
 
adeelmahmood





PostPosted: 2007-2-15 3:33:00 Top

java-programmer >> Java - Awareness of other programs installed on PC On Feb 14, 12:40 pm, "Chris Uppal" <email***@***.com
THIS.org> wrote:
> Brandon McCombs wrote:
> > Anyway, in the specific case of Start menu entries, these entries are
> > shortcuts that exist as files (like any other Windows shortcut) in a
> > User's profile directory.
>
> And elsewhere ('All users' as it's called on my Windows installation, though I
> imagine that name varies with language).
>
> And I wouldn't put it past MS to include "magic" entries in there too.
>
> But that (even when generalised) doesn't sound very useful to me. The nearest
> thing to a correct list of installed software in Windows is the one used by the
> "Add/Remove programs" application. But even that isn't really correct (I have
> many apps on this box which weren't "installed" in the normal sense -- Eclipse,
> for one).
>
> So, it really comes down to what the OP is /really/ trying to do. Which is
> what Andew asked.
>
> -- chris

well Thank you guys for all ur help .. to clear up all this mess ..
here is what I had in mind ..

I was thinking along the lines of having a Java program automate the
startup of other programs on ur PC ..using keywords .. kind of like
launchy http://www.launchy.net/ .. difference is that launchy is
written in C so it makes it a perfect candidate for windows stuff ..
what launchy does is that indexes the start up programs for u to
create a list of programs that u could start with some keyword
matching mechanism ..

I understand that for something like this java should not be the
choice especially since it defeats the whole platform-independant-
langauge concept. but I think this can be implemented in platform-
independant manner so I guess I am just gonna drop the idea of
indexing the Start menu or something like that ..

the simplest thing would be to just let the user specify the
executables and with the help of some pattern matching you can make it
easier for user to get to that program .. but automating things is
always better ..
so if u have any ideas regarding this stuff .. please share

Again thanks for your help ..


 
 
Lew





PostPosted: 2007-2-15 4:13:00 Top

java-programmer >> Java - Awareness of other programs installed on PC Alex Hunsley wrote:
> (I had a giggle at 'god' choice btw! Started imaging Sun's other
> products, e.g. Sun Jehova.)

It would run on the Jehova Virtuous Machine.

- Lew
 
 
Arne Vajh鴍





PostPosted: 2007-2-15 8:01:00 Top

java-programmer >> Java - Awareness of other programs installed on PC Alex Hunsley wrote:
> Arne Vajh鴍 wrote:
>> I think the bottom line is that Java is not a god
>> choice for the task.
>
> Agreed....
> (I had a giggle at 'god' choice btw! Started imaging Sun's other
> products, e.g. Sun Jehova.)

Absolutely unintentional. I just missed an 'o'.

:-)

Arne
 
 
Alex Hunsley





PostPosted: 2007-2-15 8:58:00 Top

java-programmer >> Java - Awareness of other programs installed on PC Lew wrote:
> Alex Hunsley wrote:
>> (I had a giggle at 'god' choice btw! Started imaging Sun's other
>> products, e.g. Sun Jehova.)
>
> It would run on the Jehova Virtuous Machine.

:)

>
> - Lew