Patch level :
Files correlati : Ricompilazione Demo : [ ] Commento : git-svn-id: svn://10.65.10.50/trunk@15572 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
6209c70740
commit
033dad68d2
@ -2131,11 +2131,75 @@ void CampoSetup::OnTimer(wxTimerEvent& WXUNUSED(e))
|
|||||||
if (bDesktopShortcut)
|
if (bDesktopShortcut)
|
||||||
CreateIcon(CSIDL_COMMON_DESKTOPDIRECTORY, strExe);
|
CreateIcon(CSIDL_COMMON_DESKTOPDIRECTORY, strExe);
|
||||||
|
|
||||||
//copia del contenuto della cartella campo nella cartella di destinazione
|
//tipo di installazione/aggiornamento
|
||||||
|
|
||||||
//solo se installa campo server
|
|
||||||
const unsigned int uInstallationType = pWizard->GetInstallationType();
|
const unsigned int uInstallationType = pWizard->GetInstallationType();
|
||||||
//se sta installando campo in postazione server e deve installare un gestore di servizi
|
|
||||||
|
//se nuova installazione deve anche creare la directory di destinazione
|
||||||
|
if (uInstallationType < 3)
|
||||||
|
{
|
||||||
|
const wxString strPrgDir = pWizard->GetPrgLocPath();
|
||||||
|
if (!wxMkdir(strPrgDir))
|
||||||
|
{
|
||||||
|
ErrorBox("Impossibile creare la cartella di installazione dei programmi!\nAssicurarsi di avere il permesso di scrittura sul disco, che vi sia spazio a sufficienza,\nche la cartella indicata non esista gia' vuota");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//copia del contenuto della cartella campo nella cartella di destinazione (installaz/aggiornam)
|
||||||
|
//per prima cosa cerca la cartella dei files sorgente...
|
||||||
|
wxArrayString asFilesList;
|
||||||
|
wxFileName strSourcePath(wxGetCwd(), "*.*");
|
||||||
|
strSourcePath.AppendDir("..");
|
||||||
|
strSourcePath.AppendDir(APPNAME);
|
||||||
|
strSourcePath.MakeAbsolute();
|
||||||
|
//..contando anche quanti sono e memorizzandoli in un array asFileList
|
||||||
|
const size_t uFilesToCopy = wxDir::GetAllFiles(strSourcePath.GetPath(), &asFilesList);
|
||||||
|
|
||||||
|
//prende la cartella di destinazione...
|
||||||
|
const wxString strDestPath = pWizard->GetPrgLocPath();
|
||||||
|
//...e copia tutti i files nella cartella di destinazione, tranne i .ini che devono essere compilati
|
||||||
|
wxString strFileCurr;
|
||||||
|
const size_t nPathLenght = strSourcePath.GetPath().Len();
|
||||||
|
for (size_t i = 0; i < uFilesToCopy; i++)
|
||||||
|
{
|
||||||
|
strFileCurr = strDestPath;
|
||||||
|
strFileCurr += asFilesList[i].Mid(nPathLenght);
|
||||||
|
strFileCurr.MakeLower();
|
||||||
|
|
||||||
|
const wxFileName strFileName(strFileCurr);
|
||||||
|
|
||||||
|
if (strFileName.GetExt() == "ini")
|
||||||
|
{
|
||||||
|
const wxString strName = strFileName.GetName();
|
||||||
|
//campo.ini e install.ini vanno lasciati stare se aggiornamento!!!
|
||||||
|
if ((strName == "campo" || strName == "install") && strFileName.FileExists())
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!wxDirExists(strFileName.GetPath()))
|
||||||
|
{
|
||||||
|
wxMkdir(strFileName.GetPath());
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!wxCopyFile(asFilesList[i], strFileCurr))
|
||||||
|
{
|
||||||
|
wxString strErr = "Impossibile copiare il file ";
|
||||||
|
strErr += asFilesList[i];
|
||||||
|
strErr += " in ";
|
||||||
|
strErr += strFileCurr;
|
||||||
|
strErr += "\nInstallazione interrotta!";
|
||||||
|
ErrorBox(strErr);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//adesso deve compilare i .ini se nuova installazione
|
||||||
|
if (uInstallationType < 3)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//solo se sta installando campo in postazione server e deve installare un gestore di servizi
|
||||||
if (uInstallationType == 1)
|
if (uInstallationType == 1)
|
||||||
{
|
{
|
||||||
const bool bInstallLurch = pWizard->GetInstUseAuth() | pWizard->GetInstUseDict();
|
const bool bInstallLurch = pWizard->GetInstUseAuth() | pWizard->GetInstUseDict();
|
||||||
@ -2146,6 +2210,7 @@ void CampoSetup::OnTimer(wxTimerEvent& WXUNUSED(e))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//terminato il tutto scrive/aggiorna/lascia stare il campo.stp
|
||||||
|
|
||||||
//questo e' un esempio di associazione automatica di estensione file
|
//questo e' un esempio di associazione automatica di estensione file
|
||||||
//if (pWizard->GetBool(bAssocExtension))
|
//if (pWizard->GetBool(bAssocExtension))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user