
In early versions of Delphi and RAD Studio, a user could change some of the current project options and (with a check box) save them as default, that is as the initial options for any future project. It was also possible to change this configuration by selecting the Project Options when no project was active. This feature is long gone (I think it was dropped from XE2 or XE3).
What’s the alternative? It is called option sets and it is way more powerful that the default project options. YOu can read about it in the RAD Studio Doc Wiki at http://docwiki.embarcadero.com/RADStudio/Rio/en/Option_Sets_Overview. Here are some notes from my “Delphi 2009 Handbook” adapted to 10.3 Rio and with new images.
In the Project Manager you can select a build configuration and export its settings to an “option set” file. This is like saving a configuration template or skeleton to an external file, and the configuration will be linked to the file. You can create a new option set starting from the Project Options dialog (save) or apply an existing set:
This makes it easy to move those same settings to a new or another existing project, as you can use the Project Manager (using the Apply Options Set local menu item while on a build configuration) or the Project Options dialog box (using the Apply Options button) to import a set of configuration options. In both cases Delphi opens up the Apply Option Set dialog box, in which you can pick a file and choose whether to keep the external configuration file linked (so that a change in the file will be reflected in the projects using it) or simply merge the current settings using some priority rules.
Once you have created an external option set on a file, you can edit it from any project referring to it, using the Edit local menu of the Project Manager pane:
This opens up the an editor containing a subset of the pages of the Project Options dialog box, as shown below:
The .OPTSET file is an XML file with a format similar to the .DPROJ format, again based on the MSBUILD XML format, and an OptionSet project type. This is a simple example of its contents:
While this is an old feature, I’m pretty sure a few of the RAD Studio and Delphi users might have missed it. Notice that having multiple proejcts with settings linked to the same option set allows you to edit the configuration of many projects at once, and still override the default in each individual project as needed.
Design. Code. Compile. Deploy.
Start Free Trial Upgrade Today
Free Delphi Community Edition Free C++Builder Community Edition
Option sets are a great idea. Over the past few weeks, I have played about with them quite a bit with very mixed results, particularly frustrated that changes made leave settings unchanged. I discovered only yesterday that after saving settings, it is necessary to click the Save all button of the IDE after closing Project>Options to make them stick!
I have two serious criticisms. Firstly, it is very confusing to have two buttons labelled “Save” in a dialogue box. It took a long time to work this out. Secondly, the listbox that opens to show all the available existing option sets isn’t re-sizeable so it is impossible see all of each item to tell which optset to apply.
Additionally, I found that inspecting the contents of many other project support files showed that settings of the same type had been stored with different values at different times in different files with unpredictable results. Perhaps the result of moving projects up through different Delphi editions… To be fair, I am an amateur at this (starting with Turbo Pascal 1) now using the Community Edition DX12, only recently migrating from D7 to DX10/11.
Thanks for all your helpful input over the years.