diff --git a/include/strings.cpp b/include/strings.cpp index 47d63729f..f3a23130d 100755 --- a/include/strings.cpp +++ b/include/strings.cpp @@ -1229,10 +1229,22 @@ const TFilename& TFilename::tempdir() _tempdir = getenv("TEMP"); if (_tempdir.empty()) _tempdir = getenv("TMP"); +#ifdef WIN32 if (_tempdir.empty()) - _tempdir << SLASH << "temp"; + { + _tempdir = __argv[0]; + _tempdir.cut(3); + _tempdir << "temp"; + } if (!_tempdir.exist()) - _tempdir.format("%c%s", SLASH, "tmp"); + { + _tempdir = __argv[0]; + _tempdir.cut(3); + _tempdir << "tmp"; + } +#else + _tempdir = "/tmp"; +#endif const int last = len()-1; if (!is_not_slash(_str[last])) diff --git a/xvaga/agasys.cpp b/xvaga/agasys.cpp index 764841636..c060031b7 100755 --- a/xvaga/agasys.cpp +++ b/xvaga/agasys.cpp @@ -42,7 +42,14 @@ static void aga_create_dir(wxString strPath) { const wxString strDir = strPath.Mid(0,i); if (!::wxDirExists(strDir)) - ::wxMkdir(strDir); + { + if (!::wxMkdir(strDir)) + { + wxString strMsg = "Impossibile creare la cartella "; + strMsg << strDir << " !!"; + wxMessageBox(strMsg, "Attenzione!", wxICON_ERROR); + } + } } } @@ -67,8 +74,7 @@ bool aga_unzip(const char* zipfile, const char* destdir) if (!wxEndsWithPathSeparator(strOutDir)) strOutDir += wxFILE_SEP_PATH; strOutDir += strFileName; - if (!::wxDirExists(strOutDir)) - ::wxMkdir(strOutDir); + aga_create_dir(strOutDir); } else {