File::currentExecutableFile in plugin, did something change?

For the longest time I’ve been calling File::currentExecutableFile in my plugin’s to query the path to the dll/.so. But this no longer seems to work on Linux,. A simple test with the AudioPluginDemo(below) shows that it returns the plugin host, and not the .so

JuceDemoPluginAudioProcessor()
        : AudioProcessor (getBusesProperties()),
    state (*this, nullptr, "state",
           { std::make_unique<AudioParameterFloat> ("gain", "Gain", NormalisableRange<float> (0.0f, 1.0f), 0.9f),
             std::make_unique<AudioParameterFloat> ("delay", "Delay Feedback", NormalisableRange<float> (0.0f, 1.0f), 0.5f) })
    {
        lastPosInfo.resetToDefault();
        String currentLibrary = File::getSpecialLocation(File::currentExecutableFile).getFullPathName();
        // Add a sub-tree to store the state of our UI
        state.state.addChild ({ "uiState", { { "width",  400 }, { "height", 200 } }, {} }, -1, nullptr);

        initialiseSynth();
    }

The fact that it doesn’t return the plugin path means many of my plugins will not run correctly on Linux, although I’ve had no reports thus far. So either it’s something on my end, or I’ve grossly overestimated the amount of people using my software :rofl:

I’d very much appreciate if someone might try it and let me know if they have the same issue, or if I’ve just been lucky up till now, and this is actually expect behaviour. FWIW, I’m using 18.04.

So it seems this only fails when one has enabled the Standalone plugin option. So it looks like I have to figure out how to get CLion to run the correct target, weird as it still runs the plugin library. Apologies for the noise.

1 Like