Finding the location of my plugin at runtime

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

Is it possible for a VST to find out about its location at runtime? If possible I'd like to do this without being dependent on an installer that writes the location to a central location like the registry which is then queried. In other words: the plugin should be installable by simply unzipping an archive to the VST folder. At runtime it would then find out its own location and use that information to locate other data it needs.

I'd like to use something like the following layout:

Code: Select all

VSTs/
  |--- MyPlug/
  |       |--- SomeData1.bin
  |       |--- SomeData2.bin
  |       |--- ...
  |--- MyPlug.dll
I'm using WDL-OL if that helps.
Passed 303 posts. Next stop: 808.

Post

Maybe try GetModuleHandle()?

Post

~stratum~

Post

There's some various methods here:
https://bitbucket.org/Mayae/cpl/src/986 ... ew-default

Look for the function GetDirectoryPath(). The implementation cuts of the executable name which may or may not be what you need. Also on OS X the returned path is to the executable, that is in as subdirectory of the bundle.

Post

Thanks for your input everyone!

I have searched the WDL-OL code for references to the funtions mentioned above and have found the method IGraphics::PluginPath which returns just what I need. The windows implementation of that interface uses the function GetModuleFileName to accomplish its task by the way.
Passed 303 posts. Next stop: 808.

Post Reply

Return to “DSP and Plugin Development”