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" #include "DistrhoPluginInternal.hpp"


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


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


initSignalHandler(); initSignalHandler();


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




Loading…
Cancel
Save