From 82f3ab616a8efff8c416bbbf7f7ef3cc0b975bc0 Mon Sep 17 00:00:00 2001 From: jules Date: Wed, 7 Jun 2017 10:07:02 +0100 Subject: [PATCH] Avoided duplicate entries in the default VST search path --- .../format_types/juce_VSTPluginFormat.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp index 1ddc8cec65..09fec6d2dc 100644 --- a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp @@ -2833,12 +2833,11 @@ FileSearchPath VSTPluginFormat::getDefaultLocationsToSearch() const String programFiles (File::getSpecialLocation (File::globalApplicationsDirectory).getFullPathName()); FileSearchPath paths; - paths.add (WindowsRegistry::getValue ("HKEY_LOCAL_MACHINE\\Software\\VST\\VSTPluginsPath", - programFiles + "\\Steinberg\\VstPlugins")); + paths.add (WindowsRegistry::getValue ("HKEY_LOCAL_MACHINE\\Software\\VST\\VSTPluginsPath")); + paths.addIfNotAlreadyThere (programFiles + "\\Steinberg\\VstPlugins"); paths.removeNonExistentPaths(); - - paths.add (WindowsRegistry::getValue ("HKEY_LOCAL_MACHINE\\Software\\VST\\VSTPluginsPath", - programFiles + "\\VstPlugins")); + paths.addIfNotAlreadyThere (programFiles + "\\VstPlugins"); + paths.removeRedundantPaths(); return paths; #elif JUCE_IOS // on iOS you can only load plug-ins inside the hosts bundle folder