Patch level :
Files correlati : Ricompilazione Demo : [ ] Commento : git-svn-id: svn://10.65.10.50/trunk@17035 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
de194a2350
commit
c6b4b0bc78
132
setup/Setup.cpp
132
setup/Setup.cpp
@ -472,30 +472,34 @@ bool CampoSetup::UnzipModule(const wxString& strPrgLocPath, const wxString& strS
|
|||||||
|
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
wxArrayString asFilesList;
|
wxArrayString asFilesList;
|
||||||
|
size_t uFilesToCopy;
|
||||||
//..contando anche quanti sono e memorizzandoli in un array asFileList
|
//..contando anche quanti sono e memorizzandoli in un array asFileList
|
||||||
const size_t uFilesToCopy = wxDir::GetAllFiles(strSrc, &asFilesList, strModule+"*.zip");
|
if(wxDir::Exists(strSrc))
|
||||||
if (uFilesToCopy > 0)
|
|
||||||
{
|
{
|
||||||
//ordina le patch per numero crescente ma mette davanti a tutte il pacco (sysinst1)
|
uFilesToCopy = wxDir::GetAllFiles(strSrc, &asFilesList, strModule+"*.zip");
|
||||||
asFilesList.Sort(PatchCompare);
|
if (uFilesToCopy > 0)
|
||||||
for (size_t i = 0; i < uFilesToCopy; i++)
|
{
|
||||||
{
|
//ordina le patch per numero crescente ma mette davanti a tutte il pacco (sysinst1)
|
||||||
UnzipFile(asFilesList[i] , strPrgLocPath);
|
asFilesList.Sort(PatchCompare);
|
||||||
|
for (size_t i = 0; i < uFilesToCopy; i++)
|
||||||
|
{
|
||||||
|
UnzipFile(asFilesList[i] , strPrgLocPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
//aggiorna l'install.ini in base al numero di patch e versione dell'ultimo file zip di sistema
|
||||||
|
//ci vuole un giro allucinogeno per trasformare il .zip in .ini e togliere quel cazzo di 1 in fondo
|
||||||
|
wxFileName strLastFile(asFilesList[uFilesToCopy - 1]); //zip con path completo
|
||||||
|
wxString strWrk = strLastFile.GetName();
|
||||||
|
strWrk.Truncate(strWrk.Len() - 1);
|
||||||
|
strLastFile.SetName(strWrk);
|
||||||
|
strLastFile.SetExt("ini");
|
||||||
|
strWrk = strLastFile.GetFullPath();
|
||||||
|
|
||||||
|
//adesso che ha trovato quello sporco ultimo .ini prende versione e patch e le copia nell'install.ini..
|
||||||
|
//..nella dir dei programmi; lo fa paragrafo x paragrafo ([sy],[sy1]..)
|
||||||
|
//potrebbe sembrare assurdo un for, ma e' per futuri sottomoduli con numero > 1
|
||||||
|
UpdateInstallIni(strWrk, strPrgLocPath + "/install.ini", strModule);
|
||||||
}
|
}
|
||||||
|
|
||||||
//aggiorna l'install.ini in base al numero di patch e versione dell'ultimo file zip di sistema
|
|
||||||
//ci vuole un giro allucinogeno per trasformare il .zip in .ini e togliere quel cazzo di 1 in fondo
|
|
||||||
wxFileName strLastFile(asFilesList[uFilesToCopy - 1]); //zip con path completo
|
|
||||||
wxString strWrk = strLastFile.GetName();
|
|
||||||
strWrk.Truncate(strWrk.Len() - 1);
|
|
||||||
strLastFile.SetName(strWrk);
|
|
||||||
strLastFile.SetExt("ini");
|
|
||||||
strWrk = strLastFile.GetFullPath();
|
|
||||||
|
|
||||||
//adesso che ha trovato quello sporco ultimo .ini prende versione e patch e le copia nell'install.ini..
|
|
||||||
//..nella dir dei programmi; lo fa paragrafo x paragrafo ([sy],[sy1]..)
|
|
||||||
//potrebbe sembrare assurdo un for, ma e' per futuri sottomoduli con numero > 1
|
|
||||||
UpdateInstallIni(strWrk, strPrgLocPath + "/install.ini", strModule);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Adesso puo' far ripartire il server di chiavi
|
//Adesso puo' far ripartire il server di chiavi
|
||||||
@ -540,15 +544,18 @@ bool CampoSetup::CopyFilesAndDirs(const wxString& FilesListI, wxString strFileCu
|
|||||||
//metodo per copiare una directory e tutti i files che contiene
|
//metodo per copiare una directory e tutti i files che contiene
|
||||||
void CampoSetup::CopyDir(const wxString& strSourceDir, const wxString& strDestDir) const
|
void CampoSetup::CopyDir(const wxString& strSourceDir, const wxString& strDestDir) const
|
||||||
{
|
{
|
||||||
if (!wxDir::Exists(strDestDir))
|
if (wxDir::Exists(strSourceDir))
|
||||||
wxMkdir(strDestDir);
|
|
||||||
wxArrayString asFilesList;
|
|
||||||
const size_t uFilesToCopy = wxDir::GetAllFiles(strSourceDir, &asFilesList, "*.*", wxDIR_FILES);
|
|
||||||
const size_t uFrom = strSourceDir.Len();
|
|
||||||
for (size_t i = 0; i < uFilesToCopy; i++)
|
|
||||||
{
|
{
|
||||||
wxString strFileDest = strDestDir + asFilesList[i].Mid(uFrom);
|
if (!wxDir::Exists(strDestDir))
|
||||||
CopiaFile(asFilesList[i], strFileDest);
|
wxMkdir(strDestDir);
|
||||||
|
wxArrayString asFilesList;
|
||||||
|
const size_t uFilesToCopy = wxDir::GetAllFiles(strSourceDir, &asFilesList, "*.*", wxDIR_FILES);
|
||||||
|
const size_t uFrom = strSourceDir.Len();
|
||||||
|
for (size_t i = 0; i < uFilesToCopy; i++)
|
||||||
|
{
|
||||||
|
wxString strFileDest = strDestDir + asFilesList[i].Mid(uFrom);
|
||||||
|
CopiaFile(asFilesList[i], strFileDest);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -733,9 +740,12 @@ bool CampoSetup::InternetUpdateModule(const wxString& strLocalPath, const wxStri
|
|||||||
//Svuota,elimina e ricrea una directory temporanea di appoggio ove mettere i files delle patch da scompattare
|
//Svuota,elimina e ricrea una directory temporanea di appoggio ove mettere i files delle patch da scompattare
|
||||||
//E' necessaria questa operazione per non trovarsi ancora files di vecchie patch parcheggiati nella dir!
|
//E' necessaria questa operazione per non trovarsi ancora files di vecchie patch parcheggiati nella dir!
|
||||||
const wxString strTempDir = wxFileName::GetTempDir() + "/setup/";
|
const wxString strTempDir = wxFileName::GetTempDir() + "/setup/";
|
||||||
EmptyOutDir(strTempDir); //deve svuotare la directory dai files per poterla eliminare!!!
|
if (wxDir::Exists(strTempDir))
|
||||||
if (::wxRmdir(strTempDir)) //elimina la dir adesso vuota
|
{
|
||||||
::wxMkDir(strTempDir); //la ricrea
|
EmptyOutDir(strTempDir); //deve svuotare la directory dai files per poterla eliminare!!!
|
||||||
|
::wxRmdir(strTempDir); //elimina la dir adesso vuota
|
||||||
|
}
|
||||||
|
::wxMkDir(strTempDir); //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))
|
||||||
@ -874,39 +884,41 @@ void CampoSetup::NormalSetup()
|
|||||||
//copia della campodemo sull'hard disk in c:\campodemo
|
//copia della campodemo sull'hard disk in c:\campodemo
|
||||||
wxArrayString asDemoList;
|
wxArrayString asDemoList;
|
||||||
const wxString strSrc = GetSourceDir("campodemo");
|
const wxString strSrc = GetSourceDir("campodemo");
|
||||||
|
|
||||||
const size_t uFilesToCopy = wxDir::GetAllFiles(strSrc, &asDemoList);
|
if (wxDir::Exists(strSrc))
|
||||||
wxString strFileCurr;
|
|
||||||
const size_t nPathLenght = strSrc.Len();
|
|
||||||
CampoProgressDialog pi("Installazione Versione Demo...", (int)uFilesToCopy, m_pWizard);
|
|
||||||
for (size_t i = 0; i < uFilesToCopy; i++)
|
|
||||||
{
|
{
|
||||||
if (!pi.Update((int)i, asDemoList[i]))
|
const size_t uFilesToCopy = wxDir::GetAllFiles(strSrc, &asDemoList);
|
||||||
break;
|
wxString strFileCurr;
|
||||||
|
const size_t nPathLenght = strSrc.Len();
|
||||||
asDemoList[i].Lower();
|
CampoProgressDialog pi("Installazione Versione Demo...", (int)uFilesToCopy, m_pWizard);
|
||||||
strFileCurr = strPrgLocPath;
|
for (size_t i = 0; i < uFilesToCopy; i++)
|
||||||
strFileCurr += asDemoList[i].Mid(nPathLenght);
|
|
||||||
|
|
||||||
if (!strFileCurr.IsEmpty())
|
|
||||||
{
|
{
|
||||||
if (!CopyFilesAndDirs(asDemoList[i], strFileCurr, false))
|
if (!pi.Update((int)i, asDemoList[i]))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
asDemoList[i].Lower();
|
||||||
|
strFileCurr = strPrgLocPath;
|
||||||
|
strFileCurr += asDemoList[i].Mid(nPathLenght);
|
||||||
|
|
||||||
|
if (!strFileCurr.IsEmpty())
|
||||||
|
{
|
||||||
|
if (!CopyFilesAndDirs(asDemoList[i], strFileCurr, false))
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//icona sul desktop
|
||||||
|
const bool bDesktopShortcut = m_pWizard->GetDesktopShortcut();
|
||||||
|
if (bDesktopShortcut)
|
||||||
|
{
|
||||||
|
const wxFileName strExe("c:/campodemo", wxT("ba0.exe"));
|
||||||
|
CreateIcon(CSIDL_COMMON_DESKTOPDIRECTORY, strExe, "CampoDEMO");
|
||||||
|
}
|
||||||
|
|
||||||
|
//lanciare ba0.exe in uscita
|
||||||
|
wxSetWorkingDirectory(strPrgLocPath);
|
||||||
|
wxExecute("ba0");
|
||||||
}
|
}
|
||||||
|
|
||||||
//icona sul desktop
|
|
||||||
const bool bDesktopShortcut = m_pWizard->GetDesktopShortcut();
|
|
||||||
if (bDesktopShortcut)
|
|
||||||
{
|
|
||||||
const wxFileName strExe("c:/campodemo", wxT("ba0.exe"));
|
|
||||||
CreateIcon(CSIDL_COMMON_DESKTOPDIRECTORY, strExe, "CampoDEMO");
|
|
||||||
}
|
|
||||||
|
|
||||||
//lanciare ba0.exe in uscita
|
|
||||||
wxSetWorkingDirectory(strPrgLocPath);
|
|
||||||
wxExecute("ba0");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else //tutti i casi normali (std,server,client,aggiornamento)
|
else //tutti i casi normali (std,server,client,aggiornamento)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user