Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 132,602 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 948 people online right now. Registration is fast and FREE... Join Now!




plz help me

 
Reply to this topicStart new topic

plz help me

avinashb87
post 15 Jul, 2008 - 09:25 PM
Post #1


New D.I.C Head

*
Joined: 15 Jul, 2008
Posts: 5

retrieving of installed softwares in a system.
User is offlineProfile CardPM

Go to the top of the page

red_4900
post 15 Jul, 2008 - 09:48 PM
Post #2


Code Dreamers

****
Joined: 22 Feb, 2008
Posts: 792



Thanked 10 times
My Contributions


Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Please post like this:

Thank you for helping us helping you.
smile.gif
User is offlineProfile CardPM

Go to the top of the page

no2pencil
post 15 Jul, 2008 - 10:34 PM
Post #3


My fridge be runnin OH NOEZ!

Group Icon
Joined: 10 May, 2007
Posts: 6,350



Thanked 58 times

Dream Kudos: 2375

Expert In: Goofing Off

My Contributions


I'm going to guess that's a question. Although I'm not really sure what it's asking.

I think I get it... you want to know what is installed on the Computer, through a program, yes?
User is online!Profile CardPM

Go to the top of the page

nirvanarupali
post 15 Jul, 2008 - 10:45 PM
Post #4


D.I.C Foot

Group Icon
Joined: 1 Aug, 2007
Posts: 983



Thanked 2 times

Dream Kudos: 375
My Contributions


Please next time describe properly what is your problem all about, and do not let us guess what is it. And please for God's sake, do not use "Please Help me" title of the thread. smile.gif
User is offlineProfile CardPM

Go to the top of the page

no2pencil
post 15 Jul, 2008 - 10:46 PM
Post #5


My fridge be runnin OH NOEZ!

Group Icon
Joined: 10 May, 2007
Posts: 6,350



Thanked 58 times

Dream Kudos: 2375

Expert In: Goofing Off

My Contributions


QUOTE(nirvanarupali @ 16 Jul, 2008 - 02:45 AM) *

And please for God's sake, do not use "Please Help me" title of the thread. smile.gif

I would gladly change it, but I'm not sure that it would be any more clear... the original poster didn't give me much material to work with.
User is online!Profile CardPM

Go to the top of the page

polymath
post 16 Jul, 2008 - 08:42 AM
Post #6


D.I.C Regular

Group Icon
Joined: 4 Apr, 2008
Posts: 407



Thanked 4 times

Dream Kudos: 500
My Contributions


If you were running windows you could use some system("IF EXIST ..."); type statements to see if a file exists, like:

FIRST-Include cstdlib and iostream:
cpp
#include <cstdlib>;
#include <iostream>


SECOND-Create and environment variable if not already defined:
cpp

bool variableexist;
char * varexist = getenv("APPINSTALLED");
if (varexist) variableexist=true;
else variableexist=false;


THIRD: If your variable does not exist create one:
cpp

if (variableexist==false) putenv("APPINSTALLED");


FOURTH: Set the environment variable with a system call:
cpp

system("IF NOT EXIST \"C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE\" (SET APPINSTALLED=1) ELSE (SET APPINSTALLED=0)");


FIFTH: Get the new value APPINSTALLED, and create a bool for that and set it:
cpp

char * APPINSTALLED=getenv("APPINSTALLED");
bool application_install;
if (APPINSTALLED=='1') application_install=true;
else application_install=false;


FINALLY: Output:
cpp

if (application_install==true) {
cout << "Microsoft Office Word 11 is installed on this system.";
}
else {
cout << "You must install Microsoft Office Word 11 for this program to work. I do not know why.";
}
cout << endl << "Press any key to exit. ";
system("pause>nul");
User is offlineProfile CardPM

Go to the top of the page

Reply to this topicStart new topic
Time is now: 11/23/08 02:08AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month