Patch level :10.0 setup
Files correlati : Ricompilazione Demo : [ ] Commento : Sistemata installazione nuova demo (è il programma stesso senza chiave con i dati demo del cd). Sistemato mantenimento dell'OEM (tendeva a perderlo clamorosamente). git-svn-id: svn://10.65.10.50/trunk@20220 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
9863fed64d
commit
64cbcd1804
707
setup/Setup.cpp
707
setup/Setup.cpp
@ -935,386 +935,393 @@ void CampoSetup::NormalSetup()
|
||||
//e' una DEMO o una versione normale?
|
||||
const bool bInstallDemoVersion = m_pWizard->GetInstDemoVersion();
|
||||
|
||||
// 0) INSTALLAZIONE VERSIONE DEMO (SIETE PAZZI?)
|
||||
//----------------------------------------------
|
||||
if (bInstallDemoVersion)
|
||||
|
||||
// 1) RACCOLTA PARAMETRI GENERALI INSTALLAZIONE (tipo,path,cartelle,servers,...)
|
||||
//------------------------------------------------------------------------------
|
||||
//tipo di installazione/aggiornamento
|
||||
const InstallationType uInstallationType = m_pWizard->GetInstallationType();
|
||||
const bool bNewInstallation = uInstallationType != it_upgrade;
|
||||
//installazione servers? solo per server di campo
|
||||
const bool bInstallLurch = uInstallationType == it_server && (m_pWizard->GetInstUseAuth() || m_pWizard->GetInstUseDict()) && (!bInstallDemoVersion);
|
||||
//uso servers? sarebbe solo per i client ma lo teniamo buono per tutti
|
||||
const bool bUseLurch = uInstallationType != it_server && (!m_pWizard->GetSrvAuth().IsEmpty() || !m_pWizard->GetSrvDict().IsEmpty()) && (!bInstallDemoVersion);
|
||||
//installazione datidemo? (oddio speriamo di no!; comunque vale solo per installazione standard)
|
||||
const bool bInstallDemoData = uInstallationType == (it_standalone && m_pWizard->GetInstDemoData()) || (bInstallDemoVersion);
|
||||
//cartelle selezionate dall'utente
|
||||
const wxString& strPrgLocPath = m_pWizard->GetPrgLocPath();
|
||||
const wxString& strDataPath = m_pWizard->GetDataPath();
|
||||
|
||||
//se nuova installazione deve anche creare la directory di destinazione
|
||||
if (bNewInstallation)
|
||||
{
|
||||
const wxString& strPrgLocPath = "c:/campodemo";
|
||||
const wxString& strDataPath = strPrgLocPath + "/dati";
|
||||
const wxString& strHelpPath = strPrgLocPath + "/htmlhelp";
|
||||
//creazione delle directories necessarie alla installazione DEMO
|
||||
//creazione della directory dei programmi (compreso l'intero albero directory)
|
||||
CheckAndMakeDir(strPrgLocPath, "programmi");
|
||||
CheckAndMakeDir(strDataPath, "dati");
|
||||
CheckAndMakeDir(strHelpPath, "help");
|
||||
|
||||
//copia della campodemo sull'hard disk in c:\campodemo
|
||||
wxArrayString asDemoList;
|
||||
const wxString strSrc = GetSourceDir("campodemo");
|
||||
|
||||
if (wxDir::Exists(strSrc))
|
||||
{
|
||||
const size_t uFilesToCopy = wxDir::GetAllFiles(strSrc, &asDemoList);
|
||||
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]))
|
||||
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");
|
||||
}
|
||||
//creazione della directory dei dati (compreso l'intero albero directory)
|
||||
//un client NON installa i dati!! (senno' e' una installazione locale semplice)
|
||||
if (uInstallationType != it_client)
|
||||
CheckAndMakeDir(strDataPath, "dati");
|
||||
}
|
||||
else //tutti i casi normali (std,server,client,aggiornamento)
|
||||
{
|
||||
// 1) RACCOLTA PARAMETRI GENERALI INSTALLAZIONE (tipo,path,cartelle,servers,...)
|
||||
//------------------------------------------------------------------------------
|
||||
//tipo di installazione/aggiornamento
|
||||
const InstallationType uInstallationType = m_pWizard->GetInstallationType();
|
||||
const bool bNewInstallation = uInstallationType != it_upgrade;
|
||||
//installazione servers? solo per server di campo
|
||||
const bool bInstallLurch = uInstallationType == it_server && (m_pWizard->GetInstUseAuth() || m_pWizard->GetInstUseDict());
|
||||
//uso servers? sarebbe solo per i client ma lo teniamo buono per tutti
|
||||
const bool bUseLurch = uInstallationType != it_server && (!m_pWizard->GetSrvAuth().IsEmpty() || !m_pWizard->GetSrvDict().IsEmpty());
|
||||
//installazione datidemo? (oddio speriamo di no!; comunque vale solo per installazione standard)
|
||||
const bool bInstallDemoData = uInstallationType == it_standalone && m_pWizard->GetInstDemoData();
|
||||
//cartelle selezionate dall'utente
|
||||
const wxString& strPrgLocPath = m_pWizard->GetPrgLocPath();
|
||||
const wxString& strDataPath = m_pWizard->GetDataPath();
|
||||
|
||||
|
||||
//se nuova installazione deve anche creare la directory di destinazione
|
||||
if (bNewInstallation)
|
||||
// 2) COPIA DEI FILES DI INSTALLAZIONE DALLA CARTELLA CAMPO (E SUBDIRS) (SU CD) ALLA CARTELLA DESTINAZIONE
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
//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(m_strSetupPath, "*.*");
|
||||
strSourcePath.AppendDir("..");
|
||||
strSourcePath.AppendDir("..");
|
||||
strSourcePath.AppendDir("campo"); // NOME fisso della cartella del CD, non mettere APPNAME
|
||||
strSourcePath.MakeAbsolute();
|
||||
//stringa inutile al programma ma decisiva per il programmatore
|
||||
const wxString strSrc = strSourcePath.GetPath();
|
||||
//..contando anche quanti sono e memorizzandoli in un array asFileList
|
||||
const size_t uFilesToCopy = wxDir::GetAllFiles(strSrc, &asFilesList);
|
||||
|
||||
const size_t nPathLenght = strSrc.Len();
|
||||
//progress bar
|
||||
CampoProgressDialog pi("Installazione Dati e Programmi di base...", (int)uFilesToCopy, m_pWizard);
|
||||
|
||||
for (size_t i = 0; i < uFilesToCopy; i++)
|
||||
{
|
||||
//per ogni file da copiare controlla i path sorgente e destinazione(problema con sottodirectory tipo..
|
||||
//..dati); strFileCurr va lasciato qui perche' DEVE ESSERE AZZERATO ad ogni cambio file!!!!!!
|
||||
wxString strFileCurr;
|
||||
|
||||
//controlla se il file corrente e' dentro una sottodirectory (tipo dati,servers,ecc...) oppure e' al..
|
||||
//..primo livello (quindi e' un file di programma)
|
||||
wxString strSourceFile = asFilesList[i].Lower();
|
||||
NormalizeSlash(strSourceFile);
|
||||
|
||||
//e' in una subdir se la lunghezza del suo path prima dell'ultimo '/' e' > della lunghezza del path di root
|
||||
const bool bIsSubDir = strSourceFile.Find('/', true) > (int)nPathLenght;
|
||||
|
||||
//2A) files con subdirectory
|
||||
if (bIsSubDir)
|
||||
{
|
||||
//creazione della directory dei programmi (compreso l'intero albero directory)
|
||||
CheckAndMakeDir(strPrgLocPath, "programmi");
|
||||
//creazione della directory dei dati (compreso l'intero albero directory)
|
||||
//un client NON installa i dati!! (senno' e' una installazione locale semplice)
|
||||
if (uInstallationType != it_client)
|
||||
CheckAndMakeDir(strDataPath, "dati");
|
||||
}
|
||||
|
||||
|
||||
// 2) COPIA DEI FILES DI INSTALLAZIONE DALLA CARTELLA CAMPO (E SUBDIRS) (SU CD) ALLA CARTELLA DESTINAZIONE
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
//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(m_strSetupPath, "*.*");
|
||||
strSourcePath.AppendDir("..");
|
||||
strSourcePath.AppendDir("..");
|
||||
strSourcePath.AppendDir("campo"); // NOME fisso della cartella del CD, non mettere APPNAME
|
||||
strSourcePath.MakeAbsolute();
|
||||
//stringa inutile al programma ma decisiva per il programmatore
|
||||
const wxString strSrc = strSourcePath.GetPath();
|
||||
//..contando anche quanti sono e memorizzandoli in un array asFileList
|
||||
const size_t uFilesToCopy = wxDir::GetAllFiles(strSrc, &asFilesList);
|
||||
|
||||
const size_t nPathLenght = strSrc.Len();
|
||||
//progress bar
|
||||
CampoProgressDialog pi("Installazione Dati e Programmi di base...", (int)uFilesToCopy, m_pWizard);
|
||||
|
||||
for (size_t i = 0; i < uFilesToCopy; i++)
|
||||
{
|
||||
//per ogni file da copiare controlla i path sorgente e destinazione(problema con sottodirectory tipo..
|
||||
//..dati); strFileCurr va lasciato qui perche' DEVE ESSERE AZZERATO ad ogni cambio file!!!!!!
|
||||
wxString strFileCurr;
|
||||
|
||||
//controlla se il file corrente e' dentro una sottodirectory (tipo dati,servers,setup...) oppure e' al..
|
||||
//..primo livello (quindi e' un file di programma)
|
||||
wxString strSourceFile = asFilesList[i].Lower();
|
||||
NormalizeSlash(strSourceFile);
|
||||
|
||||
//e' in una subdir se la lunghezza del suo path prima dell'ultimo '/' e' > della lunghezza del path di root
|
||||
const bool bIsSubDir = strSourceFile.Find('/', true) > (int)nPathLenght;
|
||||
|
||||
//2A) files con subdirectory
|
||||
if (bIsSubDir)
|
||||
//files dei dati standard! solo in caso di nuova installazione!! E NON installazione DEMO!!
|
||||
if (strSourceFile.Find("/dati/") > 0)
|
||||
{
|
||||
//files dei dati standard! solo in caso di nuova installazione!!
|
||||
if (strSourceFile.Find("/dati/") > 0)
|
||||
//i DATI NON VANNO MAI installati in caso di aggiornamento!!!
|
||||
//i DATI NON VANNO MAI installati in caso di installazione client!!!
|
||||
//e nemmeno in caso si scelga di installare i dati demo (senno' sporca la dir dati e i datidemo non si installano)
|
||||
//Ricordare che c'e' gia' stato il controllo nella Forward della pagina di selezione, quindi la cartella..
|
||||
//..di destinazione e' comunque vuota
|
||||
if (bNewInstallation && uInstallationType != it_client && !bInstallDemoData)
|
||||
{
|
||||
//i DATI NON VANNO MAI installati in caso di aggiornamento!!!
|
||||
//i DATI NON VANNO MAI installati in caso di installazione client!!!
|
||||
//e nemmeno in caso si scelga di installare i dati demo (senno' sporca la dir dati e i datidemo non si installano)
|
||||
//Ricordare che c'e' gia' stato il controllo nella Forward della pagina di selezione, quindi la cartella..
|
||||
//..di destinazione e' comunque vuota
|
||||
if (bNewInstallation && uInstallationType != it_client && !bInstallDemoData)
|
||||
{
|
||||
strFileCurr = strDataPath;
|
||||
strFileCurr += asFilesList[i].Mid(nPathLenght + 5);
|
||||
//Ulteriore controllo di sicurezza: se trova il file di destinazione gia' presente..
|
||||
//..NON lo sovrascrive (lo mette vuoto cosi' non lo copia)
|
||||
if (wxFileName::FileExists(strFileCurr))
|
||||
strFileCurr = "";
|
||||
}
|
||||
} else
|
||||
if (strSourceFile.Find("/servers/") > 0) //che fare con i servers? copiare la directory...
|
||||
{
|
||||
if (bInstallLurch) //..ma solo se devi installare i servers
|
||||
{
|
||||
strFileCurr = strPrgLocPath;
|
||||
strFileCurr += "/servers";
|
||||
strFileCurr += asFilesList[i].Mid(nPathLenght + 8);
|
||||
}
|
||||
strFileCurr = strDataPath;
|
||||
strFileCurr += asFilesList[i].Mid(nPathLenght + 5);
|
||||
//Ulteriore controllo di sicurezza: se trova il file di destinazione gia' presente..
|
||||
//..NON lo sovrascrive (lo mette vuoto cosi' non lo copia)
|
||||
if (wxFileName::FileExists(strFileCurr))
|
||||
strFileCurr = "";
|
||||
}
|
||||
else //files vari di altre subdirectory che si installano sempre (es. setup)
|
||||
else
|
||||
strFileCurr = "";
|
||||
|
||||
} else
|
||||
if (strSourceFile.Find("/datidemo/") > 0)
|
||||
{
|
||||
//i DATIDEMO vanno copiati solo in caso di installazione DEMO o di installazione standalone con specifica..
|
||||
//richiesta di installazione DATIDEMO
|
||||
if (bInstallDemoData)
|
||||
{
|
||||
strFileCurr = strDataPath;
|
||||
strFileCurr += asFilesList[i].Mid(nPathLenght + 9);
|
||||
if (wxFileName::FileExists(strFileCurr))
|
||||
strFileCurr = "";
|
||||
}
|
||||
else
|
||||
strFileCurr = "";
|
||||
|
||||
} else
|
||||
if (strSourceFile.Find("/servers/") > 0) //che fare con i servers? copiare la directory...
|
||||
{
|
||||
if (bInstallLurch && !bInstallDemoVersion) //..ma solo se devi installare i servers
|
||||
{
|
||||
strFileCurr = strPrgLocPath;
|
||||
strFileCurr += asFilesList[i].Mid(nPathLenght);
|
||||
strFileCurr += "/servers";
|
||||
strFileCurr += asFilesList[i].Mid(nPathLenght + 8);
|
||||
}
|
||||
else
|
||||
strFileCurr = "";
|
||||
|
||||
}
|
||||
//2B) files senza subdirectory (programmi!)
|
||||
else
|
||||
else //files vari di altre subdirectory che si installano sempre (es. recdesc)
|
||||
{
|
||||
strFileCurr = strPrgLocPath;
|
||||
strFileCurr += asFilesList[i].Mid(nPathLenght);
|
||||
}
|
||||
//copia i files nella cartella di destinazione (programmi,dati,cazzi e mazzi);se il nome del file..
|
||||
//..di destinazione e' vuoto significa che non lo deve copiare!! (es. dati in aggiornamento)
|
||||
}
|
||||
//2B) files senza subdirectory (programmi!)
|
||||
else
|
||||
{
|
||||
strFileCurr = strPrgLocPath;
|
||||
strFileCurr += asFilesList[i].Mid(nPathLenght);
|
||||
}
|
||||
//copia i files nella cartella di destinazione (programmi,dati,cazzi e mazzi);se il nome del file..
|
||||
//..di destinazione e' vuoto significa che non lo deve copiare!! (es. dati in aggiornamento)
|
||||
if (!strFileCurr.IsEmpty())
|
||||
{
|
||||
//aggiorna la progind
|
||||
if (!pi.Update((int)i, asFilesList[i]))
|
||||
break;
|
||||
//normalizza per sicurezza il nome (completo di path) del file (visto che ci sono metodi cui piace..
|
||||
//..aggiungere / o \ a piacere..
|
||||
NormalizeSlash(strFileCurr);
|
||||
|
||||
//eventuali sottodirectory le crea (solo se hanno un nome) e poi copia fisicamente i files
|
||||
//se un file non si copia interrompe l'installazione con un ErrorBox
|
||||
if (!CopyFilesAndDirs(asFilesList[i], strFileCurr, true))
|
||||
break;
|
||||
} //if (!strFileCurr.IsEmpty()..
|
||||
} //for(size_t...
|
||||
|
||||
UpdateInstallIni(strSrc + "/install.ini", strPrgLocPath + "/install.ini", "sy");
|
||||
if (bInstallLurch)
|
||||
UpdateInstallIni(strSrc + "/install.ini", strPrgLocPath + "/install.ini", "sr");
|
||||
|
||||
|
||||
// 3) COPIA DELLA CARTELLA SETUP DA CD (PROGRAM\SETUP) A CARTELLA DI DESTINAZIONE
|
||||
//-------------------------------------------------------------------------------
|
||||
//Funziona tutto come al punto 2)! Cambiano solo i path (sorgente = program\setup, destinazione = destdir\setup)
|
||||
wxArrayString asSetupFilesList;
|
||||
wxFileName fnSetupSourcePath(m_strSetupPath, "*.*");
|
||||
fnSetupSourcePath.MakeAbsolute();
|
||||
|
||||
const wxString strSetupSrc = fnSetupSourcePath.GetPath();
|
||||
const wxString strSetupDst = strPrgLocPath + "/setup";
|
||||
|
||||
const size_t uSetupFilesToCopy = wxDir::GetAllFiles(strSetupSrc, &asSetupFilesList);
|
||||
const size_t nSetupPathLenght = strSetupSrc.Len();
|
||||
CampoProgressDialog po(_("Copia cartella Setup..."), (int)uSetupFilesToCopy, m_pWizard);
|
||||
|
||||
wxString strFileCurr;
|
||||
|
||||
for (size_t i = 0; i < uSetupFilesToCopy; i++)
|
||||
{
|
||||
wxString strSourceFile = asSetupFilesList[i].Lower();
|
||||
NormalizeSlash(strSourceFile);
|
||||
strFileCurr = strSetupDst;
|
||||
strFileCurr += asSetupFilesList[i].Mid(nSetupPathLenght);
|
||||
|
||||
if (!strFileCurr.IsEmpty())
|
||||
{
|
||||
if (!po.Update((int)i, asSetupFilesList[i]))
|
||||
break;
|
||||
NormalizeSlash(strFileCurr);
|
||||
|
||||
if (!CopyFilesAndDirs(asSetupFilesList[i], strFileCurr, true))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// ?) INSTALLAZIONE DATI DEMO
|
||||
//---------------------------
|
||||
//installazione dei dati dimostrativi (che schifo!).Non si puo' fare in aggiornamento!
|
||||
/* if (bInstallDemoData && uInstallationType < 3)
|
||||
{
|
||||
//trova la cartella datidemo da copiare
|
||||
wxArrayString asDataList;
|
||||
const wxString strSrc = GetSourceDir("datidemo");
|
||||
//conta i files da copiare e si lancia nell'operazione di copiatura...
|
||||
//Vale quanto detto per l'installazione dell'area dati
|
||||
const size_t uFilesToCopy = wxDir::GetAllFiles(strSrc, &asDataList);
|
||||
wxString strFileCurr;
|
||||
const size_t nPathLenght = strSrc.Len();
|
||||
CampoProgressDialog pi("Installazione Dati Demo...", (int)uFilesToCopy, m_pWizard);
|
||||
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);
|
||||
|
||||
if (!strFileCurr.IsEmpty())
|
||||
{
|
||||
//aggiorna la progind
|
||||
if (!pi.Update((int)i, asFilesList[i]))
|
||||
break;
|
||||
//normalizza per sicurezza il nome (completo di path) del file (visto che ci sono metodi cui piace..
|
||||
//..aggiungere / o \ a piacere..
|
||||
NormalizeSlash(strFileCurr);
|
||||
|
||||
//eventuali sottodirectory le crea (solo se hanno un nome) e poi copia fisicamente i files
|
||||
//se un file non si copia interrompe l'installazione con un ErrorBox
|
||||
if (!CopyFilesAndDirs(asFilesList[i], strFileCurr, true))
|
||||
if (!CopyFilesAndDirs(asDataList[i], strFileCurr, false))
|
||||
break;
|
||||
} //if (!strFileCurr.IsEmpty()..
|
||||
} //for(size_t...
|
||||
|
||||
UpdateInstallIni(strSrc + "/install.ini", strPrgLocPath + "/install.ini", "sy");
|
||||
|
||||
// 3) INSTALLAZIONE DATI DEMO
|
||||
//---------------------------
|
||||
//installazione dei dati dimostrativi (che schifo!).Non si puo' fare in aggiornamento!
|
||||
/* if (bInstallDemoData && uInstallationType < 3)
|
||||
{
|
||||
//trova la cartella datidemo da copiare
|
||||
wxArrayString asDataList;
|
||||
const wxString strSrc = GetSourceDir("datidemo");
|
||||
//conta i files da copiare e si lancia nell'operazione di copiatura...
|
||||
//Vale quanto detto per l'installazione dell'area dati
|
||||
const size_t uFilesToCopy = wxDir::GetAllFiles(strSrc, &asDataList);
|
||||
wxString strFileCurr;
|
||||
const size_t nPathLenght = strSrc.Len();
|
||||
CampoProgressDialog pi("Installazione Dati Demo...", (int)uFilesToCopy, m_pWizard);
|
||||
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);
|
||||
|
||||
if (!strFileCurr.IsEmpty())
|
||||
{
|
||||
//eventuali sottodirectory le crea (solo se hanno un nome) e poi copia fisicamente i files
|
||||
//se un file non si copia interrompe l'installazione con un ErrorBox
|
||||
if (!CopyFilesAndDirs(asDataList[i], strFileCurr, false))
|
||||
break;
|
||||
} //if (!strFileCurr.IsEmpty()..
|
||||
} //for (size_t i = 0...
|
||||
} //if(bInstallDemoData... */
|
||||
} //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)
|
||||
{
|
||||
{ //parentesi necessaria per la scrittura immediata (non cancellare! serve per debug)
|
||||
//paragrafo [Main]
|
||||
CampoIniFile CampoIniMain(strPrgLocPath + "/campo.ini", "Main");
|
||||
const unsigned int uDongleType = m_pWizard->GetDongleType();
|
||||
CampoIniMain.Set("Donglehw", uDongleType);
|
||||
CampoIniMain.Set("Study", strDataPath);
|
||||
CampoIniMain.Set("Firm", "com");
|
||||
//server,client o standalone?
|
||||
CampoIniMain.Set("Type", uInstallationType);
|
||||
}
|
||||
//paragrafo [Server]
|
||||
if (bInstallLurch || bUseLurch)
|
||||
{
|
||||
CampoIniFile CampoIniSrv(strPrgLocPath + "/campo.ini", "Server");
|
||||
CampoIniSrv.Set("Dongle", m_pWizard->GetSrvAuth());
|
||||
CampoIniSrv.Set("Dictionary", m_pWizard->GetSrvDict());
|
||||
}
|
||||
} //if(bNewInstallation...
|
||||
else //e' un aggiornamento! scrive il type
|
||||
{
|
||||
// 4) COMPILAZIONE CAMPO.INI CON CONFIGURAZIONE NUOVA INSTALLAZIONE
|
||||
//-----------------------------------------------------------------
|
||||
//adesso deve compilare il campo.ini se nuova installazione..
|
||||
if (bNewInstallation)
|
||||
{
|
||||
{ //parentesi necessaria per la scrittura immediata (non cancellare! serve per debug)
|
||||
//paragrafo [Main]
|
||||
CampoIniFile CampoIniMain(strPrgLocPath + "/campo.ini", "Main");
|
||||
//SOLO se sta aggiornando una versione antecedente alla 10.0 scrive la variabile Type nel campo.ini..
|
||||
//..ovvero deve testare se Type = 0
|
||||
if (CampoIniMain.GetInt("Type") == 0)
|
||||
CampoIniMain.Set("Type", CampoIniMain.GetInstallationType());
|
||||
const unsigned int uDongleType = m_pWizard->GetDongleType();
|
||||
CampoIniMain.Set("Donglehw", uDongleType);
|
||||
CampoIniMain.Set("Study", strDataPath);
|
||||
CampoIniMain.Set("Firm", "com");
|
||||
//server,client o standalone?
|
||||
CampoIniMain.Set("Type", uInstallationType);
|
||||
}
|
||||
|
||||
// 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)
|
||||
//paragrafo [Server]
|
||||
if (bInstallLurch || bUseLurch)
|
||||
{
|
||||
CampoIniFile CampoInstall(strPrgLocPath + "/install.ini", "Main");
|
||||
if (uInstallationType == it_client) //client: directory origine sul server
|
||||
CampoInstall.Set("DiskPath", m_pWizard->GetPrgNetPath());
|
||||
else //e' il path assoluto dell'install.ini che sta in 'program' (es. D:\program)
|
||||
{
|
||||
const wxString strSrc = GetSourceDir("program");
|
||||
CampoInstall.Set("DiskPath", strSrc);
|
||||
}
|
||||
CampoIniFile CampoIniSrv(strPrgLocPath + "/campo.ini", "Server");
|
||||
CampoIniSrv.Set("Dongle", m_pWizard->GetSrvAuth());
|
||||
CampoIniSrv.Set("Dictionary", m_pWizard->GetSrvDict());
|
||||
}
|
||||
|
||||
// 6) AGGIORNAMENTO DI ADMIN.INI CON IL TEMA DEL RESELLER
|
||||
//---------------------------------------------------------
|
||||
//carica il tema predefinito del reseller dentro l'admin.ini che sta in cartella programmi\dati\config..
|
||||
//..in modo da vederli subito quando lancerà ba1 (e successivamente ba0)
|
||||
if (bNewInstallation)
|
||||
{
|
||||
//file sorgente
|
||||
const wxString strThemeFileName = Theme();
|
||||
wxString strSrcThemePath = m_strSetupPath;
|
||||
strSrcThemePath << strThemeFileName;
|
||||
CampoIniFile CampoTheme(strSrcThemePath, "Standard");
|
||||
|
||||
//file di destinazione
|
||||
CampoIniFile CampoDestAdmin(strDataPath + "/config/admin.ini", "Colors");
|
||||
|
||||
//copia del tema standard nell'admin.ini di destinazione
|
||||
long nIndex;
|
||||
wxString strKey;
|
||||
//ciclo su tutte le variabili del paragrafo di origine
|
||||
for (bool ok = CampoTheme.GetFirstEntry(strKey, nIndex); ok; ok = CampoTheme.GetNextEntry(strKey, nIndex))
|
||||
{
|
||||
//copia nel corrispondente paragrafo di destinazione
|
||||
CampoDestAdmin.Set(strKey, CampoTheme.Get(strKey));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 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 di SY ed SR in install.ini
|
||||
const wxString strPrgCDPath = GetSourceDir("program");
|
||||
if (wxFileName::DirExists(strPrgCDPath))
|
||||
{
|
||||
const wxString strSetupCDPath = strPrgCDPath + "/setup";
|
||||
const wxString strSetupLocPath = strPrgLocPath + "/setup";
|
||||
//Procedura di salvataggio del corrente OEM (reseller) del prg già installato; in questo modo anche..
|
||||
//..mandando un CD AGA (che generalmente funziona!) ad un cliente di un distributore non AGA, il reseller..
|
||||
//..a video non cambia. Per cambiare reseller si dovrà intervenire a mano sull'oem.ini cambiando il valore..
|
||||
//..di OEM dopo l'installazione
|
||||
const wxString strOemLocPath = strSetupLocPath + "/oem.ini";
|
||||
CampoIniFile CampoIniOem(strOemLocPath, "MAIN");
|
||||
const int nOldOem = CampoIniOem.GetInt("OEM");
|
||||
//svuota proprio la directory setup in modo da non coservare files indesiderati
|
||||
EmptyOutDir(strOemLocPath);
|
||||
//copia la directory setup da CD a locale
|
||||
CopyDir(strSetupCDPath, strSetupLocPath);
|
||||
//rimette a posto la candela...cioè, il reseller
|
||||
CampoIniOem.Set("OEM", nOldOem);
|
||||
//..Fine dell'aggiornamento della cartella setup
|
||||
|
||||
UnzipModule(strPrgLocPath, strPrgCDPath, "sy");
|
||||
UnzipModule(strPrgLocPath, strPrgCDPath, "sr");
|
||||
}
|
||||
|
||||
|
||||
// 8) 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). Questa procedura non puo'..
|
||||
//..valere per l'aggiornamento, che agisce in modo diverso
|
||||
if (bNewInstallation)
|
||||
{
|
||||
const LurchMode iSrvAutostartMode = m_pWizard->GetSrvAutostartMode();
|
||||
if (iSrvAutostartMode != lm_none)
|
||||
{
|
||||
CreateAutostartMode(iSrvAutostartMode, strPrgLocPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 9) CREAZIONE DELL'ICONA SUL DESKTOP
|
||||
//------------------------------------
|
||||
const bool bDesktopShortcut = m_pWizard->GetDesktopShortcut();
|
||||
if (bDesktopShortcut)
|
||||
{
|
||||
const wxFileName strExe(strPrgLocPath, wxT("ba0.exe"));
|
||||
|
||||
CampoIniFile CampoIniMain(strPrgLocPath + "/campo.ini", "Main");
|
||||
InstallationType nInstType = CampoIniMain.GetInstallationType();
|
||||
|
||||
wxString strLnk = Product();
|
||||
switch (nInstType)
|
||||
{
|
||||
case it_server: strLnk += " (Server)"; break;
|
||||
case it_client: strLnk += " (Client)"; break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
//crea comunque l'icona
|
||||
CreateIcon(CSIDL_COMMON_DESKTOPDIRECTORY, strExe, strLnk);
|
||||
}
|
||||
|
||||
|
||||
// 10) AGGIORNAMENTO CAMPO.STP
|
||||
//---------------------------
|
||||
if (bNewInstallation)
|
||||
{
|
||||
//deve aggiungere la nuova installazione al campo.stp
|
||||
for (int i = 1;; i++)
|
||||
{
|
||||
wxString strGroup;
|
||||
strGroup << i;
|
||||
CampoIniFile CampoStp("C:\\campo.stp", strGroup);
|
||||
wxString strPath = CampoStp.Get("Program");
|
||||
if (strPath.IsEmpty())
|
||||
{
|
||||
CampoStp.Set("Program", strPrgLocPath);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 11) CHIUDE IL SETUP LANCIANDO BA1 -6 PER INSTALLAZIONE MODULI
|
||||
//-------------------------------------------------------------
|
||||
//lanciare ba1.exe -6 in uscita
|
||||
if (wxSetWorkingDirectory(strPrgLocPath))
|
||||
wxExecute("ba1 -6 /uADMIN");
|
||||
else
|
||||
ErrorBox("Impossibile installare i moduli. Cartella di destinazione irraggiungibile!");
|
||||
|
||||
} //if(bNewInstallation...
|
||||
else //e' un aggiornamento! scrive il type
|
||||
{
|
||||
CampoIniFile CampoIniMain(strPrgLocPath + "/campo.ini", "Main");
|
||||
//SOLO se sta aggiornando una versione antecedente alla 10.0 scrive la variabile Type nel campo.ini..
|
||||
//..ovvero deve testare se Type = 0
|
||||
if (CampoIniMain.GetInt("Type") == 0)
|
||||
CampoIniMain.Set("Type", CampoIniMain.GetInstallationType());
|
||||
}
|
||||
|
||||
|
||||
// 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)
|
||||
{
|
||||
CampoIniFile CampoInstall(strPrgLocPath + "/install.ini", "Main");
|
||||
if (uInstallationType == it_client) //client: directory origine sul server
|
||||
CampoInstall.Set("DiskPath", m_pWizard->GetPrgNetPath());
|
||||
else //e' il path assoluto dell'install.ini che sta in 'program' (es. D:\program)
|
||||
{
|
||||
const wxString strSrc = GetSourceDir("program");
|
||||
CampoInstall.Set("DiskPath", strSrc);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 6) AGGIORNAMENTO DI ADMIN.INI CON IL TEMA DEL RESELLER
|
||||
//---------------------------------------------------------
|
||||
//carica il tema predefinito del reseller dentro l'admin.ini che sta in cartella programmi\dati\config..
|
||||
//..in modo da vederli subito quando lancerà ba1 (e successivamente ba0)
|
||||
if (bNewInstallation)
|
||||
{
|
||||
//file sorgente
|
||||
const wxString strThemeFileName = Theme();
|
||||
wxString strSrcThemePath = m_strSetupPath;
|
||||
strSrcThemePath << strThemeFileName;
|
||||
CampoIniFile CampoTheme(strSrcThemePath, "Standard");
|
||||
|
||||
//file di destinazione
|
||||
CampoIniFile CampoDestAdmin(strDataPath + "/config/admin.ini", "Colors");
|
||||
|
||||
//copia del tema standard nell'admin.ini di destinazione
|
||||
long nIndex;
|
||||
wxString strKey;
|
||||
//ciclo su tutte le variabili del paragrafo di origine
|
||||
for (bool ok = CampoTheme.GetFirstEntry(strKey, nIndex); ok; ok = CampoTheme.GetNextEntry(strKey, nIndex))
|
||||
{
|
||||
//copia nel corrispondente paragrafo di destinazione
|
||||
CampoDestAdmin.Set(strKey, CampoTheme.Get(strKey));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 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 di SY ed SR in install.ini
|
||||
const wxString strPrgCDPath = GetSourceDir("program");
|
||||
if (wxFileName::DirExists(strPrgCDPath))
|
||||
{
|
||||
const wxString strSetupCDPath = strPrgCDPath + "/setup";
|
||||
const wxString strSetupLocPath = strPrgLocPath + "/setup";
|
||||
//Procedura di salvataggio del corrente OEM (reseller) del prg già installato; in questo modo anche..
|
||||
//..mandando un CD AGA (che generalmente funziona!) ad un cliente di un distributore non AGA, il reseller..
|
||||
//..a video non cambia. Per cambiare reseller si dovrà intervenire a mano sull'oem.ini cambiando il valore..
|
||||
//..di OEM dopo l'installazione
|
||||
const wxString strOemLocPath = strSetupLocPath + "/oem.ini";
|
||||
CampoIniFile CampoIniOem(strOemLocPath, "MAIN");
|
||||
const int nOldOem = CampoIniOem.GetInt("OEM");
|
||||
//svuota proprio la directory setup in modo da non coservare files indesiderati
|
||||
EmptyOutDir(strOemLocPath);
|
||||
//copia la directory setup da CD a locale
|
||||
CopyDir(strSetupCDPath, strSetupLocPath);
|
||||
//rimette a posto la candela...cioè, il reseller
|
||||
CampoIniOem.Set("OEM", nOldOem);
|
||||
//..Fine dell'aggiornamento della cartella setup
|
||||
|
||||
UnzipModule(strPrgLocPath, strPrgCDPath, "sy");
|
||||
UnzipModule(strPrgLocPath, strPrgCDPath, "sr");
|
||||
}
|
||||
|
||||
|
||||
// 8) 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). Questa procedura non puo'..
|
||||
//..valere per l'aggiornamento, che agisce in modo diverso
|
||||
if (bNewInstallation)
|
||||
{
|
||||
const LurchMode iSrvAutostartMode = m_pWizard->GetSrvAutostartMode();
|
||||
if (iSrvAutostartMode != lm_none)
|
||||
{
|
||||
CreateAutostartMode(iSrvAutostartMode, strPrgLocPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 9) CREAZIONE DELL'ICONA SUL DESKTOP
|
||||
//------------------------------------
|
||||
const bool bDesktopShortcut = m_pWizard->GetDesktopShortcut();
|
||||
if (bDesktopShortcut)
|
||||
{
|
||||
const wxFileName strExe(strPrgLocPath, wxT("ba0.exe"));
|
||||
|
||||
CampoIniFile CampoIniMain(strPrgLocPath + "/campo.ini", "Main");
|
||||
InstallationType nInstType = CampoIniMain.GetInstallationType();
|
||||
|
||||
wxString strLnk = Product();
|
||||
switch (nInstType)
|
||||
{
|
||||
case it_server: strLnk += " (Server)"; break;
|
||||
case it_client: strLnk += " (Client)"; break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
//crea comunque l'icona
|
||||
CreateIcon(CSIDL_COMMON_DESKTOPDIRECTORY, strExe, strLnk);
|
||||
}
|
||||
|
||||
|
||||
// 10) AGGIORNAMENTO CAMPO.STP
|
||||
//---------------------------
|
||||
if (bNewInstallation)
|
||||
{
|
||||
//deve aggiungere la nuova installazione al campo.stp
|
||||
for (int i = 1;; i++)
|
||||
{
|
||||
wxString strGroup;
|
||||
strGroup << i;
|
||||
CampoIniFile CampoStp("C:\\campo.stp", strGroup);
|
||||
wxString strPath = CampoStp.Get("Program");
|
||||
if (strPath.IsEmpty())
|
||||
{
|
||||
CampoStp.Set("Program", strPrgLocPath);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 11) CHIUDE IL SETUP LANCIANDO BA1 -6 PER INSTALLAZIONE MODULI
|
||||
//-------------------------------------------------------------
|
||||
//lanciare ba1.exe -6 in uscita
|
||||
if (wxSetWorkingDirectory(strPrgLocPath))
|
||||
wxExecute("ba1 -6 /uADMIN");
|
||||
else
|
||||
ErrorBox("Impossibile installare i moduli. Cartella di destinazione irraggiungibile!");
|
||||
|
||||
|
||||
} //if (m_pWizard->Run())...
|
||||
m_pWizard->Destroy();
|
||||
}
|
||||
|
@ -712,6 +712,7 @@ Owner=Ilaria Giardini
|
||||
pd0001 -0=31-12-2010
|
||||
pd0300 -0=31-12-2010
|
||||
pd0350 -0=31-12-2010
|
||||
pd5317 -0=31-12-2010
|
||||
pd6030 -0=31-12-2010
|
||||
pd6142 -0=31-12-2010
|
||||
pd6292 -0=31-12-2010
|
||||
@ -723,6 +724,9 @@ pd6292 -0=31-12-2010
|
||||
[8482]
|
||||
[8483]
|
||||
[8484]
|
||||
[8490]
|
||||
OEM=0
|
||||
Owner=AVIS Bolzano
|
||||
[8499]
|
||||
[8508]
|
||||
[8509]
|
||||
@ -792,7 +796,13 @@ pd5317 -0=31-12-2010
|
||||
[8593]
|
||||
OEM=1
|
||||
Owner=Roberta Cavalleri
|
||||
pd0001 -0=31-12-2010
|
||||
pd0300 -0=31-12-2010
|
||||
pd0350 -0=31-12-2010
|
||||
pd5317 -0=31-12-2010
|
||||
pd6030 -0=31-12-2010
|
||||
pd6142 -0=31-12-2010
|
||||
pd6292 -0=31-12-2010
|
||||
[8594]
|
||||
[8595]
|
||||
[8596]
|
||||
@ -886,11 +896,24 @@ OEM=2
|
||||
Owner=Baldini Lavanderia
|
||||
cg=31-03-2010
|
||||
sc=31-03-2010
|
||||
[8777]
|
||||
OEM=1
|
||||
Owner=Roberta Cavalleri
|
||||
pd0001 -0=31-12-2010
|
||||
pd0300 -0=31-12-2010
|
||||
pd0350 -0=31-12-2010
|
||||
pd5317 -0=31-12-2010
|
||||
pd6030 -0=31-12-2010
|
||||
pd6142 -0=31-12-2010
|
||||
pd6292 -0=31-12-2010
|
||||
[8798]
|
||||
OEM=3
|
||||
pi0001 -0=31-12-2010
|
||||
pi0001 -1=31-12-2010
|
||||
pi0001 -2=31-12-2010
|
||||
[8816]
|
||||
OEM=0
|
||||
Owner=AVIS Bolzano
|
||||
[8818]
|
||||
OEM=4
|
||||
Owner=Zabban Guido snc
|
||||
|
@ -15,15 +15,7 @@ extern "C"
|
||||
///////////////////////////////
|
||||
static int ThisYear()
|
||||
{
|
||||
int anno = 2006;
|
||||
time_t lt;
|
||||
if (time(<) == 0)
|
||||
{
|
||||
struct tm* timeloc = localtime(<) ;
|
||||
if (timeloc != NULL)
|
||||
anno = timeloc->tm_year + 1900;
|
||||
}
|
||||
return anno;
|
||||
return wxDateTime::Now().GetYear();
|
||||
}
|
||||
|
||||
///////////////////////////////
|
||||
@ -183,7 +175,7 @@ void TBordello::Chiudi()
|
||||
{
|
||||
wxSocketClient* sc = (wxSocketClient*)it->second;
|
||||
if (sc != NULL)
|
||||
sc->Close();
|
||||
sc->Destroy();
|
||||
}
|
||||
}
|
||||
|
||||
@ -279,6 +271,20 @@ unsigned short ServerLogin(int& year, wxString& strSrvName)
|
||||
const unsigned short MaxSck = 256;
|
||||
for (int i = 0; i < MaxSck; i++)
|
||||
{
|
||||
if ((i+1) % 64 == 0) // ogni 16 zoccole controllo se ce n'e' una bbona.
|
||||
{
|
||||
wxSleep(1);
|
||||
wxSocketClient* sc = m_bordello.QuellaBuona();
|
||||
if (sc != NULL)
|
||||
{
|
||||
wxIPV4address ipRemote;
|
||||
sc->GetPeer(ipRemote);
|
||||
strSrvName = ipRemote.Hostname();
|
||||
break;
|
||||
}
|
||||
m_bordello.Chiudi();
|
||||
}
|
||||
|
||||
//deve sostituire l'ultima cifra dell'IP con tutti i numeri che vanno da 0 a 255 alla ricerca del server
|
||||
wxString strSrvIP = strMyIP.BeforeLast('.');
|
||||
strSrvIP << "." << i; //ip del computer remoto
|
||||
@ -293,15 +299,7 @@ unsigned short ServerLogin(int& year, wxString& strSrvName)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
wxSleep(2);
|
||||
wxSocketClient* sc = m_bordello.QuellaBuona();
|
||||
if (sc != NULL)
|
||||
{
|
||||
wxIPV4address ipRemote;
|
||||
sc->GetPeer(ipRemote);
|
||||
strSrvName = ipRemote.Hostname();
|
||||
}
|
||||
m_bordello.Chiudi();
|
||||
} //if(strMyIP.Len()...
|
||||
} //if(strSrvName.Is...
|
||||
|
||||
|
196
setup/wizard.cpp
196
setup/wizard.cpp
@ -24,6 +24,7 @@ protected:
|
||||
bool CheckDataDir(wxString strDataPath) const;
|
||||
void CheckCustomDir(const wxString strCustomPath, const wxString& strPrgPath, wxArrayString& asPersonalizedFiles) const;
|
||||
bool CheckPrgDir(const wxString& strPrgPath) const;
|
||||
wxControl* FindControlById(wxWindowID id) const;
|
||||
|
||||
public:
|
||||
virtual bool ForwardValidate() { return true; }
|
||||
@ -36,29 +37,48 @@ public:
|
||||
CampoWizardPage(wxWizard* parent);
|
||||
};
|
||||
|
||||
wxControl* CampoWizardPage::FindControlById(wxWindowID id) const
|
||||
{
|
||||
wxWindow* pWnd = FindWindowById(id, this);
|
||||
return wxDynamicCast(pWnd, wxControl);
|
||||
}
|
||||
|
||||
|
||||
wxString CampoWizardPage::Get(wxWindowID id) const
|
||||
{
|
||||
wxWindow* pWnd = FindWindowById(id);
|
||||
return pWnd ? pWnd->GetLabel() : wxEmptyString;
|
||||
wxControl* pWnd = FindControlById(id);
|
||||
if (pWnd != NULL)
|
||||
{
|
||||
wxTextCtrl* pText = wxDynamicCast(pWnd, wxTextCtrl);
|
||||
if (pText != NULL)
|
||||
return pText->GetValue();
|
||||
}
|
||||
return pWnd ? pWnd->GetLabelText() : wxEmptyString;
|
||||
}
|
||||
|
||||
bool CampoWizardPage::GetBool(wxWindowID id) const
|
||||
{
|
||||
wxCheckBox* pWnd = (wxCheckBox*)FindWindowById(id);
|
||||
return pWnd != NULL && pWnd->IsChecked();
|
||||
wxCheckBox* pWnd = wxDynamicCast(FindControlById(id), wxCheckBox);
|
||||
return pWnd != NULL && pWnd->GetValue();
|
||||
}
|
||||
|
||||
bool CampoWizardPage::Set(wxWindowID id, const wxString& str)
|
||||
{
|
||||
wxWindow* pWnd = FindWindowById(id);
|
||||
wxControl* pWnd = FindControlById(id);
|
||||
if (pWnd)
|
||||
pWnd->SetLabel(str);
|
||||
{
|
||||
wxTextCtrl* pText = wxDynamicCast(pWnd, wxTextCtrl);
|
||||
if (pText != NULL)
|
||||
pText->ChangeValue(str);
|
||||
else
|
||||
pText->SetLabel(str);
|
||||
}
|
||||
return (pWnd != NULL);
|
||||
}
|
||||
|
||||
bool CampoWizardPage::Set(wxWindowID id, const bool bul)
|
||||
{
|
||||
wxCheckBox* pWnd = (wxCheckBox*)FindWindowById(id);
|
||||
wxCheckBox* pWnd = wxDynamicCast(FindControlById(id), wxCheckBox);
|
||||
if (pWnd)
|
||||
pWnd->SetValue(bul);
|
||||
return (pWnd != NULL);
|
||||
@ -67,11 +87,18 @@ bool CampoWizardPage::Set(wxWindowID id, const bool bul)
|
||||
int CampoWizardPage::GetSelection(wxWindowID id) const
|
||||
{
|
||||
int n = -1;
|
||||
wxWindow* pWnd = FindWindowById(id);
|
||||
wxWindow* pWnd = FindControlById(id);
|
||||
if (pWnd)
|
||||
{
|
||||
wxChoice* pList = (wxChoice*)pWnd;
|
||||
n = pList->GetSelection();
|
||||
wxChoice* pList = wxDynamicCast(pWnd, wxChoice);
|
||||
if (pList != NULL)
|
||||
n = pList->GetSelection();
|
||||
else
|
||||
{
|
||||
wxRadioBox* pRadio = wxDynamicCast(pWnd, wxRadioBox);
|
||||
if (pRadio != NULL)
|
||||
n = pRadio->GetSelection();
|
||||
}
|
||||
}
|
||||
return n;
|
||||
}
|
||||
@ -300,8 +327,8 @@ CampoWizardPage2::CampoWizardPage2(wxWizard* parent) : CampoWizardPage(parent)
|
||||
wxArrayString asAccRef;
|
||||
asAccRef.Add("Accetta");
|
||||
asAccRef.Add("Rifiuta");
|
||||
wxRadioBox* radio_box = new wxRadioBox(this, 201, "Selezionare 'Accetta' per proseguire con l'installazione, 'Rifiuta' per terminare l'installazione", wxDefaultPosition,
|
||||
wxDefaultSize, asAccRef, 0, wxRA_SPECIFY_COLS);
|
||||
wxRadioBox* radio_box = new wxRadioBox(this, 201, "Selezionare 'Accetta' per proseguire con l'installazione, 'Rifiuta' per terminare l'installazione",
|
||||
wxDefaultPosition, wxDefaultSize, asAccRef, 0, wxRA_SPECIFY_COLS);
|
||||
|
||||
radio_box->SetSelection(1);
|
||||
GetSizer()->Add(radio_box);
|
||||
@ -345,6 +372,8 @@ bool CampoWizardPage3::ForwardValidate()
|
||||
wxString strSrvAuth;
|
||||
wxString strSrvDict;
|
||||
|
||||
//AGGIORNAMENTO
|
||||
//-------------
|
||||
//analizza il campo.ini dell'installazione selezionata (si usa < perche' l'ultima row e' la nuova installazione!)
|
||||
if (iSelectedRow < iLastRow)
|
||||
{
|
||||
@ -407,7 +436,7 @@ bool CampoWizardPage3::ForwardValidate()
|
||||
|
||||
//se la directory dei dati è definitivamente farlocca (o l'utonto mente spudoratamente) allora errore!
|
||||
if (!bDataOk)
|
||||
return ErrorBox("La cartella indicata come area dati NON e' valida!\nInterrompere l'installazione e selezionare un'area dati valida\ncon il programma");
|
||||
return ErrorBox("La cartella indicata come area dati NON e' valida!\nInterrompere l'installazione e selezionare un'area dati valida\nper il programma");
|
||||
|
||||
//custom directories
|
||||
wxArrayString asPersonalizedFiles;
|
||||
@ -481,23 +510,11 @@ bool CampoWizardPage3::ForwardValidate()
|
||||
}
|
||||
else //resetta il path in caso si scelga nuova installazione dopo aver scelto aggiornamento
|
||||
{
|
||||
//continuiamo a sconsigliare l'installazione DEMO, ma ognuno fa come crede...
|
||||
if (GetBool(302))
|
||||
{
|
||||
const wxString strPrgDemoPath = "c:/campodemo";
|
||||
wxDir dirPrgDemoPath(strPrgDemoPath);
|
||||
if (dirPrgDemoPath.Exists(strPrgDemoPath) && (dirPrgDemoPath.HasFiles() || dirPrgDemoPath.HasSubDirs()))
|
||||
return ErrorBox("Impossibile installare la versione DEMO!\nLa cartella c:/campodemo NON e' vuota!");
|
||||
|
||||
GetWizard().SetInstDemoVersion(true);
|
||||
GetWizard().SetPrgLocPath(strPrgDemoPath);
|
||||
GetWizard().SetInstallationType(it_standalone);
|
||||
}
|
||||
|
||||
//NUOVA INSTALLAZIONE
|
||||
//-------------------
|
||||
//questo lo fa in ogni caso!
|
||||
GetWizard().SetDestinationPath("");
|
||||
GetWizard().SetDesktopShortcut(true);
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -593,21 +610,6 @@ CampoWizardPage3::CampoWizardPage3(wxWizard* parent) : CampoWizardPage(parent)
|
||||
|
||||
GetSizer()->Add(m_pRadioBox);
|
||||
|
||||
//se NON ci sono installazioni gia' presenti e NON c'e' alcuna chiave collegata -> puo' installare la DEMO
|
||||
if (asCampi.GetCount() == 1 && !LocalDongleTest())
|
||||
{
|
||||
//checkbox per installare la DEMO (non fatelo, vi prego!!!)
|
||||
wxCheckBox* chDemoPrg = new wxCheckBox(this, 302, wxT("Installare la versione DEMO"));
|
||||
chDemoPrg->SetValue(false);
|
||||
GetSizer()->AddSpacer(16);
|
||||
GetSizer()->Add(chDemoPrg);
|
||||
|
||||
strBody += wxT("<p>E' possibile anche installare la versione <b>DEMO di <i>PRODUCT</i></b>. <u>Questa versione e' a scopo puramente ");
|
||||
strBody += wxT("dimostrativo e <b>NON</b> va di norma installata! Non e' utilizzabile come la versione normale</u> in quanto limitata nel ");
|
||||
strBody += wxT("numero e nella data delle registrazioni e nel tempo di uso giornaliero (max 2 ore). La cartella di installazione della ");
|
||||
strBody += wxT("versione dimostrativa e' C:/campodemo e dispone di un'area dati parzialmente precompilata.</p>");
|
||||
}
|
||||
|
||||
SetHTMLText(strTitle, strBody);
|
||||
}
|
||||
|
||||
@ -678,7 +680,30 @@ bool CampoWizardPage4::ForwardValidate()
|
||||
GetWizard().SetSrvAuth(Get(404));
|
||||
int nDongleType = DongleTest();
|
||||
if (nDongleType == 0)
|
||||
return ErrorBox("Per proseguire e' NECESSARIO installare una chiave locale o collegarsi ad una chiave di rete!");
|
||||
{
|
||||
//return ErrorBox("Per proseguire e' NECESSARIO installare una chiave locale o collegarsi ad una chiave di rete!"); kazzone
|
||||
const bool bDemo = YesNoBox("Non è stata rilevata alcuna chiave di protezione locale e/o di rete!\n"
|
||||
"E' possibile installare solo la versione DEMO del software!\n"
|
||||
"Proseguire con installazione DEMO?");
|
||||
|
||||
if (bDemo)
|
||||
{
|
||||
GetWizard().SetInstDemoVersion(true);
|
||||
const wxString strPrgDemo = "c:/campodemo";
|
||||
GetWizard().SetPrgLocPath(strPrgDemo);
|
||||
GetWizard().SetDataPath(strPrgDemo + "/datidemo");
|
||||
GetWizard().SetInstallationType(it_standalone);
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
GetWizard().SetInstDemoVersion(false);
|
||||
GetWizard().SetInstallationType(it_none);
|
||||
GetWizard().SetPrgLocPath(wxEmptyString);
|
||||
GetWizard().SetDataPath(wxEmptyString);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -1473,6 +1498,41 @@ bool CampoWizardPage9::TransferDataToWindow()
|
||||
|
||||
Set(902, bChkTeleass);
|
||||
|
||||
bool bInstDemoVersion = GetWizard().GetInstDemoVersion();
|
||||
//l'installatore della teleassistenza ci va solo nella versione AGA;quindi controlla il producer nell'install.ini...
|
||||
//..che c'è appena sopra di lui in program
|
||||
wxString strTitle = wxT("Collegamenti e Teleassistenza");
|
||||
wxString strBody;
|
||||
strBody += wxT("<p>E' possibile creare l'icona di PRODUCT sul desktop.</p>");
|
||||
if (FindReseller() <= 0 && !bInstDemoVersion)
|
||||
{
|
||||
strBody += wxT("<p>E' possibile installare il programma di teleassistenza UltraVNC. E' il software che consente");
|
||||
strBody += wxT(" ai tecnici dell'assistenza di controllare il computer su cui si installa PRODUCT in caso di problemi gravi.");
|
||||
strBody += wxT(" Se la casella risulta NON spuntata in automatico il programma di teleassistenza e' gia' presente");
|
||||
strBody += wxT(" sul computer e non deve essere reinstallato.</p>");
|
||||
}
|
||||
|
||||
|
||||
//è stato inopinatamente scelto di installare la DEMO
|
||||
if (bInstDemoVersion)
|
||||
{
|
||||
strBody += wxT("<hr><b>Installazione versione DEMO</b>");
|
||||
|
||||
strBody += wxT("<p>Si sta installando la versione <b>DEMO di <i>PRODUCT !!</i></b>. <u>Questa versione e' a scopo puramente ");
|
||||
strBody += wxT("dimostrativo e <b>NON</b> va di norma installata! Non e' utilizzabile come la versione normale</u> in quanto limitata nel ");
|
||||
strBody += wxT("numero e nella data delle registrazioni e nel tempo di uso giornaliero (max 2 ore). La cartella di installazione della ");
|
||||
strBody += wxT("versione dimostrativa e' C:/campodemo e dispone di un'area dati parzialmente precompilata.</p>");
|
||||
|
||||
FindControlById(902)->Hide();
|
||||
Set(902, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
FindControlById(902)->Show();
|
||||
}
|
||||
|
||||
SetHTMLText(strTitle, strBody);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1495,21 +1555,6 @@ bool CampoWizardPage9::ForwardValidate()
|
||||
|
||||
CampoWizardPage9::CampoWizardPage9(wxWizard* parent) : CampoWizardPage(parent)
|
||||
{
|
||||
//l'installatore della teleassistenza ci va solo nella versione AGA;quindi controlla il producer nell'install.ini...
|
||||
//..che c'è appena sopra di lui in program
|
||||
wxString strTitle = wxT("Collegamenti e Teleassistenza");
|
||||
wxString strBody;
|
||||
strBody += wxT("<p>E' possibile creare l'icona di PRODUCT sul desktop.</p>");
|
||||
if (FindReseller() <= 0)
|
||||
{
|
||||
strBody += wxT("<p>E' possibile installare il programma di teleassistenza UltraVNC. E' il software che consente");
|
||||
strBody += wxT(" ai tecnici dell'assistenza di controllare il computer su cui si installa PRODUCT in caso di problemi gravi.");
|
||||
strBody += wxT(" Se la casella risulta NON spuntata in automatico il programma di teleassistenza e' gia' presente");
|
||||
strBody += wxT(" sul computer e non deve essere reinstallato.</p>");
|
||||
}
|
||||
|
||||
SetHTMLText(strTitle, strBody);
|
||||
|
||||
wxCheckBox* pIcon = new wxCheckBox(this, 901, wxT("Creare l'icona sul desktop"));
|
||||
GetSizer()->Add(pIcon, 0, wxALL, 0);
|
||||
|
||||
@ -1556,6 +1601,8 @@ bool CampoWizardPage10::TransferDataToWindow()
|
||||
CampoWizard& cw = GetWizard();
|
||||
|
||||
_uInstallType = cw.GetInstallationType();
|
||||
_bInstDemoVersion = cw.GetInstDemoVersion();
|
||||
|
||||
switch (_uInstallType)
|
||||
{
|
||||
case it_server: //server
|
||||
@ -1583,10 +1630,11 @@ bool CampoWizardPage10::TransferDataToWindow()
|
||||
_strSrvDict = cw.GetSrvDict();
|
||||
break;
|
||||
default: //standard
|
||||
if (cw.GetInstDemoVersion())
|
||||
if (_bInstDemoVersion)
|
||||
{
|
||||
_strInstallType = "DEMO";
|
||||
_strPrgLocPath = "c:/campodemo";
|
||||
_strDataPath = _strPrgLocPath + "/datidemo";
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1618,12 +1666,14 @@ bool CampoWizardPage10::TransferDataToWindow()
|
||||
{
|
||||
strTitle += wxT("INSTALLAZIONE: riepilogo configurazione");
|
||||
//DEMO (aaarrgh!)
|
||||
if (cw.GetInstDemoVersion())
|
||||
if (_bInstDemoVersion)
|
||||
{
|
||||
strBody = wxT("<p>Tipo installazione selezionata: ");
|
||||
strBody += wxT("<b>DEMO</b></p>");
|
||||
strBody += wxT("<p>Cartella dove installare il programma: ");
|
||||
strBody += wxT("<p>Cartella dove installare il programma DEMO: ");
|
||||
strBody += wxT("<b>C:/campodemo</b></p>");
|
||||
strBody += wxT("<p>Cartella dati dimostrativi: ");
|
||||
strBody += wxT(Bold(_strDataPath) + "</p>");
|
||||
}
|
||||
else //tutte le altre
|
||||
{
|
||||
@ -1666,8 +1716,8 @@ bool CampoWizardPage10::TransferDataToWindow()
|
||||
strBody += wxT(Bold("Nel menu esecuzione automatica") + "</p>");
|
||||
}
|
||||
|
||||
//installazione dati demo (solo in postazione singola)
|
||||
if (_uInstallType == it_standalone && _bInstDemoData)
|
||||
//installazione dati demo (solo in postazione singola; è obbligatoria in modalità DEMO, quindi niente scritta)
|
||||
if (_uInstallType == it_standalone && _bInstDemoData && !_bInstDemoVersion)
|
||||
strBody += wxT("<p>Installazione area dati dimostrativa</p>");
|
||||
|
||||
if (_bDesktopShortcut)
|
||||
@ -1738,20 +1788,9 @@ void CampoWizard::Set(wxWindowID id, const wxString str)
|
||||
void CampoWizard::SetDestinationPath(const wxString& path)
|
||||
{
|
||||
_strDestinationPath = path;
|
||||
//Se il path di destinazione e' vuoto -> nuova installazione, senno' e' un aggiornamento della installazione..
|
||||
//..che sta in _strDestinationPath
|
||||
if (_strDestinationPath.IsEmpty())
|
||||
{
|
||||
//installazione
|
||||
if (GetInstDemoVersion())
|
||||
wxWizardPageSimple::Chain(m_pPage[2], m_pPage[8]); //installazione DEMO
|
||||
else
|
||||
{
|
||||
wxWizardPageSimple::Chain(m_pPage[2], m_pPage[3]); //installazione nuova normale
|
||||
wxWizardPageSimple::Chain(m_pPage[3], m_pPage[4]);
|
||||
}
|
||||
}
|
||||
else
|
||||
//Se il path di destinazione e' vuoto -> nuova installazione, quindi lascia la concatenazione normale,
|
||||
//senno' e' un aggiornamento della installazione che sta in _strDestinationPath
|
||||
if (!_strDestinationPath.IsEmpty())
|
||||
{
|
||||
//aggiornamento
|
||||
CampoWizardPage4* page4 = (CampoWizardPage4*)m_pPage[3];
|
||||
@ -1791,10 +1830,11 @@ void CampoWizard::SetInstallationType(const InstallationType nType)
|
||||
//if demo
|
||||
if (GetInstDemoVersion())
|
||||
{
|
||||
wxWizardPageSimple::Chain(m_pPage[2], m_pPage[8]); //manda l'utente alla pagina riassuntiva senza controllo chiave
|
||||
wxWizardPageSimple::Chain(m_pPage[3], m_pPage[8]); //manda l'utente alla pagina riassuntiva senza controllo chiave
|
||||
}
|
||||
else
|
||||
{
|
||||
wxWizardPageSimple::Chain(m_pPage[3], m_pPage[4]); //nel caso si sia trovata una chiave al secondo tentativo deve resettare
|
||||
wxWizardPageSimple::Chain(m_pPage[4], m_pPage[5]); //manda l'utente alla pagina standard
|
||||
wxWizardPageSimple::Chain(m_pPage[5], m_pPage[8]); //dalla standard alla pagina riassuntiva
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user