Patch level :

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :


git-svn-id: svn://10.65.10.50/trunk@15724 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca 2007-10-18 14:51:26 +00:00
parent fdcdb2c058
commit 7333e16d05
5 changed files with 60 additions and 58 deletions

View File

@ -609,14 +609,14 @@ void CampoSetup::NormalSetup()
// 1) RACCOLTA PARAMETRI GENERALI INSTALLAZIONE (tipo,path,cartelle,servers,...) // 1) RACCOLTA PARAMETRI GENERALI INSTALLAZIONE (tipo,path,cartelle,servers,...)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
//tipo di installazione/aggiornamento //tipo di installazione/aggiornamento
const unsigned int uInstallationType = m_pWizard->GetInstallationType(); const InstallationType uInstallationType = m_pWizard->GetInstallationType();
const bool bNewInstallation = uInstallationType < 3; const bool bNewInstallation = uInstallationType != it_upgrade;
//installazione servers? solo per server di campo //installazione servers? solo per server di campo
const bool bInstallLurch = uInstallationType == 1 && (m_pWizard->GetInstUseAuth() || m_pWizard->GetInstUseDict()); 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 //uso servers? sarebbe solo per i client ma lo teniamo buono per tutti
const bool bUseLurch = uInstallationType != 1 && (!m_pWizard->GetSrvAuth().IsEmpty() || !m_pWizard->GetSrvDict().IsEmpty()); 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) //installazione datidemo? (oddio speriamo di no!; comunque vale solo per installazione standard)
const bool bInstallDemoData = uInstallationType == 0 && m_pWizard->GetInstDemoData(); const bool bInstallDemoData = uInstallationType == it_standalone && m_pWizard->GetInstDemoData();
//cartelle selezionate dall'utente //cartelle selezionate dall'utente
const wxString& strPrgLocPath = m_pWizard->GetPrgLocPath(); const wxString& strPrgLocPath = m_pWizard->GetPrgLocPath();
const wxString& strDataPath = m_pWizard->GetDataPath(); const wxString& strDataPath = m_pWizard->GetDataPath();
@ -745,8 +745,8 @@ void CampoSetup::NormalSetup()
CampoIniMain.Set("Study", strDataPath); CampoIniMain.Set("Study", strDataPath);
CampoIniMain.Set("Firm", "com"); CampoIniMain.Set("Firm", "com");
//client o non client? //client o non client?
//(attenzione che in Campo e' Std=1 Srv=2 Cli=3, mentre qui e' Std=0 Srv=1 Cli=2) //(attenzione che in Campo e' Std=1 Srv=2 Cli=3)
CampoIniMain.Set("Type", uInstallationType + 1); CampoIniMain.Set("Type", uInstallationType);
} }
//paragrafo [Server] //paragrafo [Server]
if (bInstallLurch || bUseLurch) if (bInstallLurch || bUseLurch)
@ -762,7 +762,7 @@ void CampoSetup::NormalSetup()
//SOLO se sta aggiornando una versione antecedente alla 10.0 scrive la variabile Type nel campo.ini.. //SOLO se sta aggiornando una versione antecedente alla 10.0 scrive la variabile Type nel campo.ini..
//..ovvero deve testare se Type = 0 //..ovvero deve testare se Type = 0
if (CampoIniMain.GetInt("Type") == 0) if (CampoIniMain.GetInt("Type") == 0)
CampoIniMain.Set("Type", CampoIniMain.GetInstallationTypeNumber()); CampoIniMain.Set("Type", CampoIniMain.GetInstallationType());
} }
// 5) COMPILAZIONE\AGGIORNAMENTO INSTALL.INI CON DISKPATH // 5) COMPILAZIONE\AGGIORNAMENTO INSTALL.INI CON DISKPATH
@ -771,7 +771,7 @@ void CampoSetup::NormalSetup()
//parentesi necessaria per la scrittura immediata (non cancellare! serve per debug) //parentesi necessaria per la scrittura immediata (non cancellare! serve per debug)
{ {
CampoIniFile CampoInstall(strPrgLocPath + "/install.ini", "Main"); CampoIniFile CampoInstall(strPrgLocPath + "/install.ini", "Main");
if (uInstallationType == 2) //client: directory origine sul server if (uInstallationType == it_client) //client: directory origine sul server
CampoInstall.Set("DiskPath", m_pWizard->GetPrgNetPath()); CampoInstall.Set("DiskPath", m_pWizard->GetPrgNetPath());
else //e' il path assoluto dell'install.ini che sta in 'program' (es. D:\program) else //e' il path assoluto dell'install.ini che sta in 'program' (es. D:\program)
{ {
@ -786,9 +786,9 @@ void CampoSetup::NormalSetup()
//------------------------------------------------ //------------------------------------------------
//solo se sta installando campo in postazione server e deve installare un gestore di servizi.. //solo se sta installando campo in postazione server e deve installare un gestore di servizi..
//..avvia la procedura della creazione dell'autostart(un casino) //..avvia la procedura della creazione dell'autostart(un casino)
if (bInstallLurch) const int iSrvAutostartMode = m_pWizard->GetSrvAutostartMode();
if (iSrvAutostartMode != lm_none)
{ {
const int iSrvAutostartMode = m_pWizard->GetSrvAutostartMode();
CreateAutostartMode(iSrvAutostartMode, strPrgLocPath); CreateAutostartMode(iSrvAutostartMode, strPrgLocPath);
} }
@ -809,16 +809,13 @@ void CampoSetup::NormalSetup()
wxString strLnk; wxString strLnk;
CampoIniFile CampoIniMain(strPrgLocPath + "/campo.ini", "Main"); CampoIniFile CampoIniMain(strPrgLocPath + "/campo.ini", "Main");
int nInstType = CampoIniMain.GetInstallationTypeNumber(); InstallationType nInstType = CampoIniMain.GetInstallationType();
switch (nInstType) switch (nInstType)
{ {
case 1: case it_server:
strLnk = "Campo";
break;
case 2:
strLnk = "Campo (Server)"; strLnk = "Campo (Server)";
break; break;
case 3: case it_client:
strLnk = "Campo (Client)"; strLnk = "Campo (Client)";
break; break;
default: default:

View File

@ -137,12 +137,12 @@ bool CampoIniFile::Set(const wxString strVariable, const int uValue)//, const wx
//metodo per sapere che cavolo di tipo di installazione sta esaminando (serve per leggere e scrivere... //metodo per sapere che cavolo di tipo di installazione sta esaminando (serve per leggere e scrivere...
//...correttamente il campo.ini //...correttamente il campo.ini
int CampoIniFile::GetInstallationTypeNumber() const InstallationType CampoIniFile::GetInstallationType() const
{ {
int nType = GetInt("Type"); InstallationType nType = (InstallationType)GetInt("Type");
if (nType < 1 || nType > 3) if (nType < it_standalone || nType > it_client)
{ {
nType = 1; //di base e' standalone nType = it_standalone; //di base e' standalone
const bool bTestDataBase = GetBool("TestDatabase"); const bool bTestDataBase = GetBool("TestDatabase");
const bool bTestPrograms = GetBool("TestPrograms"); const bool bTestPrograms = GetBool("TestPrograms");
@ -152,10 +152,10 @@ int CampoIniFile::GetInstallationTypeNumber() const
//se la directory dei dati e' condivisa in scrittura e' un server (almeno al 99%) //se la directory dei dati e' condivisa in scrittura e' un server (almeno al 99%)
const wxString strStudy = Get("Study"); const wxString strStudy = Get("Study");
if (IsSharedDirectory(strStudy)) if (IsSharedDirectory(strStudy))
nType = 2; //e' server nType = it_server; //e' server
} }
else //..senno' e' client else //..senno' e' client
nType = 3; nType = it_client;
} }
return nType; return nType;
} }

View File

@ -1,6 +1,10 @@
#ifndef __UTILS_H #ifndef __UTILS_H
#define __UTILS_H #define __UTILS_H
// lista dei tipi di installazione 0=non si sa, 1=standalone, 2=server, 3=client
enum InstallationType { it_none, it_standalone, it_server, it_client, it_upgrade = 9 };
enum LurchMode {lm_none, lm_service, lm_autostart};
//////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////
//Classe per la gestione dei files di configurazione tipo campo.ini //Classe per la gestione dei files di configurazione tipo campo.ini
class CampoIniFile : public wxFileConfig class CampoIniFile : public wxFileConfig
@ -11,7 +15,7 @@ public:
bool GetBool(const wxString strVariable) const; bool GetBool(const wxString strVariable) const;
int GetInt (const wxString strVariable) const; int GetInt (const wxString strVariable) const;
bool Set(const wxString strVariable, const wxString strValue); bool Set(const wxString strVariable, const wxString strValue);
int GetInstallationTypeNumber() const; InstallationType GetInstallationType() const;
bool Set(const wxString strVariable, const int uValue); bool Set(const wxString strVariable, const int uValue);
CampoIniFile(const wxString strIniPath, wxString strValue); CampoIniFile(const wxString strIniPath, wxString strValue);

View File

@ -2,7 +2,6 @@
#include "key.h" #include "key.h"
#include "wizard.h" #include "wizard.h"
#include "utils.h"
#define HGAP 4 #define HGAP 4
#define VGAP 2 #define VGAP 2
@ -286,10 +285,10 @@ bool CampoWizardPage3::ForwardValidate()
CampoIniFile CampoIni(strPrgPath + "/campo.ini", "Main"); CampoIniFile CampoIni(strPrgPath + "/campo.ini", "Main");
//cerca il tipo dell'installazione //cerca il tipo dell'installazione
int nType = CampoIni.GetInstallationTypeNumber(); InstallationType nType = CampoIni.GetInstallationType();
//se risulta un client... //se risulta un client...
if (nType == 3) if (nType == it_client)
{ {
CampoIniFile InstallIni(strPrgPath + "/install.ini", "Main"); CampoIniFile InstallIni(strPrgPath + "/install.ini", "Main");
wxString strDiskPath = InstallIni.Get("DiskPath"); wxString strDiskPath = InstallIni.Get("DiskPath");
@ -316,7 +315,7 @@ bool CampoWizardPage3::ForwardValidate()
//setta alla pagina riassuntiva i valori della pagina attuale... //setta alla pagina riassuntiva i valori della pagina attuale...
GetWizard().SetDestinationPath(strPrgPath); //va alla pagina riassuntiva GetWizard().SetDestinationPath(strPrgPath); //va alla pagina riassuntiva
GetWizard().SetPrgLocPath(strPrgPath); //questo serve solo per la creazione del link sul desktop! GetWizard().SetPrgLocPath(strPrgPath); //questo serve solo per la creazione del link sul desktop!
GetWizard().SetInstallationType(3); //e' un aggiornamento!! GetWizard().SetInstallationType(it_upgrade); //e' un aggiornamento!!
GetWizard().SetDesktopShortcut(false); //e' sempre un aggiornamento! GetWizard().SetDesktopShortcut(false); //e' sempre un aggiornamento!
} }
else //resetta il path in caso si scelga nuova installazione dopo aver scelto aggiornamento else //resetta il path in caso si scelga nuova installazione dopo aver scelto aggiornamento
@ -368,19 +367,17 @@ CampoWizardPage3::CampoWizardPage3(wxWizard* parent) : CampoWizardPage(parent)
{ {
//controlla il tipo di installazione rilevata (Standalone,Server,Client) //controlla il tipo di installazione rilevata (Standalone,Server,Client)
CampoIniFile iniCampo(strPath + "/campo.ini", "Main"); CampoIniFile iniCampo(strPath + "/campo.ini", "Main");
const int nType = iniCampo.GetInstallationTypeNumber(); const InstallationType nType = iniCampo.GetInstallationType();
switch (nType) switch (nType)
{ {
case 1: case it_server:
strPath << " (Standard)";
break;
case 2:
strPath << " (Server)"; strPath << " (Server)";
break; break;
case 3: case it_client:
strPath << " (Client)"; strPath << " (Client)";
break; break;
default: default:
strPath << " (Standard)";
break; break;
} }
asCampi.Add(strPath); asCampi.Add(strPath);
@ -388,7 +385,7 @@ CampoWizardPage3::CampoWizardPage3(wxWizard* parent) : CampoWizardPage(parent)
//..sulla stessa macchina //..sulla stessa macchina
if (prechecked < 0) if (prechecked < 0)
{ {
if (nType == 1 || nType == 2) if (nType == it_standalone || nType == it_server)
prechecked = i; prechecked = i;
} }
} //if(CheckPrgDir(strPath)... } //if(CheckPrgDir(strPath)...
@ -740,8 +737,9 @@ public:
bool CampoWizardPage5::ForwardValidate() bool CampoWizardPage5::ForwardValidate()
{ {
const unsigned int type = m_pRadioBox->GetSelection(); // controlla il tipo di installazione!
GetWizard().SetInstallationType(type); const int nType = m_pRadioBox->GetSelection() + 1;
GetWizard().SetInstallationType((InstallationType)nType);
return true; return true;
} }
@ -969,10 +967,11 @@ bool CampoWizardPage7::ForwardValidate()
//..e loro modalita' di esecuzione //..e loro modalita' di esecuzione
if (bInstAuth || bInstDict) if (bInstAuth || bInstDict)
{ {
GetWizard().SetSrvAutostartMode(m_pRadioBox->GetSelection()); int nType = m_pRadioBox->GetSelection();
GetWizard().SetSrvAutostartMode((LurchMode)nType);
} }
else else
GetWizard().SetSrvAutostartMode(-1); GetWizard().SetSrvAutostartMode(lm_none);
return true; return true;
} }
@ -1311,7 +1310,7 @@ CampoWizardPage9::CampoWizardPage9(wxWizard* parent) : CampoWizardPage(parent)
/**********************************************************************************************************/ /**********************************************************************************************************/
class CampoWizardPage10 : public CampoWizardPage class CampoWizardPage10 : public CampoWizardPage
{ {
unsigned int _uInstallType; InstallationType _uInstallType;
wxString _strInstallType; wxString _strInstallType;
wxString _strPrgLocPath; wxString _strPrgLocPath;
wxString _strPrgNetPath; wxString _strPrgNetPath;
@ -1337,7 +1336,7 @@ bool CampoWizardPage10::TransferDataToWindow()
_uInstallType = cw.GetInstallationType(); _uInstallType = cw.GetInstallationType();
switch (_uInstallType) switch (_uInstallType)
{ {
case 1: //server case it_server: //server
_strInstallType = "Server"; _strInstallType = "Server";
_strPrgLocPath = cw.GetPrgLocPath(); _strPrgLocPath = cw.GetPrgLocPath();
_strDataPath = cw.GetDataPath(); _strDataPath = cw.GetDataPath();
@ -1346,7 +1345,7 @@ bool CampoWizardPage10::TransferDataToWindow()
if (!_strSrvAuth.IsEmpty() || !_strSrvDict.IsEmpty()) if (!_strSrvAuth.IsEmpty() || !_strSrvDict.IsEmpty())
_iSrvAutostartMode = cw.GetSrvAutostartMode(); _iSrvAutostartMode = cw.GetSrvAutostartMode();
break; break;
case 2: //client case it_client: //client
_strInstallType = "Client"; _strInstallType = "Client";
_strPrgLocPath = cw.GetPrgLocPath(); _strPrgLocPath = cw.GetPrgLocPath();
_strPrgNetPath = cw.GetPrgNetPath(); _strPrgNetPath = cw.GetPrgNetPath();
@ -1354,7 +1353,7 @@ bool CampoWizardPage10::TransferDataToWindow()
_strSrvAuth = cw.GetSrvAuth(); _strSrvAuth = cw.GetSrvAuth();
_strSrvDict = cw.GetSrvDict(); _strSrvDict = cw.GetSrvDict();
break; break;
case 3: //aggiornamento case it_upgrade: //aggiornamento
_strInstallType = ""; _strInstallType = "";
_strPrgLocPath = cw.GetDestinationPath(); _strPrgLocPath = cw.GetDestinationPath();
_strDataPath = cw.GetDataPath(); _strDataPath = cw.GetDataPath();
@ -1384,7 +1383,7 @@ bool CampoWizardPage10::TransferDataToWindow()
wxString strBody; wxString strBody;
//Aggiornamento //Aggiornamento
if (_uInstallType == 3) if (_uInstallType == it_upgrade)
{ {
strTitle += wxT("AGGIORNAMENTO: riepilogo configurazione"); strTitle += wxT("AGGIORNAMENTO: riepilogo configurazione");
@ -1537,21 +1536,21 @@ const wxString& CampoWizard::GetDestinationPath() const
return _strDestinationPath; return _strDestinationPath;
} }
void CampoWizard::SetInstallationType(const unsigned int type) void CampoWizard::SetInstallationType(const InstallationType nType)
{ {
_uInstallationType = type; _uInstallationType = nType;
//in base al tipo di installazione spara l'utente alla pagina corretta //in base al tipo di installazione spara l'utente alla pagina corretta
switch (_uInstallationType) switch (_uInstallationType)
{ {
case 1: //server case it_server: //server
wxWizardPageSimple::Chain(m_pPage[4], m_pPage[6]); //manda l'utente alla pagina server wxWizardPageSimple::Chain(m_pPage[4], m_pPage[6]); //manda l'utente alla pagina server
wxWizardPageSimple::Chain(m_pPage[6], m_pPage[8]); //dal server alla pagina riassuntiva wxWizardPageSimple::Chain(m_pPage[6], m_pPage[8]); //dal server alla pagina riassuntiva
break; break;
case 2: //client case it_client: //client
wxWizardPageSimple::Chain(m_pPage[4], m_pPage[7]); //manda l'utente alla pagina client wxWizardPageSimple::Chain(m_pPage[4], m_pPage[7]); //manda l'utente alla pagina client
wxWizardPageSimple::Chain(m_pPage[7], m_pPage[8]); //dal client alla pagina riassuntiva wxWizardPageSimple::Chain(m_pPage[7], m_pPage[8]); //dal client alla pagina riassuntiva
break; break;
case 3: //aggiornamento installazione precedente case it_upgrade: //aggiornamento installazione precedente
wxWizardPageSimple::Chain(m_pPage[3], m_pPage[8]); //manda l'utente alla pagina riassuntiva wxWizardPageSimple::Chain(m_pPage[3], m_pPage[8]); //manda l'utente alla pagina riassuntiva
break; break;
default: //standard default: //standard
@ -1569,7 +1568,7 @@ void CampoWizard::SetInstallationType(const unsigned int type)
} }
} }
const unsigned int CampoWizard::GetInstallationType() const const InstallationType CampoWizard::GetInstallationType() const
{ {
return _uInstallationType; return _uInstallationType;
} }
@ -1654,12 +1653,12 @@ const wxString& CampoWizard::GetSrvDict() const
return _strSrvDict; return _strSrvDict;
} }
void CampoWizard::SetSrvAutostartMode(const int iSrvAutostartMode) void CampoWizard::SetSrvAutostartMode(const LurchMode iSrvAutostartMode)
{ {
_iSrvAutostartMode = iSrvAutostartMode; _iSrvAutostartMode = iSrvAutostartMode;
} }
const int CampoWizard::GetSrvAutostartMode() const const LurchMode CampoWizard::GetSrvAutostartMode() const
{ {
return _iSrvAutostartMode; return _iSrvAutostartMode;
} }

View File

@ -1,6 +1,8 @@
#ifndef __WIZARD_H #ifndef __WIZARD_H
#define __WIZARD_H #define __WIZARD_H
#include "utils.h"
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
// CampoWizardPage // CampoWizardPage
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
@ -12,7 +14,7 @@ class CampoWizard : public wxWizard
CampoWizardPage* m_pPage[m_nPages]; CampoWizardPage* m_pPage[m_nPages];
wxString _strDestinationPath; //path di aggiornamento/installazione wxString _strDestinationPath; //path di aggiornamento/installazione
unsigned int _uInstallationType; //tipo di installazione selezionata (standard,server,client,aggiornamento) InstallationType _uInstallationType; //tipo di installazione selezionata (standard,server,client,aggiornamento)
unsigned int _uDongleType; //tipo di chiave di protezione (hardlock,eutron,server) unsigned int _uDongleType; //tipo di chiave di protezione (hardlock,eutron,server)
wxString _strPrgLocPath; //path programmi in locale wxString _strPrgLocPath; //path programmi in locale
@ -26,7 +28,7 @@ class CampoWizard : public wxWizard
bool _bInstUseDict; //installa/usa server diction bool _bInstUseDict; //installa/usa server diction
wxString _strSrvDict; //nome server diction wxString _strSrvDict; //nome server diction
unsigned int _iSrvAutostartMode; //tipologia di esecuzione dei server LurchMode _iSrvAutostartMode; //tipologia di esecuzione dei server
bool _bDesktopShortcut; //crea il link sul desktop bool _bDesktopShortcut; //crea il link sul desktop
protected: protected:
@ -47,8 +49,8 @@ public:
//metodi per il passaggio tra le finestre dei parametri di installazione! //metodi per il passaggio tra le finestre dei parametri di installazione!
void SetDestinationPath(const wxString& strPath); void SetDestinationPath(const wxString& strPath);
const wxString& GetDestinationPath() const; const wxString& GetDestinationPath() const;
void SetInstallationType(const unsigned int uType); void SetInstallationType(const InstallationType uType);
const unsigned int GetInstallationType() const; const InstallationType GetInstallationType() const;
void SetDongleType(const unsigned int uType); void SetDongleType(const unsigned int uType);
const unsigned int GetDongleType() const; const unsigned int GetDongleType() const;
@ -74,8 +76,8 @@ public:
void SetSrvDict(const wxString& strSrvDict); void SetSrvDict(const wxString& strSrvDict);
const wxString& GetSrvDict() const; const wxString& GetSrvDict() const;
void SetSrvAutostartMode(const int iSrvAutostartMode); void SetSrvAutostartMode(const LurchMode iSrvAutostartMode);
const int GetSrvAutostartMode() const; const LurchMode GetSrvAutostartMode() const;
void SetDesktopShortcut(const bool bDesktopShortcut); void SetDesktopShortcut(const bool bDesktopShortcut);
const bool GetDesktopShortcut() const; const bool GetDesktopShortcut() const;