Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 4th, 2007, 12:53 PM   #1
jan1024188
Programmer
 
jan1024188's Avatar
 
Join Date: Mar 2007
Location: Slovenia
Posts: 33
Rep Power: 0 jan1024188 is on a distinguished road
Send a message via MSN to jan1024188 Send a message via Yahoo to jan1024188 Send a message via Skype™ to jan1024188
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
jan1024188 is offline   Reply With Quote
Old Mar 4th, 2007, 12:57 PM   #2
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Mar 4th, 2007, 2:08 PM   #3
jan1024188
Programmer
 
jan1024188's Avatar
 
Join Date: Mar 2007
Location: Slovenia
Posts: 33
Rep Power: 0 jan1024188 is on a distinguished road
Send a message via MSN to jan1024188 Send a message via Yahoo to jan1024188 Send a message via Skype™ to jan1024188
Any easyer way?

Is there any file which contains list of programs?
jan1024188 is offline   Reply With Quote
Old Mar 4th, 2007, 3:18 PM   #4
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Mar 4th, 2007, 3:44 PM   #5
jan1024188
Programmer
 
jan1024188's Avatar
 
Join Date: Mar 2007
Location: Slovenia
Posts: 33
Rep Power: 0 jan1024188 is on a distinguished road
Send a message via MSN to jan1024188 Send a message via Yahoo to jan1024188 Send a message via Skype™ to jan1024188
Quote:
Originally Posted by DaWei View Post
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?
jan1024188 is offline   Reply With Quote
Old Mar 4th, 2007, 6:09 PM   #6
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Jan: you told us you wanted to use Windows...
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Mar 4th, 2007, 6:10 PM   #7
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Mar 4th, 2007, 6:43 PM   #8
rsnd
Hobbyist Programmer
 
rsnd's Avatar
 
Join Date: Jun 2005
Location: Helltown
Posts: 162
Rep Power: 4 rsnd is on a distinguished road
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.
__________________
Spread your wings and fly! Chicken!
rsnd is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Language display in program Prm753 C++ 3 May 30th, 2006 5:45 PM
Help me make a program. read ---> DBZ Visual Basic 8 Mar 10th, 2006 8:53 AM
Creating a program to test a program sixstringartist C 8 Jan 21st, 2006 1:15 PM
auto run hidden program. kuroko C++ 9 Aug 6th, 2005 10:05 AM
airport Log program using 3D linked List : problem reading from file gemini_shooter C++ 0 Mar 2nd, 2005 4:12 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:44 AM.

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