For the time being this is a teaser only, sources will be published on GitHub as soon as I finish up the rough edges.
Due to the recent success of detecting and interacting with Delphi IDE versions / instances I decided to put together a new BDSLauncher, which allows you to set up rules to automatically decide which version and which instance of Delphi you want to open a Delphi source file with. If started without any parameters, the rule editor main window will show up:
Here a list of file masks can be provided. If the file which is about to be open matches any of these, it will be opened in the version selected under. There are situations when a project has to be open for a .pas (.dfm more likely) to appear correctly. To support this, you can set a string which has to be contained in the IDE caption for it to be selected. If this is empty or there was no instances found with this criteria, a new instance will be launched with the parameters you specify (should be the main project .dproj / .dpk).
If a parameter is specified (and the file indeed exists) two things can happen. Either a rule will decide which version / instance the selected file should be started in, or if there's none a selector will appear:
If more rules would apply to the source file but the specified instance is not found, the last will be selected alphabetically. In case any rule was selected, no window is shown, only the IDE is launched and / or the source file is opened and the launcher will close shortly after.
In theory, the new launcher should support all Delphi versions from 6 and up, however the DDE component used (to do the heavy lifting) was only tested with 7 and 10, 10.1, 10.2, 10.4 and 11.
Settings are stored in AppData, so each user with access to the same PC can have different rules set up.
What is left:
Deeper testing after first impressions (especially with more Delphi versions. There are a few which I was forced to miss)
Button / installer to change file associations to itself instead of the original BDSLauncher. This could also be used to reset these associations if a Delphi (un)installer messed these up
More options (e.g. cmd/powershell/PascalScript scripting) to decide between versions / instances
Allow manual rule ordering instead of the current alphabetical
Add icons and / or redesign UI to be a bit more user friendly...
It's kind of late now here - hence the teaser only - but I wanted to let you guys know that this is coming.
Expect a new post with an alpha version in the upcoming days.