Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   C++ (http://www.programmingforums.org/forum15.html)
-   -   C++ program that checks if.... (http://www.programmingforums.org/showthread.php?t=12720)

jan1024188 Mar 4th, 2007 1:53 PM

C++ program that checks if....
 
Hello.

I use Linux, and I have no experience in windows. I have to write a C++ program that checks if Java is installed. I have no idea how to check that (there is no directory such /usr/bin ).
I need this for my Java app and I want check utility. Can you give me a example how to check if something is installed in windows.

Thanks in advance,

Jan Birsa

DaWei Mar 4th, 2007 1:57 PM

You'll just have to check for the appropriate file or files in the appropriate directory(s). Just accomodate the fact that they have different names. You'll have to know, of course, where the Java might be installed, or search in several likely places. Refer to your documentation for the various file utility functions.

jan1024188 Mar 4th, 2007 3:08 PM

Any easyer way?

Is there any file which contains list of programs?

DaWei Mar 4th, 2007 4:18 PM

Many programs are installed into the Program Files directory, though it isn't a requirement. DLLs may or may not be put elsewhere. Entries may or may not be made in the registry. I would suggest that if you are going to program for Windows, you learn how to work with Windows. Just a silly thought.

jan1024188 Mar 4th, 2007 4:44 PM

Quote:

Originally Posted by DaWei (Post 124772)
Many programs are installed into the Program Files directory, though it isn't a requirement. DLLs may or may not be put elsewhere. Entries may or may not be made in the registry. I would suggest that if you are going to program for Windows, you learn how to work with Windows. Just a silly thought.

I always worked on Linux platform. Also Java has its own platform so I had no problems till now. Must I realy start using windows?

Ooble Mar 4th, 2007 7:09 PM

Jan: you told us you wanted to use Windows...

DaWei Mar 4th, 2007 7:10 PM

Quote:

Can you give me a example how to check if something is installed in windows.
Quote:

Must I realy start using windows?
It's YOUR post! I suggest you work on gathering your thoughts and framing rational, logical questions and statements.

rsnd Mar 4th, 2007 7:43 PM

I think what he meant was...get yourself used to windows and its thingimizgys. It might help you when you program for it. For example...if you know common sense windows stuff like...the registry and what its used for in windows...you would not have had to make this thread.

And well, if you are gona check if java works or not, why not simply if you can run a java program =) Like dawei said, it may or many not be in the registry. But if its to be used, its gota be in $PATH right? Unless its somewhere hidden...in which case you'd have to ask the user anyway.


All times are GMT -5. The time now is 1:54 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC