From ca034a6c52d12a8679c04a47eadbc823259a2b6e Mon Sep 17 00:00:00 2001 From: luca Date: Tue, 9 Sep 2008 10:47:13 +0000 Subject: [PATCH] Patch level : Files correlati : Ricompilazione Demo : [ ] Commento :sistemato problema della presenza del solo pacco di aggiornamento! git-svn-id: svn://10.65.10.50/trunk@17191 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- setup/Setup.cpp | 47 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 7 deletions(-) diff --git a/setup/Setup.cpp b/setup/Setup.cpp index d128599fa..567439adc 100755 --- a/setup/Setup.cpp +++ b/setup/Setup.cpp @@ -764,14 +764,46 @@ bool CampoSetup::InternetUpdateModule(const wxString& strLocalPath, const wxStri wxString strHref = strWrk.Mid(nPos + 5, 16); strHref = strHref.AfterFirst('"'); strHref = strHref.BeforeLast('"'); - if ( strHref.StartsWith(strModule) && ((atoi(strHref.Mid(2)) > nLocPatch) || (nLocPatch == 0))) + + if (!pi.Update((int)tfFilesList.GetCurrentLine(), strHref)) + break; + + //lavora solo con i files del modulo in questione + if (strHref.StartsWith(strModule)) { - if (!pi.Update((int)tfFilesList.GetCurrentLine(), strHref)) - break; - HTTPGet(strTempDir+strHref, strWebPath+strHref); - } - } - } + const wxString strPatch = strHref.Mid(2, 4).Lower(); + // 1) e' un pacco + //se e' un pacco devo sapere se e' piu' recente della installazione corrente (potrebbe essere un pacco nuovo.. + //..ricompattato) oppure se e' piu' vecchio e non va toccato (e' ad esempio il pacco originale) + if (strPatch == "inst") + { + if (strHref.EndsWith("ini")) //operazioni sull'ini x sapere versione e patch + { + HTTPGet(strTempDir+strHref, strWebPath+strHref); + CampoIniFile iniInst(strTempDir+strHref, strModule); + const int nRemoteVer = iniInst.GetInt("Versione"); + const int nRemotePatch = iniInst.GetInt("Patch"); + + //se deve aggiornarsi con il pacco scarica pure lo zip cosi' e' a posto + if ((nRemoteVer > nLocVer) || ((nRemoteVer == nLocVer) && (nRemotePatch > nLocPatch))) + { + const int nDot = strHref.Find('.', true); + strHref = strHref.Left(nDot) + "1.zip"; + HTTPGet(strTempDir+strHref, strWebPath+strHref); + } + else //se non deve aggiornarsi elimina l'ini in modo da non avere una mezza patch che farebbe incazzare l'unzipper + wxRemoveFile(strTempDir+strHref); + } //if(strHref.EndsWith("ini")... + } //if(strPatch == "inst")... + // 2) e' una patch + else //se invece e' una normale patch... + { + if (atoi(strPatch) > nLocPatch) + HTTPGet(strTempDir+strHref, strWebPath+strHref); + } + } //if(strHref.StartsWith(strModule))... + } //if(nPos>0)... + } //for(wxString strWrk = tf... //chiude il file temporaneo tfFilesList.Close(); } //if(tfFilesList... @@ -1296,6 +1328,7 @@ bool CampoSetup::OnInit() wxInitAllImageHandlers(); m_locale.Init(); + m_pWizard = NULL; //finestra di programma nulla;deve esistere solo per il NormalSetup dove viene inizializzata m_pMainFrame = new CampoFrame; SetTopWindow(m_pMainFrame);