diff --git a/Application/src/grabber/main.cpp b/Application/src/grabber/main.cpp index d15b35d25408f777c63120e112fc559b2aa5e62f..4912995f34f89021eabeff04e42ae674b6b9cce1 100644 --- a/Application/src/grabber/main.cpp +++ b/Application/src/grabber/main.cpp @@ -372,7 +372,11 @@ int main(int argc, char** argv) _wd = _wd / "usr" / "share" / "trex"; //Debug("change directory to conda environment resource folder: '%S'", &_wd.str()); - if(chdir(_wd.c_str())) +#if defined(WIN32) + if (!SetCurrentDirectoryA(_wd.c_str())) +#else + if (chdir(_wd.c_str())) +#endif Except("Cannot change directory to '%S'", &_wd.str()); } #endif diff --git a/Application/src/grabber/pvinfo.cpp b/Application/src/grabber/pvinfo.cpp index 1d5161a184c3673197c9035a31b09220997f960b..a40fd6872cfd0fa84303482624cb8b1651dd40b2 100644 --- a/Application/src/grabber/pvinfo.cpp +++ b/Application/src/grabber/pvinfo.cpp @@ -218,7 +218,11 @@ int main(int argc, char**argv) { _wd = _wd / "usr" / "share" / "trex"; //Debug("change directory to conda environment resource folder: '%S'", &_wd.str()); - if(chdir(_wd.c_str())) +#if defined(WIN32) + if (!SetCurrentDirectoryA(_wd.c_str())) +#else + if (chdir(_wd.c_str())) +#endif Except("Cannot change directory to '%S'", &_wd.str()); } #endif