TheWaveWarden / odin2

Odin 2 Synthesizer Plugin
GNU General Public License v3.0
562 stars 52 forks source link

[Feature Request] Enable portable installation (Windows) #384

Open m-camilleri opened 3 years ago

m-camilleri commented 3 years ago

The Odin2 installer and hardwired presets directory does not permit installation to a portable medium. For this to be possible, a portable installation should require no more than simply copying the VST3 and conf file and the Soundbanks folder into the desired destination directory, and the VST should look for the factory presets and user patches first in the same directory as the vst3 file.

hdkw commented 8 months ago

Agree, that would be great.

jjYBdx4IL commented 6 months ago

I think that's also required for installation via owlplug

jjYBdx4IL commented 6 months ago

That's how I solved it (works for me [tm]). Because the factory presets are embedded in the DLL anyway, I simply switched the Soundbanks folder to the user's documents directory + Odin2. I hope that works for other platforms, too. I'd submit a patch if we agree on that solution.

diff --git a/Source/gui/PatchBrowser.cpp b/Source/gui/PatchBrowser.cpp
index 3ab8d00a..7cef5ed7 100644
--- a/Source/gui/PatchBrowser.cpp
+++ b/Source/gui/PatchBrowser.cpp
@@ -642,6 +642,7 @@ PatchBrowser::PatchBrowser(OdinAudioProcessor &p_processor, AudioProcessorValueT
            "Soundbank folder\n" + DEFAULT_SOUNDBANK_LOCATION_STRING +
                "\n\nnot found! Please create this folder or reinstall the plugin");

+       File(DEFAULT_SOUNDBANK_LOCATION_STRING).createDirectory();^M
 }

 PatchBrowser::~PatchBrowser() {
diff --git a/Source/gui/PatchBrowser.h b/Source/gui/PatchBrowser.h
index 05dfaee6..3662abc3 100644
--- a/Source/gui/PatchBrowser.h
+++ b/Source/gui/PatchBrowser.h
@@ -19,7 +19,8 @@
 #include "PatchBrowserSelector.h"
 #include "../PluginProcessor.h"

-#define DEFAULT_SOUNDBANK_LOCATION_STRING (ODIN_STORAGE_PATH + File::getSeparatorString() + "Soundbanks")
+#define DEFAULT_SOUNDBANK_LOCATION_STRING                                                                              \^M
+       (File::getSpecialLocation(File::userDocumentsDirectory).getFullPathName() + File::getSeparatorString() + "Odin2")^M

 class PatchBrowser    : public Component
 {