Patch level :10.0 226
Files correlati : Ricompilazione Demo : [ ] Commento :sistemati problemi dovuti ad aggiornamento server remoto (segnalato da roberto sul campo di battaglia) git-svn-id: svn://10.65.10.50/trunk@18202 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
61b17be06f
commit
2b9d09d170
@ -1025,7 +1025,8 @@ void CampoSetup::NormalSetup()
|
|||||||
//controlla se il file corrente e' dentro una sottodirectory (tipo dati,servers,setup...) oppure e' al..
|
//controlla se il file corrente e' dentro una sottodirectory (tipo dati,servers,setup...) oppure e' al..
|
||||||
//..primo livello (quindi e' un file di programma)
|
//..primo livello (quindi e' un file di programma)
|
||||||
wxString strSourceFile = asFilesList[i].Lower();
|
wxString strSourceFile = asFilesList[i].Lower();
|
||||||
strSourceFile.Replace("\\", "/");
|
NormalizeSlash(strSourceFile);
|
||||||
|
|
||||||
//e' in una subdir se la lunghezza del suo path prima dell'ultimo '/' e' > della lunghezza del path di root
|
//e' in una subdir se la lunghezza del suo path prima dell'ultimo '/' e' > della lunghezza del path di root
|
||||||
const bool bIsSubDir = strSourceFile.Find('/', true) > (int)nPathLenght;
|
const bool bIsSubDir = strSourceFile.Find('/', true) > (int)nPathLenght;
|
||||||
|
|
||||||
@ -1078,6 +1079,10 @@ void CampoSetup::NormalSetup()
|
|||||||
//aggiorna la progind
|
//aggiorna la progind
|
||||||
if (!pi.Update((int)i, asFilesList[i]))
|
if (!pi.Update((int)i, asFilesList[i]))
|
||||||
break;
|
break;
|
||||||
|
//normalizza per sicurezza il nome (completo di path) del file (visto che ci sono metodi cui piace..
|
||||||
|
//..aggiungere / o \ a piacere..
|
||||||
|
NormalizeSlash(strFileCurr);
|
||||||
|
|
||||||
//eventuali sottodirectory le crea (solo se hanno un nome) e poi copia fisicamente i files
|
//eventuali sottodirectory le crea (solo se hanno un nome) e poi copia fisicamente i files
|
||||||
//se un file non si copia interrompe l'installazione con un ErrorBox
|
//se un file non si copia interrompe l'installazione con un ErrorBox
|
||||||
if (!CopyFilesAndDirs(asFilesList[i], strFileCurr, true))
|
if (!CopyFilesAndDirs(asFilesList[i], strFileCurr, true))
|
||||||
@ -1429,6 +1434,24 @@ void CampoSetup::OnTimer(wxTimerEvent& WXUNUSED(e))
|
|||||||
//..fanno perdere questo path
|
//..fanno perdere questo path
|
||||||
//attenzione!!! il path DEVE terminare con "\" sennò in base al tipo di chiamata (-uw,-uc,-ud) i rispettivi..
|
//attenzione!!! il path DEVE terminare con "\" sennò in base al tipo di chiamata (-uw,-uc,-ud) i rispettivi..
|
||||||
//..metodi funzionano a casaccio!!!
|
//..metodi funzionano a casaccio!!!
|
||||||
|
const wxString strCommand = argv[1];
|
||||||
|
|
||||||
|
if (strCommand.IsEmpty())
|
||||||
|
{
|
||||||
|
wxFileName strPath(argv[0]);
|
||||||
|
strPath.MakeAbsolute();
|
||||||
|
strPath.SetCwd();
|
||||||
|
m_strSetupPath = strPath.GetPath();
|
||||||
|
if (!m_strSetupPath.EndsWith(wxT("\\")))
|
||||||
|
m_strSetupPath << '\\';
|
||||||
|
|
||||||
|
//installazione normale da CD
|
||||||
|
NormalSetup();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//attenzione: modifica richiesta perchè la cartella di esecuzione di setup è diversa nel caso sia un..
|
||||||
|
//..aggiornamento o una installazione da CD
|
||||||
m_strSetupPath = wxGetCwd();
|
m_strSetupPath = wxGetCwd();
|
||||||
m_strSetupPath.MakeLower();
|
m_strSetupPath.MakeLower();
|
||||||
if (!m_strSetupPath.EndsWith("setup"))
|
if (!m_strSetupPath.EndsWith("setup"))
|
||||||
@ -1436,15 +1459,10 @@ void CampoSetup::OnTimer(wxTimerEvent& WXUNUSED(e))
|
|||||||
m_strSetupPath << "\\setup";
|
m_strSetupPath << "\\setup";
|
||||||
wxSetWorkingDirectory(m_strSetupPath);
|
wxSetWorkingDirectory(m_strSetupPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_strSetupPath.EndsWith(wxT("\\")))
|
if (!m_strSetupPath.EndsWith(wxT("\\")))
|
||||||
m_strSetupPath << '\\';
|
m_strSetupPath << '\\';
|
||||||
|
|
||||||
wxString strCommand = argv[1];
|
//aggiornamento da disco,client,web
|
||||||
if (strCommand.IsEmpty())
|
|
||||||
NormalSetup();
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (strCommand == "-ud")
|
if (strCommand == "-ud")
|
||||||
DiskUpdate();
|
DiskUpdate();
|
||||||
if (strCommand == "-uc")
|
if (strCommand == "-uc")
|
||||||
|
@ -434,6 +434,14 @@ bool CopiaFile(const wxString& strFileSrc, const wxString& strFileDest)
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void NormalizeSlash(wxString& strFileName)
|
||||||
|
{
|
||||||
|
strFileName.Replace("\\", "/"); // Trasforma i backslash in slash
|
||||||
|
strFileName.Replace("//", "/"); // Elimina i doppi slash
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//metodi per unzippare i files
|
//metodi per unzippare i files
|
||||||
//-------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------
|
||||||
static size_t GetZipList(const char* strZipFile, wxArrayString& aFiles)
|
static size_t GetZipList(const char* strZipFile, wxArrayString& aFiles)
|
||||||
|
@ -46,6 +46,7 @@ bool YesNoBox(const wxString str);
|
|||||||
void CheckAndMakeDir(const wxString& strDir, const wxString& strMsg);
|
void CheckAndMakeDir(const wxString& strDir, const wxString& strMsg);
|
||||||
bool UnzipFile(const char* strZipFile, const char* strDestdir);
|
bool UnzipFile(const char* strZipFile, const char* strDestdir);
|
||||||
bool CopiaFile(const wxString& file1, const wxString& file2);
|
bool CopiaFile(const wxString& file1, const wxString& file2);
|
||||||
|
void NormalizeSlash(wxString& strFileName);
|
||||||
|
|
||||||
//interfaccia con windows
|
//interfaccia con windows
|
||||||
wxString GetWindowsProgramDirectory();
|
wxString GetWindowsProgramDirectory();
|
||||||
|
@ -357,15 +357,49 @@ bool CampoWizardPage3::ForwardValidate()
|
|||||||
return ErrorBox(strMsg);
|
return ErrorBox(strMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
const wxString strStudy = CampoIni.Get("Study");
|
wxString strStudy = CampoIni.Get("Study");
|
||||||
|
{
|
||||||
CampoIniFile CampoServerIni(strPrgPath + "/campo.ini", "Server");
|
CampoIniFile CampoServerIni(strPrgPath + "/campo.ini", "Server");
|
||||||
strSrvAuth = CampoServerIni.Get("Dongle");
|
strSrvAuth = CampoServerIni.Get("Dongle");
|
||||||
strSrvDict = CampoServerIni.Get("Dictionary");
|
strSrvDict = CampoServerIni.Get("Dictionary");
|
||||||
|
}
|
||||||
|
|
||||||
//controlla l'area dati e le eventuali custom directory
|
//controlla l'area dati e le eventuali custom directory area dati
|
||||||
//area dati
|
bool bDataOk = false;
|
||||||
if (!CheckDataDir(strStudy))
|
|
||||||
|
//controlla anche se l'installazione è in remoto con dati in locale (errore! è il caso in cui si abbia un..
|
||||||
|
//..server remoto con il campo.ini scazzato che indica una dir locale del server!!
|
||||||
|
const int nDriveType = ::GetDriveType(strPrgPath.Left(3));
|
||||||
|
const bool bRemoteDestination = nDriveType == DRIVE_REMOTE;
|
||||||
|
if (bRemoteDestination)
|
||||||
|
{
|
||||||
|
const bool bRemoteStudy = ::GetDriveType(strStudy.Left(3)) == DRIVE_REMOTE;
|
||||||
|
if (!bRemoteStudy)
|
||||||
|
strStudy[0] = strPrgPath[0];
|
||||||
|
bDataOk = CheckDataDir(strStudy);
|
||||||
|
//se anche cambiando il drive (lo mette = a quello dei programmi perchè statisticamente è ok) la directory..
|
||||||
|
//..contenente i dati è farlocca, lo chiede all'utonto
|
||||||
|
if (!bDataOk)
|
||||||
|
{
|
||||||
|
wxDirDialog dirD(this, "Selezionare la cartella contenente i dati", strStudy, wxDD_DEFAULT_STYLE|wxDD_DIR_MUST_EXIST);
|
||||||
|
if (dirD.ShowModal() == wxID_OK)
|
||||||
|
{
|
||||||
|
strStudy = dirD.GetPath();
|
||||||
|
bDataOk = CheckDataDir(strStudy);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//se riesce a trovare la corretta directory dei dati la setta nel campo.ini onde non ripetere tutto 'sto casino..
|
||||||
|
//..ogni volta che deve accedervi
|
||||||
|
if (bDataOk)
|
||||||
|
CampoIni.Set("Study", strStudy);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
bDataOk = CheckDataDir(strStudy);
|
||||||
|
|
||||||
|
//se la directory dei dati è definitivamente farlocca (o l'utonto mente spudoratamente) allora errore!
|
||||||
|
if (!bDataOk)
|
||||||
return ErrorBox("La cartella indicata come area dati NON e' valida!\nInterrompere l'installazione e selezionare un'area dati valida\ncon il programma");
|
return ErrorBox("La cartella indicata come area dati NON e' valida!\nInterrompere l'installazione e selezionare un'area dati valida\ncon il programma");
|
||||||
|
|
||||||
//custom directories
|
//custom directories
|
||||||
wxArrayString asPersonalizedFiles;
|
wxArrayString asPersonalizedFiles;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user