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:
luca 2010-03-11 15:28:12 +00:00
parent 9863fed64d
commit 64cbcd1804
4 changed files with 515 additions and 447 deletions

View File

@ -935,70 +935,18 @@ void CampoSetup::NormalSetup()
//e' una DEMO o una versione normale? //e' una DEMO o una versione normale?
const bool bInstallDemoVersion = m_pWizard->GetInstDemoVersion(); const bool bInstallDemoVersion = m_pWizard->GetInstDemoVersion();
// 0) INSTALLAZIONE VERSIONE DEMO (SIETE PAZZI?)
//----------------------------------------------
if (bInstallDemoVersion)
{
const wxString& strPrgLocPath = "c:/campodemo";
const wxString& strDataPath = strPrgLocPath + "/dati";
const wxString& strHelpPath = strPrgLocPath + "/htmlhelp";
//creazione delle directories necessarie alla installazione DEMO
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");
}
}
else //tutti i casi normali (std,server,client,aggiornamento)
{
// 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 InstallationType uInstallationType = m_pWizard->GetInstallationType(); const InstallationType uInstallationType = m_pWizard->GetInstallationType();
const bool bNewInstallation = uInstallationType != it_upgrade; const bool bNewInstallation = uInstallationType != it_upgrade;
//installazione servers? solo per server di campo //installazione servers? solo per server di campo
const bool bInstallLurch = uInstallationType == it_server && (m_pWizard->GetInstUseAuth() || m_pWizard->GetInstUseDict()); 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 //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()); 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) //installazione datidemo? (oddio speriamo di no!; comunque vale solo per installazione standard)
const bool bInstallDemoData = uInstallationType == it_standalone && m_pWizard->GetInstDemoData(); const bool bInstallDemoData = uInstallationType == (it_standalone && m_pWizard->GetInstDemoData()) || (bInstallDemoVersion);
//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();
@ -1040,7 +988,7 @@ void CampoSetup::NormalSetup()
//..dati); strFileCurr va lasciato qui perche' DEVE ESSERE AZZERATO ad ogni cambio file!!!!!! //..dati); strFileCurr va lasciato qui perche' DEVE ESSERE AZZERATO ad ogni cambio file!!!!!!
wxString strFileCurr; wxString strFileCurr;
//controlla se il file corrente e' dentro una sottodirectory (tipo dati,servers,setup...) oppure e' al.. //controlla se il file corrente e' dentro una sottodirectory (tipo dati,servers,ecc...) oppure e' al..
//..primo livello (quindi e' un file di programma) //..primo livello (quindi e' un file di programma)
wxString strSourceFile = asFilesList[i].Lower(); wxString strSourceFile = asFilesList[i].Lower();
NormalizeSlash(strSourceFile); NormalizeSlash(strSourceFile);
@ -1051,7 +999,7 @@ void CampoSetup::NormalSetup()
//2A) files con subdirectory //2A) files con subdirectory
if (bIsSubDir) if (bIsSubDir)
{ {
//files dei dati standard! solo in caso di nuova installazione!! //files dei dati standard! solo in caso di nuova installazione!! E NON installazione DEMO!!
if (strSourceFile.Find("/dati/") > 0) if (strSourceFile.Find("/dati/") > 0)
{ {
//i DATI NON VANNO MAI installati in caso di aggiornamento!!! //i DATI NON VANNO MAI installati in caso di aggiornamento!!!
@ -1068,17 +1016,38 @@ void CampoSetup::NormalSetup()
if (wxFileName::FileExists(strFileCurr)) if (wxFileName::FileExists(strFileCurr))
strFileCurr = ""; strFileCurr = "";
} }
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 } else
if (strSourceFile.Find("/servers/") > 0) //che fare con i servers? copiare la directory... if (strSourceFile.Find("/servers/") > 0) //che fare con i servers? copiare la directory...
{ {
if (bInstallLurch) //..ma solo se devi installare i servers if (bInstallLurch && !bInstallDemoVersion) //..ma solo se devi installare i servers
{ {
strFileCurr = strPrgLocPath; strFileCurr = strPrgLocPath;
strFileCurr += "/servers"; strFileCurr += "/servers";
strFileCurr += asFilesList[i].Mid(nPathLenght + 8); strFileCurr += asFilesList[i].Mid(nPathLenght + 8);
} }
else
strFileCurr = "";
} }
else //files vari di altre subdirectory che si installano sempre (es. setup) else //files vari di altre subdirectory che si installano sempre (es. recdesc)
{ {
strFileCurr = strPrgLocPath; strFileCurr = strPrgLocPath;
strFileCurr += asFilesList[i].Mid(nPathLenght); strFileCurr += asFilesList[i].Mid(nPathLenght);
@ -1109,8 +1078,45 @@ void CampoSetup::NormalSetup()
} //for(size_t... } //for(size_t...
UpdateInstallIni(strSrc + "/install.ini", strPrgLocPath + "/install.ini", "sy"); UpdateInstallIni(strSrc + "/install.ini", strPrgLocPath + "/install.ini", "sy");
if (bInstallLurch)
UpdateInstallIni(strSrc + "/install.ini", strPrgLocPath + "/install.ini", "sr");
// 3) INSTALLAZIONE DATI DEMO
// 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! //installazione dei dati dimostrativi (che schifo!).Non si puo' fare in aggiornamento!
/* if (bInstallDemoData && uInstallationType < 3) /* if (bInstallDemoData && uInstallationType < 3)
@ -1176,6 +1182,7 @@ void CampoSetup::NormalSetup()
CampoIniMain.Set("Type", CampoIniMain.GetInstallationType()); CampoIniMain.Set("Type", CampoIniMain.GetInstallationType());
} }
// 5) 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 //..e modificare comunque l'install.ini aggiornando eventualmente l'origine dei programmi
@ -1191,6 +1198,7 @@ void CampoSetup::NormalSetup()
} }
} }
// 6) AGGIORNAMENTO DI ADMIN.INI CON IL TEMA DEL RESELLER // 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.. //carica il tema predefinito del reseller dentro l'admin.ini che sta in cartella programmi\dati\config..
@ -1313,7 +1321,6 @@ void CampoSetup::NormalSetup()
else else
ErrorBox("Impossibile installare i moduli. Cartella di destinazione irraggiungibile!"); ErrorBox("Impossibile installare i moduli. Cartella di destinazione irraggiungibile!");
}
} //if (m_pWizard->Run())... } //if (m_pWizard->Run())...
m_pWizard->Destroy(); m_pWizard->Destroy();

View File

@ -712,6 +712,7 @@ Owner=Ilaria Giardini
pd0001 -0=31-12-2010 pd0001 -0=31-12-2010
pd0300 -0=31-12-2010 pd0300 -0=31-12-2010
pd0350 -0=31-12-2010 pd0350 -0=31-12-2010
pd5317 -0=31-12-2010
pd6030 -0=31-12-2010 pd6030 -0=31-12-2010
pd6142 -0=31-12-2010 pd6142 -0=31-12-2010
pd6292 -0=31-12-2010 pd6292 -0=31-12-2010
@ -723,6 +724,9 @@ pd6292 -0=31-12-2010
[8482] [8482]
[8483] [8483]
[8484] [8484]
[8490]
OEM=0
Owner=AVIS Bolzano
[8499] [8499]
[8508] [8508]
[8509] [8509]
@ -792,7 +796,13 @@ pd5317 -0=31-12-2010
[8593] [8593]
OEM=1 OEM=1
Owner=Roberta Cavalleri Owner=Roberta Cavalleri
pd0001 -0=31-12-2010
pd0300 -0=31-12-2010
pd0350 -0=31-12-2010
pd5317 -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] [8594]
[8595] [8595]
[8596] [8596]
@ -886,11 +896,24 @@ OEM=2
Owner=Baldini Lavanderia Owner=Baldini Lavanderia
cg=31-03-2010 cg=31-03-2010
sc=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] [8798]
OEM=3 OEM=3
pi0001 -0=31-12-2010 pi0001 -0=31-12-2010
pi0001 -1=31-12-2010 pi0001 -1=31-12-2010
pi0001 -2=31-12-2010 pi0001 -2=31-12-2010
[8816]
OEM=0
Owner=AVIS Bolzano
[8818] [8818]
OEM=4 OEM=4
Owner=Zabban Guido snc Owner=Zabban Guido snc

View File

@ -15,15 +15,7 @@ extern "C"
/////////////////////////////// ///////////////////////////////
static int ThisYear() static int ThisYear()
{ {
int anno = 2006; return wxDateTime::Now().GetYear();
time_t lt;
if (time(&lt) == 0)
{
struct tm* timeloc = localtime(&lt) ;
if (timeloc != NULL)
anno = timeloc->tm_year + 1900;
}
return anno;
} }
/////////////////////////////// ///////////////////////////////
@ -183,7 +175,7 @@ void TBordello::Chiudi()
{ {
wxSocketClient* sc = (wxSocketClient*)it->second; wxSocketClient* sc = (wxSocketClient*)it->second;
if (sc != NULL) if (sc != NULL)
sc->Close(); sc->Destroy();
} }
} }
@ -279,6 +271,20 @@ unsigned short ServerLogin(int& year, wxString& strSrvName)
const unsigned short MaxSck = 256; const unsigned short MaxSck = 256;
for (int i = 0; i < MaxSck; i++) 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 //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('.'); wxString strSrvIP = strMyIP.BeforeLast('.');
strSrvIP << "." << i; //ip del computer remoto strSrvIP << "." << i; //ip del computer remoto
@ -293,15 +299,7 @@ unsigned short ServerLogin(int& year, wxString& strSrvName)
} }
} }
} }
m_bordello.Chiudi();
wxSleep(2);
wxSocketClient* sc = m_bordello.QuellaBuona();
if (sc != NULL)
{
wxIPV4address ipRemote;
sc->GetPeer(ipRemote);
strSrvName = ipRemote.Hostname();
}
} //if(strMyIP.Len()... } //if(strMyIP.Len()...
} //if(strSrvName.Is... } //if(strSrvName.Is...

View File

@ -24,6 +24,7 @@ protected:
bool CheckDataDir(wxString strDataPath) const; bool CheckDataDir(wxString strDataPath) const;
void CheckCustomDir(const wxString strCustomPath, const wxString& strPrgPath, wxArrayString& asPersonalizedFiles) const; void CheckCustomDir(const wxString strCustomPath, const wxString& strPrgPath, wxArrayString& asPersonalizedFiles) const;
bool CheckPrgDir(const wxString& strPrgPath) const; bool CheckPrgDir(const wxString& strPrgPath) const;
wxControl* FindControlById(wxWindowID id) const;
public: public:
virtual bool ForwardValidate() { return true; } virtual bool ForwardValidate() { return true; }
@ -36,29 +37,48 @@ public:
CampoWizardPage(wxWizard* parent); CampoWizardPage(wxWizard* parent);
}; };
wxControl* CampoWizardPage::FindControlById(wxWindowID id) const
{
wxWindow* pWnd = FindWindowById(id, this);
return wxDynamicCast(pWnd, wxControl);
}
wxString CampoWizardPage::Get(wxWindowID id) const wxString CampoWizardPage::Get(wxWindowID id) const
{ {
wxWindow* pWnd = FindWindowById(id); wxControl* pWnd = FindControlById(id);
return pWnd ? pWnd->GetLabel() : wxEmptyString; 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 bool CampoWizardPage::GetBool(wxWindowID id) const
{ {
wxCheckBox* pWnd = (wxCheckBox*)FindWindowById(id); wxCheckBox* pWnd = wxDynamicCast(FindControlById(id), wxCheckBox);
return pWnd != NULL && pWnd->IsChecked(); return pWnd != NULL && pWnd->GetValue();
} }
bool CampoWizardPage::Set(wxWindowID id, const wxString& str) bool CampoWizardPage::Set(wxWindowID id, const wxString& str)
{ {
wxWindow* pWnd = FindWindowById(id); wxControl* pWnd = FindControlById(id);
if (pWnd) if (pWnd)
pWnd->SetLabel(str); {
wxTextCtrl* pText = wxDynamicCast(pWnd, wxTextCtrl);
if (pText != NULL)
pText->ChangeValue(str);
else
pText->SetLabel(str);
}
return (pWnd != NULL); return (pWnd != NULL);
} }
bool CampoWizardPage::Set(wxWindowID id, const bool bul) bool CampoWizardPage::Set(wxWindowID id, const bool bul)
{ {
wxCheckBox* pWnd = (wxCheckBox*)FindWindowById(id); wxCheckBox* pWnd = wxDynamicCast(FindControlById(id), wxCheckBox);
if (pWnd) if (pWnd)
pWnd->SetValue(bul); pWnd->SetValue(bul);
return (pWnd != NULL); return (pWnd != NULL);
@ -67,11 +87,18 @@ bool CampoWizardPage::Set(wxWindowID id, const bool bul)
int CampoWizardPage::GetSelection(wxWindowID id) const int CampoWizardPage::GetSelection(wxWindowID id) const
{ {
int n = -1; int n = -1;
wxWindow* pWnd = FindWindowById(id); wxWindow* pWnd = FindControlById(id);
if (pWnd) if (pWnd)
{ {
wxChoice* pList = (wxChoice*)pWnd; wxChoice* pList = wxDynamicCast(pWnd, wxChoice);
if (pList != NULL)
n = pList->GetSelection(); n = pList->GetSelection();
else
{
wxRadioBox* pRadio = wxDynamicCast(pWnd, wxRadioBox);
if (pRadio != NULL)
n = pRadio->GetSelection();
}
} }
return n; return n;
} }
@ -300,8 +327,8 @@ CampoWizardPage2::CampoWizardPage2(wxWizard* parent) : CampoWizardPage(parent)
wxArrayString asAccRef; wxArrayString asAccRef;
asAccRef.Add("Accetta"); asAccRef.Add("Accetta");
asAccRef.Add("Rifiuta"); asAccRef.Add("Rifiuta");
wxRadioBox* radio_box = new wxRadioBox(this, 201, "Selezionare 'Accetta' per proseguire con l'installazione, 'Rifiuta' per terminare l'installazione", wxDefaultPosition, wxRadioBox* radio_box = new wxRadioBox(this, 201, "Selezionare 'Accetta' per proseguire con l'installazione, 'Rifiuta' per terminare l'installazione",
wxDefaultSize, asAccRef, 0, wxRA_SPECIFY_COLS); wxDefaultPosition, wxDefaultSize, asAccRef, 0, wxRA_SPECIFY_COLS);
radio_box->SetSelection(1); radio_box->SetSelection(1);
GetSizer()->Add(radio_box); GetSizer()->Add(radio_box);
@ -345,6 +372,8 @@ bool CampoWizardPage3::ForwardValidate()
wxString strSrvAuth; wxString strSrvAuth;
wxString strSrvDict; wxString strSrvDict;
//AGGIORNAMENTO
//-------------
//analizza il campo.ini dell'installazione selezionata (si usa < perche' l'ultima row e' la nuova installazione!) //analizza il campo.ini dell'installazione selezionata (si usa < perche' l'ultima row e' la nuova installazione!)
if (iSelectedRow < iLastRow) if (iSelectedRow < iLastRow)
{ {
@ -407,7 +436,7 @@ bool CampoWizardPage3::ForwardValidate()
//se la directory dei dati è definitivamente farlocca (o l'utonto mente spudoratamente) allora errore! //se la directory dei dati è definitivamente farlocca (o l'utonto mente spudoratamente) allora errore!
if (!bDataOk) 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 //custom directories
wxArrayString asPersonalizedFiles; wxArrayString asPersonalizedFiles;
@ -481,23 +510,11 @@ bool CampoWizardPage3::ForwardValidate()
} }
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
{ {
//continuiamo a sconsigliare l'installazione DEMO, ma ognuno fa come crede... //NUOVA INSTALLAZIONE
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);
}
//questo lo fa in ogni caso! //questo lo fa in ogni caso!
GetWizard().SetDestinationPath(""); GetWizard().SetDestinationPath("");
GetWizard().SetDesktopShortcut(true); GetWizard().SetDesktopShortcut(true);
} }
return true; return true;
@ -593,21 +610,6 @@ CampoWizardPage3::CampoWizardPage3(wxWizard* parent) : CampoWizardPage(parent)
GetSizer()->Add(m_pRadioBox); 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); SetHTMLText(strTitle, strBody);
} }
@ -678,7 +680,30 @@ bool CampoWizardPage4::ForwardValidate()
GetWizard().SetSrvAuth(Get(404)); GetWizard().SetSrvAuth(Get(404));
int nDongleType = DongleTest(); int nDongleType = DongleTest();
if (nDongleType == 0) 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; return true;
} }
@ -1473,6 +1498,41 @@ bool CampoWizardPage9::TransferDataToWindow()
Set(902, bChkTeleass); 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; return true;
} }
@ -1495,21 +1555,6 @@ bool CampoWizardPage9::ForwardValidate()
CampoWizardPage9::CampoWizardPage9(wxWizard* parent) : CampoWizardPage(parent) 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")); wxCheckBox* pIcon = new wxCheckBox(this, 901, wxT("Creare l'icona sul desktop"));
GetSizer()->Add(pIcon, 0, wxALL, 0); GetSizer()->Add(pIcon, 0, wxALL, 0);
@ -1556,6 +1601,8 @@ bool CampoWizardPage10::TransferDataToWindow()
CampoWizard& cw = GetWizard(); CampoWizard& cw = GetWizard();
_uInstallType = cw.GetInstallationType(); _uInstallType = cw.GetInstallationType();
_bInstDemoVersion = cw.GetInstDemoVersion();
switch (_uInstallType) switch (_uInstallType)
{ {
case it_server: //server case it_server: //server
@ -1583,10 +1630,11 @@ bool CampoWizardPage10::TransferDataToWindow()
_strSrvDict = cw.GetSrvDict(); _strSrvDict = cw.GetSrvDict();
break; break;
default: //standard default: //standard
if (cw.GetInstDemoVersion()) if (_bInstDemoVersion)
{ {
_strInstallType = "DEMO"; _strInstallType = "DEMO";
_strPrgLocPath = "c:/campodemo"; _strPrgLocPath = "c:/campodemo";
_strDataPath = _strPrgLocPath + "/datidemo";
} }
else else
{ {
@ -1618,12 +1666,14 @@ bool CampoWizardPage10::TransferDataToWindow()
{ {
strTitle += wxT("INSTALLAZIONE: riepilogo configurazione"); strTitle += wxT("INSTALLAZIONE: riepilogo configurazione");
//DEMO (aaarrgh!) //DEMO (aaarrgh!)
if (cw.GetInstDemoVersion()) if (_bInstDemoVersion)
{ {
strBody = wxT("<p>Tipo installazione selezionata: "); strBody = wxT("<p>Tipo installazione selezionata: ");
strBody += wxT("<b>DEMO</b></p>"); 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("<b>C:/campodemo</b></p>");
strBody += wxT("<p>Cartella dati dimostrativi: ");
strBody += wxT(Bold(_strDataPath) + "</p>");
} }
else //tutte le altre else //tutte le altre
{ {
@ -1666,8 +1716,8 @@ bool CampoWizardPage10::TransferDataToWindow()
strBody += wxT(Bold("Nel menu esecuzione automatica") + "</p>"); strBody += wxT(Bold("Nel menu esecuzione automatica") + "</p>");
} }
//installazione dati demo (solo in postazione singola) //installazione dati demo (solo in postazione singola; è obbligatoria in modalità DEMO, quindi niente scritta)
if (_uInstallType == it_standalone && _bInstDemoData) if (_uInstallType == it_standalone && _bInstDemoData && !_bInstDemoVersion)
strBody += wxT("<p>Installazione area dati dimostrativa</p>"); strBody += wxT("<p>Installazione area dati dimostrativa</p>");
if (_bDesktopShortcut) if (_bDesktopShortcut)
@ -1738,20 +1788,9 @@ void CampoWizard::Set(wxWindowID id, const wxString str)
void CampoWizard::SetDestinationPath(const wxString& path) void CampoWizard::SetDestinationPath(const wxString& path)
{ {
_strDestinationPath = path; _strDestinationPath = path;
//Se il path di destinazione e' vuoto -> nuova installazione, senno' e' un aggiornamento della installazione.. //Se il path di destinazione e' vuoto -> nuova installazione, quindi lascia la concatenazione normale,
//..che sta in _strDestinationPath //senno' e' un aggiornamento della installazione che sta in _strDestinationPath
if (_strDestinationPath.IsEmpty()) 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
{ {
//aggiornamento //aggiornamento
CampoWizardPage4* page4 = (CampoWizardPage4*)m_pPage[3]; CampoWizardPage4* page4 = (CampoWizardPage4*)m_pPage[3];
@ -1791,10 +1830,11 @@ void CampoWizard::SetInstallationType(const InstallationType nType)
//if demo //if demo
if (GetInstDemoVersion()) 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 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[4], m_pPage[5]); //manda l'utente alla pagina standard
wxWizardPageSimple::Chain(m_pPage[5], m_pPage[8]); //dalla standard alla pagina riassuntiva wxWizardPageSimple::Chain(m_pPage[5], m_pPage[8]); //dalla standard alla pagina riassuntiva
} }