LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-03-2004, 01:59 AM   #1
cppkid
Member
 
Registered: Jul 2004
Location: Pakistan
Distribution: Ubuntu
Posts: 185

Rep: Reputation: 30
Write an installer in linux C++


I am writing a installer library in C++. I am having a problem in writing the functions.
1. Create_desktop_Shortcut()
2. Get_application_path()
Can anybody please tell me how to get the path of the current desktop programmatically, and also i didn't find any function to get the path of application, as in windows there is GetModulePath.
I will be thankful if anybdy help me out.
 
Old 08-03-2004, 02:56 AM   #2
linux_console
LQ Newbie
 
Registered: Aug 2004
Location: Portland, OR
Posts: 8

Rep: Reputation: 0
Well, for getting the desktop location, I'm not entirely sure how to definitively do. If you assumed that it was the "Desktop" directory in the home directory, it would be "$HOME/Desktop". The HOME enviroment variable is set to the home directory of the current running user.

For getting the application path, you could try scanning the PATH enviroment variable, searching in each directory in the variable for the application that is being sought. Or you could parse the output of "whereis". I'm pretty sure that "whereis" simply does just that, since you can't run it without an absolute path and without it being in one of the PATH directories.
 
Old 08-03-2004, 03:08 AM   #3
barisdemiray
Member
 
Registered: Sep 2003
Location: Ankara/Turkey
Distribution: Slackware
Posts: 155

Rep: Reputation: 30
Quote:
Originally posted by linux_console
For getting the application path, you could try scanning the PATH enviroment variable, searching in each directory in the variable for the application that is being sought. Or you could parse the output of "whereis". I'm pretty sure that "whereis" simply does just that, since you can't run it without an absolute path and without it being in one of the PATH directories.
If this will be done by getting output of a console command; then i think the command should be which :

[root@earth]# whereis ping
ping: /bin/ping /usr/share/man/man8/ping.8.gz
[root@earth]# which ping
/bin/ping

No need to parse something ;-)
 
Old 08-03-2004, 03:09 AM   #4
cppkid
Member
 
Registered: Jul 2004
Location: Pakistan
Distribution: Ubuntu
Posts: 185

Original Poster
Rep: Reputation: 30
Thanks a lot!
that solves my problem.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Red Hat Installer, vs Debian Installer rmckayfleming Linux - General 6 10-19-2005 01:23 PM
(K)Ubuntu installer failing to load installer components from CD. slackyoda Ubuntu 5 07-20-2005 03:06 PM
Linux Auto-Installer Kodaxx Linux - Newbie 5 02-18-2005 09:30 PM
What Does The UT2004 Installer Do Behind The Fancy GUI Installer? Tsuroerusu Linux - Games 2 09-09-2004 02:37 PM
free linux installer alrawab Programming 3 11-11-2003 03:17 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration