Willems Davy
Willems Davy

Reputation: 105

Delphi (2007) ide changing absolute paths to relative paths in the dproj files ... Why and when?

We have a little annoying problem with our delphi 2007 IDE, from time to time for no obvious reason the delphi IDE changes absolute paths in the <DCC_DependencyCheckOutputName> node to relative paths.

for example before we saved the project this was written in the dproj file:

<DCC_DependencyCheckOutputName>D:\DcProgs\ProgUtils\ConvertToSmw\ConvertToSmw.exe</DCC_DependencyCheckOutputName>

and after saving in the delphi 2007 ide it changes to

<DCC_DependencyCheckOutputName>..\..\..\ProgUtils\ConvertToSmw\ConvertToSmw.exe</DCC_DependencyCheckOutputName>

My question is why and when does delphi do this and is there a way to stop delphi from doing this ?

You see we have made a custom buildscript that makes nightly builds for our projects and packs the executables using upx after a successfull build. To know the exe files location we use the "DCC_DependencyCheckOutputName" node, but upx doesn't like the relative paths so we need absolute paths. It would be nice that delphi stopped changing this or that we at least know when or why this happening so we know what not to do inside the ide to prevent this.

Any idea's ?

Upvotes: 3

Views: 973

Answers (1)

Jeroen Wiert Pluimers
Jeroen Wiert Pluimers

Reputation: 24523

The IDE does this when the project and the referenced files are on the same drive.

Delphi tries to do you a favour into making your project and references using relative paths, so you can move around the directory tree to another location or machine with more ease.

Sometimes this fires back (for instance when you want to include parts from the Delphi example code).

The only way to do this is to make sure the parts you want to have absolute pathnames be on a difference drive letter than the main project.

It might also be (I didn't try yet) that you can enforce this by having them on a different UNC path.

Upvotes: 3

Related Questions