Patch level :10.0 100
Files correlati : Ricompilazione Demo : [ ] Commento :intelligentito il modo di recuperare la directory temporanea quando falliscono i metodi standard (decisivo per l'installazione su win2003 terminal server quando si hanno delle subdirectory) git-svn-id: svn://10.65.10.50/trunk@17040 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
e00d63cf0b
commit
4776a7a1ff
@ -1229,10 +1229,22 @@ const TFilename& TFilename::tempdir()
|
|||||||
_tempdir = getenv("TEMP");
|
_tempdir = getenv("TEMP");
|
||||||
if (_tempdir.empty())
|
if (_tempdir.empty())
|
||||||
_tempdir = getenv("TMP");
|
_tempdir = getenv("TMP");
|
||||||
|
#ifdef WIN32
|
||||||
if (_tempdir.empty())
|
if (_tempdir.empty())
|
||||||
_tempdir << SLASH << "temp";
|
{
|
||||||
|
_tempdir = __argv[0];
|
||||||
|
_tempdir.cut(3);
|
||||||
|
_tempdir << "temp";
|
||||||
|
}
|
||||||
if (!_tempdir.exist())
|
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;
|
const int last = len()-1;
|
||||||
if (!is_not_slash(_str[last]))
|
if (!is_not_slash(_str[last]))
|
||||||
|
@ -42,7 +42,14 @@ static void aga_create_dir(wxString strPath)
|
|||||||
{
|
{
|
||||||
const wxString strDir = strPath.Mid(0,i);
|
const wxString strDir = strPath.Mid(0,i);
|
||||||
if (!::wxDirExists(strDir))
|
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))
|
if (!wxEndsWithPathSeparator(strOutDir))
|
||||||
strOutDir += wxFILE_SEP_PATH;
|
strOutDir += wxFILE_SEP_PATH;
|
||||||
strOutDir += strFileName;
|
strOutDir += strFileName;
|
||||||
if (!::wxDirExists(strOutDir))
|
aga_create_dir(strOutDir);
|
||||||
::wxMkdir(strOutDir);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user