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
This commit is contained in:
luca 2008-09-09 10:47:13 +00:00
parent 15e00a33ee
commit ca034a6c52

View File

@ -764,14 +764,46 @@ bool CampoSetup::InternetUpdateModule(const wxString& strLocalPath, const wxStri
wxString strHref = strWrk.Mid(nPos + 5, 16); wxString strHref = strWrk.Mid(nPos + 5, 16);
strHref = strHref.AfterFirst('"'); strHref = strHref.AfterFirst('"');
strHref = strHref.BeforeLast('"'); 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)) const wxString strPatch = strHref.Mid(2, 4).Lower();
break; // 1) e' un pacco
HTTPGet(strTempDir+strHref, strWebPath+strHref); //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 //chiude il file temporaneo
tfFilesList.Close(); tfFilesList.Close();
} //if(tfFilesList... } //if(tfFilesList...
@ -1296,6 +1328,7 @@ bool CampoSetup::OnInit()
wxInitAllImageHandlers(); wxInitAllImageHandlers();
m_locale.Init(); m_locale.Init();
m_pWizard = NULL; //finestra di programma nulla;deve esistere solo per il NormalSetup dove viene inizializzata
m_pMainFrame = new CampoFrame; m_pMainFrame = new CampoFrame;
SetTopWindow(m_pMainFrame); SetTopWindow(m_pMainFrame);