Browse Source

Find local resources dir for Windows standalones

Signed-off-by: falkTX <falktx@falktx.com>
pull/392/head
falkTX 2 years ago
parent
commit
e8405098f4
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
1 changed files with 9 additions and 4 deletions
  1. +9
    -4
      distrho/src/DistrhoPluginJACK.cpp

+ 9
- 4
distrho/src/DistrhoPluginJACK.cpp View File

@@ -16,7 +16,7 @@

#include "DistrhoPluginInternal.hpp"

#if !defined(DISTRHO_OS_WINDOWS) && !defined(STATIC_BUILD)
#ifndef STATIC_BUILD
# include "../DistrhoPluginUtils.hpp"
#endif

@@ -954,14 +954,14 @@ int main(int argc, char* argv[])

initSignalHandler();

#if !defined(DISTRHO_OS_WINDOWS) && !defined(STATIC_BUILD)
#ifndef STATIC_BUILD
// find plugin bundle
static String bundlePath;
if (bundlePath.isEmpty())
{
String tmpPath(getBinaryFilename());
tmpPath.truncate(tmpPath.rfind(DISTRHO_OS_SEP));
#ifdef DISTRHO_OS_MAC
#if defined(DISTRHO_OS_MAC)
if (tmpPath.endsWith("/MacOS"))
{
tmpPath.truncate(tmpPath.rfind('/'));
@@ -972,13 +972,18 @@ int main(int argc, char* argv[])
d_nextBundlePath = bundlePath.buffer();
}
}
#else
#ifdef DISTRHO_OS_WINDOWS
const DWORD attr = GetFileAttributesA(tmpPath + DISTRHO_OS_SEP_STR "resources");
if (attr != INVALID_FILE_ATTRIBUTES && (attr & FILE_ATTRIBUTE_DIRECTORY) != 0)
#else
if (access(tmpPath + DISTRHO_OS_SEP_STR "resources", F_OK) == 0)
#endif
{
bundlePath = tmpPath;
d_nextBundlePath = bundlePath.buffer();
}
#endif
#endif
}
#endif



Loading…
Cancel
Save