Patch level :10.0 cd
Files correlati : Ricompilazione Demo : [ ] Commento :copia anche la cartella it sotto setup; usata la CheckAndMakeDir al posto della wxMkDir che fa cagare; messi i permessi 0777 alle subdirectory che si creano (win2003 srv) git-svn-id: svn://10.65.10.50/trunk@17942 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									e0da9f5ae6
								
							
						
					
					
						commit
						0ae007dffe
					
				| @ -514,13 +514,12 @@ bool CampoSetup::CopyFilesAndDirs(const wxString& FilesListI, wxString strFileCu | |||||||
| { | { | ||||||
|   bool ok = true; |   bool ok = true; | ||||||
| 
 | 
 | ||||||
|   strFileCurr.MakeLower();  //minuscolizzazione di sicurezza
 |  | ||||||
|   const wxFileName strFileName(strFileCurr); |  | ||||||
| 
 |  | ||||||
|   //i files .ini vanno trattati con i guanti (se esistono gia' non vanno copiati!!!)
 |   //i files .ini vanno trattati con i guanti (se esistono gia' non vanno copiati!!!)
 | ||||||
|   //parte da eseguire solo in caso sia indicata la trattazione degli ini (bIni true)
 |   //parte da eseguire solo in caso sia indicata la trattazione degli ini (bIni true)
 | ||||||
|   if (bIni) |   if (bIni) | ||||||
|   { |   { | ||||||
|  |     strFileCurr.MakeLower();  //minuscolizzazione di sicurezza
 | ||||||
|  |     const wxFileName strFileName(strFileCurr); | ||||||
|     if (strFileName.GetExt() == "ini") |     if (strFileName.GetExt() == "ini") | ||||||
|     { |     { | ||||||
|       const wxString strName = strFileName.GetName(); |       const wxString strName = strFileName.GetName(); | ||||||
| @ -531,14 +530,8 @@ bool CampoSetup::CopyFilesAndDirs(const wxString& FilesListI, wxString strFileCu | |||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   if (ok) |   if (ok) | ||||||
|   { |  | ||||||
|     //eventuali sottodirectory le crea (solo se hanno un nome)
 |  | ||||||
|     const wxString strDir = strFileName.GetPath(); |  | ||||||
|     if (!strDir.IsEmpty() && !wxDirExists(strDir)) |  | ||||||
|       wxMkdir(strDir); |  | ||||||
| 
 |  | ||||||
|     ok = CopiaFile(FilesListI, strFileCurr); |     ok = CopiaFile(FilesListI, strFileCurr); | ||||||
|   } | 
 | ||||||
|   return ok; |   return ok; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| @ -547,10 +540,8 @@ void CampoSetup::CopyDir(const wxString& strSourceDir, const wxString& strDestDi | |||||||
| { | { | ||||||
|   if (wxDir::Exists(strSourceDir)) |   if (wxDir::Exists(strSourceDir)) | ||||||
|   { |   { | ||||||
|     if (!wxDir::Exists(strDestDir)) |  | ||||||
|       wxMkdir(strDestDir); |  | ||||||
|     wxArrayString asFilesList; |     wxArrayString asFilesList; | ||||||
|     const size_t uFilesToCopy = wxDir::GetAllFiles(strSourceDir, &asFilesList, "*.*", wxDIR_FILES); |     const size_t uFilesToCopy = wxDir::GetAllFiles(strSourceDir, &asFilesList, "*.*"); | ||||||
|     const size_t uFrom = strSourceDir.Len(); |     const size_t uFrom = strSourceDir.Len(); | ||||||
|     for (size_t i = 0; i < uFilesToCopy; i++) |     for (size_t i = 0; i < uFilesToCopy; i++) | ||||||
|     { |     { | ||||||
| @ -746,7 +737,7 @@ bool CampoSetup::InternetUpdateModule(const wxString& strLocalPath, const wxStri | |||||||
|     EmptyOutDir(strTempDir);    //deve svuotare la directory dai files per poterla eliminare!!!
 |     EmptyOutDir(strTempDir);    //deve svuotare la directory dai files per poterla eliminare!!!
 | ||||||
|     ::wxRmdir(strTempDir);  //elimina la dir adesso vuota
 |     ::wxRmdir(strTempDir);  //elimina la dir adesso vuota
 | ||||||
|   } |   } | ||||||
|   ::wxMkDir(strTempDir);    //la ricrea con i permessi dell'utente windows corrente!!
 |   CheckAndMakeDir(strTempDir, wxEmptyString);   //la ricrea con i permessi dell'utente windows corrente!!
 | ||||||
| 
 | 
 | ||||||
|   const wxString strTempFile = strTempDir + "httpdir.txt"; |   const wxString strTempFile = strTempDir + "httpdir.txt"; | ||||||
|   if (HTTPGet(strTempFile, strWebPath)) |   if (HTTPGet(strTempFile, strWebPath)) | ||||||
|  | |||||||
| @ -380,7 +380,7 @@ void CheckAndMakeDir(const wxString& strDir, const wxString& strMsg) | |||||||
|     { |     { | ||||||
|       strCartella += "\\"; |       strCartella += "\\"; | ||||||
|       strCartella += asDirs[i]; |       strCartella += asDirs[i]; | ||||||
|       if (!wxDir::Exists(strCartella) && !wxMkdir(strCartella)) |       if (!wxDir::Exists(strCartella) && !wxMkdir(strCartella, 0777)) | ||||||
|       {   |       {   | ||||||
|         wxString strError = "Impossibile creare la cartella "; |         wxString strError = "Impossibile creare la cartella "; | ||||||
|         strError += strMsg; |         strError += strMsg; | ||||||
| @ -405,6 +405,11 @@ void CheckAndMakeDir(const wxString& strDir, const wxString& strMsg) | |||||||
| 
 | 
 | ||||||
| bool CopiaFile(const wxString& strFileSrc, const wxString& strFileDest) | bool CopiaFile(const wxString& strFileSrc, const wxString& strFileDest) | ||||||
| { | { | ||||||
|  |   //serve per ritrovare eventuali sottodirectory
 | ||||||
|  |   wxFileName fnFileDest(strFileDest); | ||||||
|  |   if (!fnFileDest.DirExists()) | ||||||
|  |     fnFileDest.Mkdir(0777, wxPATH_MKDIR_FULL); | ||||||
|  | 
 | ||||||
|   bool ok =  ::wxCopyFile(strFileSrc, strFileDest); |   bool ok =  ::wxCopyFile(strFileSrc, strFileDest); | ||||||
|   if(ok) |   if(ok) | ||||||
|   { |   { | ||||||
| @ -465,8 +470,7 @@ bool UnzipFile(const char* strZipFile, const char* strDestDir) | |||||||
|       if (!wxEndsWithPathSeparator(strOutDir)) |       if (!wxEndsWithPathSeparator(strOutDir)) | ||||||
| 		    strOutDir += wxFILE_SEP_PATH; | 		    strOutDir += wxFILE_SEP_PATH; | ||||||
| 		  strOutDir += strFileName; | 		  strOutDir += strFileName; | ||||||
| 		  if (!::wxDirExists(strOutDir)) |       CheckAndMakeDir(strOutDir, wxEmptyString); | ||||||
| 			  ::wxMkdir(strOutDir); |  | ||||||
|     } |     } | ||||||
|     else |     else | ||||||
|     { |     { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user