From f563d16aa12402868a5e90d0610f2e49fd53031a Mon Sep 17 00:00:00 2001 From: luca Date: Thu, 6 Sep 2007 15:46:28 +0000 Subject: [PATCH] Patch level :4.0 setup Files correlati : Ricompilazione Demo : [ ] Commento :iniziato trasferimento datidemo git-svn-id: svn://10.65.10.50/trunk@15592 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- setup/Setup.cpp | 68 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 61 insertions(+), 7 deletions(-) diff --git a/setup/Setup.cpp b/setup/Setup.cpp index 4da28b797..bd305d543 100755 --- a/setup/Setup.cpp +++ b/setup/Setup.cpp @@ -2316,6 +2316,8 @@ void CampoSetup::OnTimer(wxTimerEvent& WXUNUSED(e)) const bool bNewInstallation = uInstallationType < 3; //installazione servers? const bool bInstallLurch = uInstallationType == 1 && (pWizard->GetInstUseAuth() || pWizard->GetInstUseDict()); + //installazione datidemo? (oddio speriamo di no!; comunque vale solo per installazione standard) + const bool bInstallDemoData = uInstallationType == 0 && pWizard->GetInstDemoData(); //cartelle selezionate dall'utente const wxString& strPrgLocPath = pWizard->GetPrgLocPath(); const wxString& strDataPath = pWizard->GetDataPath(); @@ -2342,7 +2344,7 @@ void CampoSetup::OnTimer(wxTimerEvent& WXUNUSED(e)) //..contando anche quanti sono e memorizzandoli in un array asFileList const size_t uFilesToCopy = wxDir::GetAllFiles(strSourcePath.GetPath(), &asFilesList); - //per ogni files da copiare controlla i path sorgente e destinazione(problema con sottodirectory tipo dati) + //per ogni file da copiare controlla i path sorgente e destinazione(problema con sottodirectory tipo dati) wxString strFileCurr; const size_t nPathLenght = strSourcePath.GetPath().Len(); //progress bar @@ -2413,8 +2415,56 @@ void CampoSetup::OnTimer(wxTimerEvent& WXUNUSED(e)) } //if (!strFileCurr.IsEmpty().. } //for(size_t... + // 3) INSTALLAZIONE DATI DEMO + //--------------------------- + //installazione dei dati dimostrativi (che schifo!) + if (bInstallDemoData) + { + //trova la cartella datidemo da copiare + wxArrayString asDataList; + wxFileName strSourcePath(wxGetCwd(), "*.*"); + strSourcePath.AppendDir(".."); + strSourcePath.AppendDir("datidemo"); + strSourcePath.MakeAbsolute(); - // 3) COMPILAZIONE CAMPO.INI CON CONFIGURAZIONE NUOVA INSTALLAZIONE + const size_t uFilesToCopy = wxDir::GetAllFiles(strSourcePath.GetPath(), &asDataList); + wxString strFileCurr; + const size_t nPathLenght = strSourcePath.GetPath().Len(); + wxProgressDialog pi("Installazione Dati Demo...", "", (int)uFilesToCopy, NULL, wxPD_AUTO_HIDE | wxPD_APP_MODAL | wxPD_CAN_ABORT); + for (size_t i = 0; i < uFilesToCopy; i++) + { + if (!pi.Update((int)i, asDataList[i])) + break; + + asDataList[i].Lower(); + strFileCurr = strDataPath + "/"; + strFileCurr += asDataList[i].Mid(nPathLenght + 9); + + if (!strFileCurr.IsEmpty()) + { + strFileCurr.MakeLower(); + const wxFileName strFileName(strFileCurr); + //eventuali sottodirectory le crea (solo se hanno un nome) + const wxString strDir = strFileName.GetPath(); + if (!strDir.IsEmpty() && !wxDirExists(strDir)) + wxMkdir(strDir); + + if(!wxCopyFile(asDataList[i], strFileCurr)) + { + wxString strErr = "Impossibile copiare il file "; + strErr += asDataList[i]; + strErr += " in "; + strErr += strFileCurr; + strErr += "\nInstallazione interrotta!"; + ErrorBox(strErr); + break; + } + } //if (!strFileCurr.IsEmpty().. + } //for (size_t i = 0... + } //if(bInstallDemoData... + + + // 4) COMPILAZIONE CAMPO.INI CON CONFIGURAZIONE NUOVA INSTALLAZIONE //----------------------------------------------------------------- //adesso deve compilare il campo.ini se nuova installazione.. if (bNewInstallation) @@ -2450,7 +2500,7 @@ void CampoSetup::OnTimer(wxTimerEvent& WXUNUSED(e)) } //if(bNewInstallation... - // 4) COMPILAZIONE\AGGIORNAMENTO INSTALL.INI CON DISKPATH + // 5) COMPILAZIONE\AGGIORNAMENTO INSTALL.INI CON DISKPATH //------------------------------------------------------- //..e modificare comunque l'install.ini aggiornando eventualmente l'origine dei programmi //parentesi necessaria per la scrittura immediata (non cancellare! serve per debug) @@ -2469,7 +2519,7 @@ void CampoSetup::OnTimer(wxTimerEvent& WXUNUSED(e)) } - // 5) CREAZIONE AUTOSTART DEI SERVERS (SE CI SONO) + // 6) CREAZIONE AUTOSTART DEI SERVERS (SE CI SONO) //------------------------------------------------ //solo se sta installando campo in postazione server e deve installare un gestore di servizi.. //..avvia la procedura della creazione dell'autostart(un casino) @@ -2480,14 +2530,14 @@ void CampoSetup::OnTimer(wxTimerEvent& WXUNUSED(e)) } - // 6) AGGIORNAMENTO DEL MODULO SY CON EVENTUALI PATCH PRESENTI IN PROGRAM DEL CD E AGGIORNAMENTO INSTALL.INI + // 7) AGGIORNAMENTO DEL MODULO SY CON EVENTUALI PATCH PRESENTI IN PROGRAM DEL CD E AGGIORNAMENTO INSTALL.INI //---------------------------------------------------------------------------------------------------------- //procede poi al caricamento delle patch eventuali di sistema all'interno della dir 'program' e al.. //..conseguente riaggiornamento del livello versione/patch del SY in install.ini UnzipSystem(strPrgLocPath); - // 7) CREAZIONE DELL'ICONA SUL DESKTOP + // 8) CREAZIONE DELL'ICONA SUL DESKTOP //------------------------------------ const wxFileName strExe(strPrgLocPath, wxT("ba0.exe")); const bool bDesktopShortcut = pWizard->GetDesktopShortcut(); @@ -2495,7 +2545,7 @@ void CampoSetup::OnTimer(wxTimerEvent& WXUNUSED(e)) CreateIcon(CSIDL_COMMON_DESKTOPDIRECTORY, strExe); - // 8) AGGIORNAMENTO CAMPO.STP + // 9) AGGIORNAMENTO CAMPO.STP //--------------------------- if (bNewInstallation) { @@ -2514,6 +2564,9 @@ void CampoSetup::OnTimer(wxTimerEvent& WXUNUSED(e)) } } + + // 10) CHIUDE IL SETUP LANCIANDO BA1 -6 PER INSTALLAZIONE MODULI + //------------------------------------------------------------- //lanciare ba1.exe -6 in uscita (non va qui! e' solo per ricordarsi di farlo!) wxSetWorkingDirectory(strPrgLocPath); wxExecute("ba1 -6 /uADMIN"); @@ -2521,6 +2574,7 @@ void CampoSetup::OnTimer(wxTimerEvent& WXUNUSED(e)) } //if (pWizard->Run())... pWizard->Destroy(); + //finestrina x chiudere a mano il programma (sconsigliata causa lancio ba1.exe) // ::wxMessageBox(wxT("Installazione terminata"), APPNAME, wxOK | wxICON_INFORMATION); m_pMainFrame->Destroy(); }