Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Set Relative Paths To External Resources


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 3 - Last Post: Apr 29, 2015 6:47 AM Last Post By: Olivier Sannier
Robert Kondner

Posts: 59
Registered: 11/15/01
Set Relative Paths To External Resources  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 27, 2015 6:39 AM
Hello,

I am trying to increase the portability of existing projects between machines. My current setup has numerous projects referencing an external code library located at "C:/Libs" using an absolute path. I would like to change the paths in Delphi to be relative rather than absolute, so that I can just tell my projects to find it a couple directories up ("../Libs"). That way I can move these directories to other computers without having to setup and match absolute path.

Is there any sort of checkbox somewhere in Delphi where I can just tell it to store relative paths to libraries not stored within the project directory? Is there any easy way to modify existing projects to use this? Ideally I'd like to have a programming folder with libraries and all projects, which can be moved to anywhere.

Thanks,
Robert
Bo Berglund

Posts: 757
Registered: 10/23/02
Re: Set Relative Paths To External Resources  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 27, 2015 7:23 AM   in response to: Robert Kondner in response to: Robert Kondner
On Mon, 27 Apr 2015 06:39:20 -0700, Robert Kondner <> wrote:

Hello,

Is there any sort of checkbox somewhere in Delphi where I can just tell it to
store relative paths to libraries not stored within the project directory?
Is there any easy way to modify existing projects to use this? Ideally I'd like
to have a programming folder with libraries and all projects, which can be moved
to anywhere.

I am using environment variables for this purpose.
There are at least 3 places where you can enter environment variables
for use to define the location of a resource like your code packages:
1+2) Windows itself
You can create a system (1) or user (2) env variable which is set to
the path of your library. THis is done via
ControlPanel/System/AdvancedSystemSettings/EnvironmentVariables

3) In Delphi as Delphi env variables
Open Tools/Options/EnvironmentOptions/EnvironmentVariables
Here you can view all the Windows and other global variables and add
your own, say MYLIB.

Once you have set the env var you can use it in for example the
BrowsingPath setting as $(MYLIB) and this will be stored in the Delphi
environment or in the project file depending on which browsing path
you set.

Very handy for different machines using the same code.

---
Bo Berglund
Sweden & Texas
Newsreader: Forte Free Agent 1.92/32.572

Jeff Dyer

Posts: 33
Registered: 8/9/07
Re: Set Relative Paths To External Resources  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 29, 2015 6:42 AM   in response to: Robert Kondner in response to: Robert Kondner
Robert,

You could quite easily map a network drive to your folder and call it L: for example, that way you would just share the Library folder on a new computer and map the L: drive to it.

Regards,

Jeff

Robert Kondner wrote:
Hello,

I am trying to increase the portability of existing projects between machines. My current setup has numerous projects referencing an external code library located at "C:/Libs" using an absolute path. I would like to change the paths in Delphi to be relative rather than absolute, so that I can just tell my projects to find it a couple directories up ("../Libs"). That way I can move these directories to other computers without having to setup and match absolute path.

Is there any sort of checkbox somewhere in Delphi where I can just tell it to store relative paths to libraries not stored within the project directory? Is there any easy way to modify existing projects to use this? Ideally I'd like to have a programming folder with libraries and all projects, which can be moved to anywhere.

Thanks,
Robert
Olivier Sannier

Posts: 424
Registered: 8/26/01
Re: Set Relative Paths To External Resources  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 29, 2015 6:47 AM   in response to: Robert Kondner in response to: Robert Kondner
That's the very reason why all our projects use relative folders in
their search paths and that NO, I say, absolutely NO folder is ever
added to the list inside Delphi's options itself.

Doing it this way means that all developers here can place their sources
wherever they want, which is VERY convenient when working with a dozen
branches at a time.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02