diff --git a/config.h.cmake b/config.h.cmake index ab8b6b0b07efe03c6a5a9451f2871427b5d91f05..42b12731ec0721cc6a5062db56d34648c627593d 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -50,5 +50,6 @@ #cmakedefine HAVE_ADVANCED_IM #cmakedefine HAVE_DB_STORAGE #cmakedefine ENABLE_UPDATE_CHECK 1 +#cmakedefine ENABLE_MICROSOFT_STORE_APP #cmakedefine HAVE_GETIFADDRS diff --git a/coreapi/misc.c b/coreapi/misc.c index c4992492ac3bbeb956d99f735aa94282ab904978..21c891cad2330f64515667dd716716e3ddce49ed 100644 --- a/coreapi/misc.c +++ b/coreapi/misc.c @@ -109,6 +109,7 @@ bool_t linphone_core_is_payload_type_usable_for_bandwidth(const LinphoneCore *lc bool_t lp_spawn_command_line_sync(const char *command, char **result,int *command_ret){ #if !defined(_WIN32_WCE) && !defined(LINPHONE_WINDOWS_UNIVERSAL) +#ifndef ENABLE_MICROSOFT_STORE_APP FILE *f=popen(command,"r"); if (f!=NULL){ int err; @@ -124,6 +125,7 @@ bool_t lp_spawn_command_line_sync(const char *command, char **result,int *comman if (command_ret!=NULL) *command_ret=err; return TRUE; } +#endif // ENABLE_MICROSOFT_STORE_APP #endif /*_WIN32_WCE*/ return FALSE; } diff --git a/src/core/paths/paths-windows.cpp b/src/core/paths/paths-windows.cpp index ef3fdb1fc88c6bf8b8061346020e42e334c52fbc..e9d61f7cbc6048ec495cb319a9dcf09f7d308b0b 100644 --- a/src/core/paths/paths-windows.cpp +++ b/src/core/paths/paths-windows.cpp @@ -25,8 +25,10 @@ #pragma comment(lib, "kernel32.lib") #include "paths-windows.h" +#include "config.h" // ============================================================================= +#include <ppltasks.h> using namespace std; @@ -40,8 +42,19 @@ static bool dirExists(const std::string& dirName) { LINPHONE_BEGIN_NAMESPACE static string getPath (const GUID &id) { - string strPath; +#ifdef ENABLE_MICROSOFT_STORE_APP + //if( id ==FOLDERID_LocalAppData) + string strPath; + char * env = getenv("LOCALAPPDATA"); + if( env != NULL) { + strPath = env; + strPath = strPath.append("/linphone/"); + if (!dirExists(strPath)) CreateDirectoryA(strPath.c_str(), nullptr); + } + return strPath; +#else + string strPath; LPWSTR path; if (SHGetKnownFolderPath(id, KF_FLAG_DONT_VERIFY, 0, &path) == S_OK) { strPath = _bstr_t(path); @@ -52,6 +65,7 @@ static string getPath (const GUID &id) { strPath = strPath.append("/linphone/"); if (!dirExists(strPath)) CreateDirectoryA(strPath.c_str(), nullptr); return strPath; +#endif //ENABLE_MICROSOFT_STORE_APP }