Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Opening Delphi project files - Any downside of opening DPR instead of existing DPROJ file?

By default, the file extension descriptions for .DPR and .DPROJ are the same, so in Explorer when opening a project file with the same base name, both file descriptions are listed as "Delphi Project File" This presents a choice to the developer - which file to open?

I typically open the second file listed, assuming it's the DPROJ.

Are there any downsides of opening a DPR when there is a corresponding DPROJ file on file? Does the IDE handle this gracefully?

I sometimes open the first file listed and I haven't noticed any problems, but it's one of those curiosities remaining unanswered. I looked through the help and couldn't find anything.

like image 708
Darian Miller Avatar asked Dec 05 '12 23:12

Darian Miller


People also ask

What is Delphi DPR file?

DPR is the file extension used for the Delphi Project file format to store all the files related to the project. This includes other Delphi file types like Form files (DFMs) and Unit Source files (. PASs).

How do I open a Delphi project?

To open an existing Delphi or C++ project for modelingOn the main menu, choose File > Open Project. In the Open Project dialog box, browse for the project or project group file. Click OK. The selected project (or project group) opens.


2 Answers

A *.dpr file contains delphi source and *.dproj contains the project configuration.

Opening one of them the IDE is looking for the other automatically.

Try to remove the *.dproj file and open the (remaining) *.dpr the IDE will inform you, that a new *.dproj file will be generated.

Do not try to remove the *.dpr :o)

like image 72
Sir Rufo Avatar answered Oct 14 '22 21:10

Sir Rufo


It can be convenient if you use older Delphi versions as well. For instance, you can open dpr with Delphi 7 and open dproj with the latest version. It allows you to open both old and new projects with a double click from the Windows Explorer.

Dproj files are MSBuild compatible files, which is used to compile the projects with.

The Delphi IDE itself doesn't actually need them to open the project. The dproj file does contain settings and the version number, though, which were stored in the dof file in Delphi 2006 and before. If the dproj file cannot be found, it is regenerated with default settings, whereas the dpr is required and is not regenerated. It's not possible, since it not only contains the uses-list, but also actual initialization code for your application.

like image 29
GolezTrol Avatar answered Oct 14 '22 23:10

GolezTrol