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..
|
||||
//..primo livello (quindi e' un file di programma)
|
||||
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
|
||||
const bool bIsSubDir = strSourceFile.Find('/', true) > (int)nPathLenght;
|
||||
|
||||
@ -1078,6 +1079,10 @@ void CampoSetup::NormalSetup()
|
||||
//aggiorna la progind
|
||||
if (!pi.Update((int)i, asFilesList[i]))
|
||||
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
|
||||
//se un file non si copia interrompe l'installazione con un ErrorBox
|
||||
if (!CopyFilesAndDirs(asFilesList[i], strFileCurr, true))
|
||||
@ -1429,22 +1434,35 @@ void CampoSetup::OnTimer(wxTimerEvent& WXUNUSED(e))
|
||||
//..fanno perdere questo path
|
||||
//attenzione!!! il path DEVE terminare con "\" sennò in base al tipo di chiamata (-uw,-uc,-ud) i rispettivi..
|
||||
//..metodi funzionano a casaccio!!!
|
||||
m_strSetupPath = wxGetCwd();
|
||||
m_strSetupPath.MakeLower();
|
||||
if (!m_strSetupPath.EndsWith("setup"))
|
||||
{
|
||||
m_strSetupPath << "\\setup";
|
||||
wxSetWorkingDirectory(m_strSetupPath);
|
||||
}
|
||||
const wxString strCommand = argv[1];
|
||||
|
||||
if (!m_strSetupPath.EndsWith(wxT("\\")))
|
||||
m_strSetupPath << '\\';
|
||||
|
||||
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.MakeLower();
|
||||
if (!m_strSetupPath.EndsWith("setup"))
|
||||
{
|
||||
m_strSetupPath << "\\setup";
|
||||
wxSetWorkingDirectory(m_strSetupPath);
|
||||
}
|
||||
if (!m_strSetupPath.EndsWith(wxT("\\")))
|
||||
m_strSetupPath << '\\';
|
||||
|
||||
//aggiornamento da disco,client,web
|
||||
if (strCommand == "-ud")
|
||||
DiskUpdate();
|
||||
if (strCommand == "-uc")
|
||||
|
@ -434,6 +434,14 @@ bool CopiaFile(const wxString& strFileSrc, const wxString& strFileDest)
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
||||
void NormalizeSlash(wxString& strFileName)
|
||||
{
|
||||
strFileName.Replace("\\", "/"); // Trasforma i backslash in slash
|
||||
strFileName.Replace("//", "/"); // Elimina i doppi slash
|
||||
}
|
||||
|
||||
|
||||
//metodi per unzippare i files
|
||||
//-------------------------------------------------------------------------------
|
||||
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);
|
||||
bool UnzipFile(const char* strZipFile, const char* strDestdir);
|
||||
bool CopiaFile(const wxString& file1, const wxString& file2);
|
||||
void NormalizeSlash(wxString& strFileName);
|
||||
|
||||
//interfaccia con windows
|
||||
wxString GetWindowsProgramDirectory();
|
||||
|
@ -357,15 +357,49 @@ bool CampoWizardPage3::ForwardValidate()
|
||||
return ErrorBox(strMsg);
|
||||
}
|
||||
|
||||
const wxString strStudy = CampoIni.Get("Study");
|
||||
CampoIniFile CampoServerIni(strPrgPath + "/campo.ini", "Server");
|
||||
strSrvAuth = CampoServerIni.Get("Dongle");
|
||||
strSrvDict = CampoServerIni.Get("Dictionary");
|
||||
wxString strStudy = CampoIni.Get("Study");
|
||||
{
|
||||
CampoIniFile CampoServerIni(strPrgPath + "/campo.ini", "Server");
|
||||
strSrvAuth = CampoServerIni.Get("Dongle");
|
||||
strSrvDict = CampoServerIni.Get("Dictionary");
|
||||
}
|
||||
|
||||
//controlla l'area dati e le eventuali custom directory
|
||||
//area dati
|
||||
if (!CheckDataDir(strStudy))
|
||||
//controlla l'area dati e le eventuali custom directory area dati
|
||||
bool bDataOk = false;
|
||||
|
||||
//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");
|
||||
|
||||
//custom directories
|
||||
wxArrayString asPersonalizedFiles;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user