Some of the hosts have some version info in their name (such as “Live 11” or “Cubase 10.5.app”), but in general, no. All that is retrieved is the host name (and path to it). Now, you could, I suppose, use the path info to get the Properties/Get Info data via native OS functions. But I don’t see anything in Juce itself that gives you that information.
Thank you @HowardAntares and @daniel
Daniel it’s seems to be really clever !
I cannot try it right now since I discovered that I cannot build an AU or VST with Xcode 15 and its cycle error but I will try it asap.
Hello @daniel just to give you some feedback about your method.
It worked… partially.
Indeed, on MacOS when I do
const auto filePath = juce::File::getSpecialLocation(juce::File::hostApplicationPath)
const auto version = filePath.getVersion();
I get /Aplication/<HostApplication>.app/Contents/MacOS for filePath
However version is empty. And this is normal because the implementation of getVersion() expect to have a path that looks like this: /Aplication/<HostApplication>.app
I could maybe retrieve the path by myself but it would be error-prone since it will change for other OS.
Also, I saw that JUCE did this trick for the File::getSpecialLocation method
Would it be possible to get a path with the /Aplication/<HostApplication>.app format directly from JUCE in order to handle all the edge cases (macOS, Windows and other) and prevent to do a lot of #if #else palteform ?
Maybe @reuk or @dave96 could help on this ? Since I don’t know if it’s a bug or an expected behaviour
gives /Applications/Ableton Live 12 Suite.app/Contents/MacOS/Live.
So I need to do
const auto file = juce::File::getSpecialLocation(juce::File::hostApplicationPath).getParentDirectory().getParentDirectory().getParentDirectory();
const auto version = file.getVersion();
in order to get the version.
However I’m worried about few things:
Would it be the same for all DAW on macOS ?
What about on Windows ?
What do you think about creating a method to get directly the DAW version ?