Patch level :
Files correlati : Ricompilazione Demo : [ ] Commento : git-svn-id: svn://10.65.10.50/trunk@15619 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
3fde240c2e
commit
144a07f646
124
setup/Setup.cpp
124
setup/Setup.cpp
@ -1207,7 +1207,6 @@ BEGIN_EVENT_TABLE(CampoWizardPage8, CampoWizardPage)
|
|||||||
EVT_BUTTON(804, OnDirPick)
|
EVT_BUTTON(804, OnDirPick)
|
||||||
EVT_BUTTON(806, OnDirPick)
|
EVT_BUTTON(806, OnDirPick)
|
||||||
EVT_CHECKBOX(807, OnSrvClick)
|
EVT_CHECKBOX(807, OnSrvClick)
|
||||||
EVT_CHECKBOX(809, OnSrvClick)
|
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
void CampoWizardPage8::OnDirPick(wxCommandEvent& e)
|
void CampoWizardPage8::OnDirPick(wxCommandEvent& e)
|
||||||
@ -1232,12 +1231,6 @@ void CampoWizardPage8::OnSrvClick(wxCommandEvent& e)
|
|||||||
|
|
||||||
bool CampoWizardPage8::TransferDataToWindow()
|
bool CampoWizardPage8::TransferDataToWindow()
|
||||||
{
|
{
|
||||||
const wxString strSrvAuth = GetWizard().GetSrvAuth();
|
|
||||||
if (!strSrvAuth.IsEmpty())
|
|
||||||
{
|
|
||||||
Set(808, strSrvAuth);
|
|
||||||
FindWindowById(808)->Disable();
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1291,30 +1284,17 @@ bool CampoWizardPage8::ForwardValidate()
|
|||||||
GetWizard().SetPrgNetPath(strPrgNetPath);
|
GetWizard().SetPrgNetPath(strPrgNetPath);
|
||||||
GetWizard().SetDataPath(strDataPath);
|
GetWizard().SetDataPath(strDataPath);
|
||||||
|
|
||||||
//...compresi eventuali stupidi servers!
|
//...compresi eventuali stupidi servers!
|
||||||
const bool bUseAuth = GetBool(807);
|
const wxString strSrvDict = Get(807);
|
||||||
if (bUseAuth)
|
//se c'e' un nome di dictionary server e non lo trova si incazza
|
||||||
|
if (!strSrvDict.IsEmpty() && !DictionaryLogin(strSrvDict))
|
||||||
{
|
{
|
||||||
GetWizard().SetInstUseAuth(bUseAuth);
|
wxString strMsg;
|
||||||
const wxString strSrvAuth = Get(808);
|
strMsg << "Impossibile contattare il server " << strSrvDict << " per la gestione dei dizionari!";
|
||||||
if (strSrvAuth.IsEmpty())
|
return ErrorBox(strMsg);
|
||||||
return ErrorBox("Specificare il computer gestore delle autorizzazioni!");
|
|
||||||
GetWizard().SetSrvAuth(strSrvAuth);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
GetWizard().SetSrvAuth("");
|
|
||||||
|
|
||||||
const bool bUseDict = GetBool(809);
|
|
||||||
if (bUseDict)
|
|
||||||
{
|
|
||||||
GetWizard().SetInstUseDict(bUseDict);
|
|
||||||
const wxString strSrvDict = Get(810);
|
|
||||||
if (strSrvDict.IsEmpty())
|
|
||||||
return ErrorBox("Specificare il computer gestore dei dizionari!");
|
|
||||||
GetWizard().SetSrvDict(strSrvDict);
|
GetWizard().SetSrvDict(strSrvDict);
|
||||||
}
|
|
||||||
else
|
|
||||||
GetWizard().SetSrvDict("");
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -1328,11 +1308,9 @@ CampoWizardPage8::CampoWizardPage8(wxWizard* parent) : CampoWizardPage(parent)
|
|||||||
strBody += wxT("E' la cartella di programmi condivisa dal server precedentemente installato.</p>");
|
strBody += wxT("E' la cartella di programmi condivisa dal server precedentemente installato.</p>");
|
||||||
strBody += wxT("<p>Digitare nel campo <b>'Cartella remota dati da utilizzare'</b> il percorso completo della cartella di rete dove sono i dati. ");
|
strBody += wxT("<p>Digitare nel campo <b>'Cartella remota dati da utilizzare'</b> il percorso completo della cartella di rete dove sono i dati. ");
|
||||||
strBody += wxT("E' la cartella dei dati condivisa dal server precedentemente installato.</p>");
|
strBody += wxT("E' la cartella dei dati condivisa dal server precedentemente installato.</p>");
|
||||||
strBody += wxT("<p><b>Gestore autorizzazioni:</b> e' il computer gestore di una chiave di protezione hardware multiutenza condivisa in rete. ");
|
strBody += wxT("<p><b>Gestore dizionari:</b> e' il computer gestore dei dizionari di APPNAME in lingue diverse dall'italiano. Generalmente e' il computer agente da server di APPNAME in rete. ");
|
||||||
strBody += wxT("Generalmente e' il computer agente da server di APPNAME e su cui <u>deve essere presente la chiave di protezione multiutenza.</u></p>");
|
strBody += wxT("Premere il bottone <u>Cerca</u> per attivare la ricerca automatica di tale computer. Qualora tale ricerca fallisse digitare il nome del computer gestore dei dizionari</p>");
|
||||||
strBody += wxT("<p><b>Gestore dizionari:</b> e' il computer gestore dei dizionari di APPNAME in lingue diverse dall'italiano. ");
|
|
||||||
strBody += wxT("Generalmente e' il computer che agente da server di APPNAME.</p>");
|
|
||||||
|
|
||||||
SetHTMLText(strTitle, strBody);
|
SetHTMLText(strTitle, strBody);
|
||||||
|
|
||||||
//griglia per sistemare i campi
|
//griglia per sistemare i campi
|
||||||
@ -1346,7 +1324,7 @@ CampoWizardPage8::CampoWizardPage8(wxWizard* parent) : CampoWizardPage(parent)
|
|||||||
wxString strPath;
|
wxString strPath;
|
||||||
strPath = "C:\\";
|
strPath = "C:\\";
|
||||||
strPath += APPNAME;
|
strPath += APPNAME;
|
||||||
wxTextCtrl* tcDestPrgPath = new wxTextCtrl(this, 801, strPath, wxDefaultPosition, wxSize(320,-1));
|
wxTextCtrl* tcDestPrgPath = new wxTextCtrl(this, 801, strPath, wxDefaultPosition, wxSize(256,-1));
|
||||||
gbsSizer->Add(tcDestPrgPath, wxGBPosition(0, 1));
|
gbsSizer->Add(tcDestPrgPath, wxGBPosition(0, 1));
|
||||||
//bottone 'sfoglia'
|
//bottone 'sfoglia'
|
||||||
wxButton* bDestPrgButton = new wxButton(this, 802, wxT("Sfoglia"), wxDefaultPosition, wxSize(48, -1));
|
wxButton* bDestPrgButton = new wxButton(this, 802, wxT("Sfoglia"), wxDefaultPosition, wxSize(48, -1));
|
||||||
@ -1358,7 +1336,7 @@ CampoWizardPage8::CampoWizardPage8(wxWizard* parent) : CampoWizardPage(parent)
|
|||||||
//campo testo
|
//campo testo
|
||||||
strPath = "Z:\\";
|
strPath = "Z:\\";
|
||||||
strPath += APPNAME;
|
strPath += APPNAME;
|
||||||
wxTextCtrl* tcSrcPrgPath = new wxTextCtrl(this, 803, strPath, wxDefaultPosition, wxSize(320,-1));
|
wxTextCtrl* tcSrcPrgPath = new wxTextCtrl(this, 803, strPath, wxDefaultPosition, wxSize(256,-1));
|
||||||
gbsSizer->Add(tcSrcPrgPath, wxGBPosition(1, 1));
|
gbsSizer->Add(tcSrcPrgPath, wxGBPosition(1, 1));
|
||||||
//bottone 'sfoglia'
|
//bottone 'sfoglia'
|
||||||
wxButton* bSrcPrgButton = new wxButton(this, 804, wxT("Sfoglia"), wxDefaultPosition, wxSize(48, -1));
|
wxButton* bSrcPrgButton = new wxButton(this, 804, wxT("Sfoglia"), wxDefaultPosition, wxSize(48, -1));
|
||||||
@ -1369,31 +1347,21 @@ CampoWizardPage8::CampoWizardPage8(wxWizard* parent) : CampoWizardPage(parent)
|
|||||||
AddLabel(gbsSizer, "Cartella remota dati da utilizzare", 2, 0);
|
AddLabel(gbsSizer, "Cartella remota dati da utilizzare", 2, 0);
|
||||||
//campo testo
|
//campo testo
|
||||||
strPath += "/dati";
|
strPath += "/dati";
|
||||||
wxTextCtrl* tcDataPath = new wxTextCtrl(this, 805, strPath, wxDefaultPosition, wxSize(320,-1));
|
wxTextCtrl* tcDataPath = new wxTextCtrl(this, 805, strPath, wxDefaultPosition, wxSize(256,-1));
|
||||||
gbsSizer->Add(tcDataPath, wxGBPosition(2, 1));
|
gbsSizer->Add(tcDataPath, wxGBPosition(2, 1));
|
||||||
//bottone 'sfoglia'
|
//bottone 'sfoglia'
|
||||||
wxButton* bDataButton = new wxButton(this, 806, wxT("Sfoglia"), wxDefaultPosition, wxSize(48, -1));
|
wxButton* bDataButton = new wxButton(this, 806, wxT("Sfoglia"), wxDefaultPosition, wxSize(48, -1));
|
||||||
gbsSizer->Add(bDataButton, wxGBPosition(2, 2));
|
gbsSizer->Add(bDataButton, wxGBPosition(2, 2));
|
||||||
|
|
||||||
//quarta riga della griglia
|
//terza riga della griglia
|
||||||
//check usa authoriz
|
//Server dizionari label
|
||||||
wxCheckBox* chAuthoriz = new wxCheckBox(this, 807, wxT("Utilizza il gestore delle autorizzazioni"));
|
AddLabel(gbsSizer, "Nome o indirizzo IP del server dei dizionari", 3, 0);
|
||||||
chAuthoriz->SetValue(false);
|
//nome Server dizionari
|
||||||
gbsSizer->Add(chAuthoriz, wxGBPosition(3, 1));
|
wxTextCtrl* tcSrvName = new wxTextCtrl(this, 807, "", wxDefaultPosition, wxSize(256,-1));
|
||||||
//quale e' il server authoriz
|
gbsSizer->Add(tcSrvName, wxGBPosition(3, 1));
|
||||||
wxTextCtrl* tcAuthoriz = new wxTextCtrl(this, 808, "nomeserverautorizzazioni", wxDefaultPosition, wxSize(96,-1));
|
//bottone Cerca
|
||||||
tcAuthoriz->Disable();
|
wxButton* bSrvButton = new wxButton(this, 808, wxT("Cerca"), wxDefaultPosition, wxSize(48, -1));
|
||||||
gbsSizer->Add(tcAuthoriz, wxGBPosition(3, 2));
|
gbsSizer->Add(bSrvButton, wxGBPosition(3, 2), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
|
||||||
|
|
||||||
//quarta riga della griglia
|
|
||||||
//check usa diction
|
|
||||||
wxCheckBox* chDictionary = new wxCheckBox(this, 809, wxT("Utilizza il gestore dei dizionari"));
|
|
||||||
chDictionary->SetValue(false);
|
|
||||||
gbsSizer->Add(chDictionary, wxGBPosition(4, 1));
|
|
||||||
//quale e' il server diction
|
|
||||||
wxTextCtrl* tcDiction = new wxTextCtrl(this, 810, "nomeserverdizionario", wxDefaultPosition, wxSize(96,-1));
|
|
||||||
tcDiction->Disable();
|
|
||||||
gbsSizer->Add(tcDiction, wxGBPosition(4, 2));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1883,6 +1851,8 @@ class CampoSetup : public wxApp
|
|||||||
CampoFrame* m_pMainFrame;
|
CampoFrame* m_pMainFrame;
|
||||||
wxLocale m_locale;
|
wxLocale m_locale;
|
||||||
|
|
||||||
|
CampoWizard* m_pWizard;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool WriteRegistryKey(HKEY hBaseKey, const wxString strKey, const wxString& strValue) const;
|
bool WriteRegistryKey(HKEY hBaseKey, const wxString strKey, const wxString& strValue) const;
|
||||||
wxString ReadRegistryKey(HKEY hBaseKey, const wxString strKey) const;
|
wxString ReadRegistryKey(HKEY hBaseKey, const wxString strKey) const;
|
||||||
@ -1891,6 +1861,7 @@ private:
|
|||||||
protected:
|
protected:
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
void OnTimer(wxTimerEvent& e);
|
void OnTimer(wxTimerEvent& e);
|
||||||
|
// void OnSocketEvent(wxSocketEvent& se);
|
||||||
bool CreateIcon(unsigned int csidl, const wxFileName& strExeFile) const;
|
bool CreateIcon(unsigned int csidl, const wxFileName& strExeFile) const;
|
||||||
bool CreateAutostartMode(const int iSrvAutostartMode, const wxString& strPath);
|
bool CreateAutostartMode(const int iSrvAutostartMode, const wxString& strPath);
|
||||||
void AssociateExtension(const wxFileName& strExeFile, const wxString strExt);
|
void AssociateExtension(const wxFileName& strExeFile, const wxString strExt);
|
||||||
@ -1913,8 +1884,19 @@ IMPLEMENT_APP(CampoSetup)
|
|||||||
|
|
||||||
BEGIN_EVENT_TABLE(CampoSetup, wxApp)
|
BEGIN_EVENT_TABLE(CampoSetup, wxApp)
|
||||||
EVT_TIMER(883, OnTimer)
|
EVT_TIMER(883, OnTimer)
|
||||||
|
//EVT_SOCKET(1001, CampoSetup::OnSocketEvent(wxSocketEvent& se))
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
|
|
||||||
|
/*void CampoSetup::OnSocketEvent(wxSocketEvent& se)
|
||||||
|
{
|
||||||
|
if (se.GetSocketEvent() == wxSOCKET_CONNECTION)
|
||||||
|
{
|
||||||
|
m_pWizard
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
|
||||||
//metodi di lettura/scrittura registry di windows (fantastici!)
|
//metodi di lettura/scrittura registry di windows (fantastici!)
|
||||||
wxString CampoSetup::ReadRegistryKey(HKEY hBaseKey, const wxString strKey) const
|
wxString CampoSetup::ReadRegistryKey(HKEY hBaseKey, const wxString strKey) const
|
||||||
{
|
{
|
||||||
@ -2255,9 +2237,9 @@ void CampoSetup::UnzipSystem(const wxString& strPrgLocPath) const
|
|||||||
//metodo principale dell'applicazione che gestisce l'ordine degli eventi nella installazione vera e propria
|
//metodo principale dell'applicazione che gestisce l'ordine degli eventi nella installazione vera e propria
|
||||||
void CampoSetup::OnTimer(wxTimerEvent& WXUNUSED(e))
|
void CampoSetup::OnTimer(wxTimerEvent& WXUNUSED(e))
|
||||||
{
|
{
|
||||||
CampoWizard* pWizard = new CampoWizard(m_pMainFrame);
|
m_pWizard = new CampoWizard(m_pMainFrame);
|
||||||
|
|
||||||
if (pWizard->Run())
|
if (m_pWizard->Run())
|
||||||
{
|
{
|
||||||
wxFileName strPath = argv[0];
|
wxFileName strPath = argv[0];
|
||||||
strPath.SetCwd();
|
strPath.SetCwd();
|
||||||
@ -2265,15 +2247,15 @@ void CampoSetup::OnTimer(wxTimerEvent& WXUNUSED(e))
|
|||||||
// 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 = pWizard->GetInstallationType();
|
const unsigned int uInstallationType = m_pWizard->GetInstallationType();
|
||||||
const bool bNewInstallation = uInstallationType < 3;
|
const bool bNewInstallation = uInstallationType < 3;
|
||||||
//installazione servers?
|
//installazione servers?
|
||||||
const bool bInstallLurch = uInstallationType == 1 && (pWizard->GetInstUseAuth() || pWizard->GetInstUseDict());
|
const bool bInstallLurch = uInstallationType == 1 && (m_pWizard->GetInstUseAuth() || m_pWizard->GetInstUseDict());
|
||||||
//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 && pWizard->GetInstDemoData();
|
const bool bInstallDemoData = uInstallationType == 0 && m_pWizard->GetInstDemoData();
|
||||||
//cartelle selezionate dall'utente
|
//cartelle selezionate dall'utente
|
||||||
const wxString& strPrgLocPath = pWizard->GetPrgLocPath();
|
const wxString& strPrgLocPath = m_pWizard->GetPrgLocPath();
|
||||||
const wxString& strDataPath = pWizard->GetDataPath();
|
const wxString& strDataPath = m_pWizard->GetDataPath();
|
||||||
|
|
||||||
//se nuova installazione deve anche creare la directory di destinazione
|
//se nuova installazione deve anche creare la directory di destinazione
|
||||||
if (bNewInstallation)
|
if (bNewInstallation)
|
||||||
@ -2430,7 +2412,7 @@ void CampoSetup::OnTimer(wxTimerEvent& WXUNUSED(e))
|
|||||||
{ //parentesi necessaria per la scrittura immediata (non cancellare! serve per debug)
|
{ //parentesi necessaria per la scrittura immediata (non cancellare! serve per debug)
|
||||||
//paragrafo [Main]
|
//paragrafo [Main]
|
||||||
CampoIniFile CampoIniMain(strPrgLocPath + "/campo.ini", "Main");
|
CampoIniFile CampoIniMain(strPrgLocPath + "/campo.ini", "Main");
|
||||||
const unsigned int uDongleType = pWizard->GetDongleType();
|
const unsigned int uDongleType = m_pWizard->GetDongleType();
|
||||||
CampoIniMain.Set("Donglehw", uDongleType);
|
CampoIniMain.Set("Donglehw", uDongleType);
|
||||||
CampoIniMain.Set("Study", strDataPath);
|
CampoIniMain.Set("Study", strDataPath);
|
||||||
CampoIniMain.Set("Firm", "com");
|
CampoIniMain.Set("Firm", "com");
|
||||||
@ -2450,10 +2432,10 @@ void CampoSetup::OnTimer(wxTimerEvent& WXUNUSED(e))
|
|||||||
if (bInstallLurch)
|
if (bInstallLurch)
|
||||||
{
|
{
|
||||||
CampoIniFile CampoIniSrv(strPrgLocPath + "/campo.ini", "Server");
|
CampoIniFile CampoIniSrv(strPrgLocPath + "/campo.ini", "Server");
|
||||||
if (pWizard->GetInstUseAuth())
|
if (m_pWizard->GetInstUseAuth())
|
||||||
CampoIniSrv.Set("Authoriz", pWizard->GetSrvAuth());
|
CampoIniSrv.Set("Authoriz", m_pWizard->GetSrvAuth());
|
||||||
if (pWizard->GetInstUseDict())
|
if (m_pWizard->GetInstUseDict())
|
||||||
CampoIniSrv.Set("Dictionary", pWizard->GetSrvDict());
|
CampoIniSrv.Set("Dictionary", m_pWizard->GetSrvDict());
|
||||||
}
|
}
|
||||||
} //if(bNewInstallation...
|
} //if(bNewInstallation...
|
||||||
|
|
||||||
@ -2465,7 +2447,7 @@ void CampoSetup::OnTimer(wxTimerEvent& WXUNUSED(e))
|
|||||||
{
|
{
|
||||||
CampoIniFile CampoInstall(strPrgLocPath + "/install.ini", "Main");
|
CampoIniFile CampoInstall(strPrgLocPath + "/install.ini", "Main");
|
||||||
if (uInstallationType == 2) //client: directory origine sul server
|
if (uInstallationType == 2) //client: directory origine sul server
|
||||||
CampoInstall.Set("DiskPath", 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)
|
||||||
{
|
{
|
||||||
wxFileName strSourcePath(wxGetCwd());
|
wxFileName strSourcePath(wxGetCwd());
|
||||||
@ -2483,7 +2465,7 @@ void CampoSetup::OnTimer(wxTimerEvent& WXUNUSED(e))
|
|||||||
//..avvia la procedura della creazione dell'autostart(un casino)
|
//..avvia la procedura della creazione dell'autostart(un casino)
|
||||||
if (bInstallLurch)
|
if (bInstallLurch)
|
||||||
{
|
{
|
||||||
const int iSrvAutostartMode = pWizard->GetSrvAutostartMode();
|
const int iSrvAutostartMode = m_pWizard->GetSrvAutostartMode();
|
||||||
CreateAutostartMode(iSrvAutostartMode, strPrgLocPath);
|
CreateAutostartMode(iSrvAutostartMode, strPrgLocPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2498,7 +2480,7 @@ void CampoSetup::OnTimer(wxTimerEvent& WXUNUSED(e))
|
|||||||
// 8) CREAZIONE DELL'ICONA SUL DESKTOP
|
// 8) CREAZIONE DELL'ICONA SUL DESKTOP
|
||||||
//------------------------------------
|
//------------------------------------
|
||||||
const wxFileName strExe(strPrgLocPath, wxT("ba0.exe"));
|
const wxFileName strExe(strPrgLocPath, wxT("ba0.exe"));
|
||||||
const bool bDesktopShortcut = pWizard->GetDesktopShortcut();
|
const bool bDesktopShortcut = m_pWizard->GetDesktopShortcut();
|
||||||
if (bDesktopShortcut)
|
if (bDesktopShortcut)
|
||||||
CreateIcon(CSIDL_COMMON_DESKTOPDIRECTORY, strExe);
|
CreateIcon(CSIDL_COMMON_DESKTOPDIRECTORY, strExe);
|
||||||
|
|
||||||
@ -2529,8 +2511,8 @@ void CampoSetup::OnTimer(wxTimerEvent& WXUNUSED(e))
|
|||||||
wxSetWorkingDirectory(strPrgLocPath);
|
wxSetWorkingDirectory(strPrgLocPath);
|
||||||
wxExecute("ba1 -6 /uADMIN");
|
wxExecute("ba1 -6 /uADMIN");
|
||||||
|
|
||||||
} //if (pWizard->Run())...
|
} //if (m_pWizard->Run())...
|
||||||
pWizard->Destroy();
|
m_pWizard->Destroy();
|
||||||
|
|
||||||
//finestrina x chiudere a mano il programma (sconsigliata causa lancio ba1.exe)
|
//finestrina x chiudere a mano il programma (sconsigliata causa lancio ba1.exe)
|
||||||
// ::wxMessageBox(wxT("Installazione terminata"), APPNAME, wxOK | wxICON_INFORMATION);
|
// ::wxMessageBox(wxT("Installazione terminata"), APPNAME, wxOK | wxICON_INFORMATION);
|
||||||
|
@ -68,6 +68,8 @@ unsigned short HardlockLogin(int& year)
|
|||||||
memcpy(data, &eprom[60], sizeof(data));
|
memcpy(data, &eprom[60], sizeof(data));
|
||||||
if (HardlockGarble(data))
|
if (HardlockGarble(data))
|
||||||
year = (int)data[0];
|
year = (int)data[0];
|
||||||
|
|
||||||
|
HL_LOGOUT();
|
||||||
}
|
}
|
||||||
return serno;
|
return serno;
|
||||||
}
|
}
|
||||||
@ -117,6 +119,7 @@ unsigned short EutronLogin(int& year)
|
|||||||
short* number = (short*)(&eutron_key.data[2]);
|
short* number = (short*)(&eutron_key.data[2]);
|
||||||
*pointer = 0; // Posizione in cui leggere
|
*pointer = 0; // Posizione in cui leggere
|
||||||
*number = 8; // Words da leggere
|
*number = 8; // Words da leggere
|
||||||
|
eutron_key.status = -1;
|
||||||
smartlink(&eutron_key);
|
smartlink(&eutron_key);
|
||||||
if (eutron_key.status == ST_OK)
|
if (eutron_key.status == ST_OK)
|
||||||
{
|
{
|
||||||
@ -130,6 +133,9 @@ unsigned short EutronLogin(int& year)
|
|||||||
else
|
else
|
||||||
year = ThisYear();
|
year = ThisYear();
|
||||||
|
|
||||||
|
eutron_key.net_command = NET_KEY_CLOSE;
|
||||||
|
smartlink(&eutron_key);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -152,18 +158,26 @@ static unsigned short InquireSocketNumber(wxSocketClient& sc, const wxString& st
|
|||||||
|
|
||||||
static unsigned short InquireServer(const wxString& strSrvName, int& year, const bool bMsg)
|
static unsigned short InquireServer(const wxString& strSrvName, int& year, const bool bMsg)
|
||||||
{
|
{
|
||||||
|
unsigned short serno = 0xFFFF;
|
||||||
|
year = 0;
|
||||||
|
|
||||||
wxIPV4address ip;
|
wxIPV4address ip;
|
||||||
if (!ip.Hostname(strSrvName) || !ip.Service("1883")) //indirizzo NON valido o porta scazzata!
|
if (!ip.Hostname(strSrvName) || !ip.Service("1883")) //indirizzo NON valido o porta scazzata!
|
||||||
{
|
{
|
||||||
if (bMsg)
|
if (bMsg)
|
||||||
ErrorBox("Indirizzo IP errato!");
|
ErrorBox("Indirizzo IP errato!");
|
||||||
return 0xFFFF;
|
return serno;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxSocketClient sc;
|
wxSocketClient* sc = new wxSocketClient;
|
||||||
sc.SetTimeout(2);
|
sc->SetTimeout(2);
|
||||||
sc.SetFlags(sc.GetFlags() | wxSOCKET_REUSEADDR);
|
if (sc->Connect(ip)) //il computer remoto risponde ma il server no (non c'e' o e' spento)
|
||||||
if (!sc.Connect(ip)) //il computer remoto risponde ma il server no (non c'e' o e' spento)
|
{
|
||||||
|
serno = InquireSocketNumber(*sc, "DongleNumber()");
|
||||||
|
year = InquireSocketNumber(*sc, "DongleYear()");
|
||||||
|
sc->Discard();
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
if (bMsg)
|
if (bMsg)
|
||||||
{
|
{
|
||||||
@ -171,13 +185,9 @@ static unsigned short InquireServer(const wxString& strSrvName, int& year, const
|
|||||||
strMsg << "Il server " << strSrvName << " non e' raggiungibile!";
|
strMsg << "Il server " << strSrvName << " non e' raggiungibile!";
|
||||||
ErrorBox(strMsg);
|
ErrorBox(strMsg);
|
||||||
}
|
}
|
||||||
return 0xFFFF;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned short serno = InquireSocketNumber(sc, "DongleNumber()");
|
|
||||||
year = InquireSocketNumber(sc, "DongleYear()");
|
|
||||||
|
|
||||||
sc.Destroy();
|
sc->Destroy();
|
||||||
return serno;
|
return serno;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -197,14 +207,15 @@ unsigned short ServerLogin(int& year, wxString& strSrvName)
|
|||||||
|
|
||||||
if (strMyIP.Len() > 7)
|
if (strMyIP.Len() > 7)
|
||||||
{
|
{
|
||||||
const unsigned short MaxSck = 6;
|
const unsigned short MaxSck = 256;
|
||||||
for (int j = 3; j < 256 && serno == 0xFFFF; j += MaxSck)
|
// for (int j = 3; j < 256 && serno == 0xFFFF; j += MaxSck)
|
||||||
{
|
{
|
||||||
wxSocketClient sc[MaxSck];
|
wxSocketClient* sc[MaxSck];
|
||||||
|
memset(sc, 0, sizeof(sc));
|
||||||
wxIPV4address ipRemote[MaxSck];
|
wxIPV4address ipRemote[MaxSck];
|
||||||
for (int i = 0; i < MaxSck; i++)
|
for (int i = 0; i < MaxSck; i++)
|
||||||
{
|
{
|
||||||
const int n = i+j;
|
const int n = i; //+j;
|
||||||
if (n < 256)
|
if (n < 256)
|
||||||
{
|
{
|
||||||
//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
|
||||||
@ -214,28 +225,30 @@ unsigned short ServerLogin(int& year, wxString& strSrvName)
|
|||||||
continue;
|
continue;
|
||||||
if (ipRemote[i].Hostname(strSrvIP) && ipRemote[i].Service("1883"))
|
if (ipRemote[i].Hostname(strSrvIP) && ipRemote[i].Service("1883"))
|
||||||
{
|
{
|
||||||
sc[i].SetTimeout(2);
|
sc[i] = new wxSocketClient;
|
||||||
sc[i].SetFlags(sc[i].GetFlags() | wxSOCKET_REUSEADDR);
|
sc[i]->SetTimeout(2);
|
||||||
sc[i].Connect(ipRemote[i], false);
|
sc[i]->Connect(ipRemote[i], false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
wxMilliSleep(100);
|
wxMilliSleep(100);
|
||||||
for (int i = 0; i < MaxSck; i++)
|
for (int i = 0; i < MaxSck; i++) if (sc[i])
|
||||||
{
|
{
|
||||||
sc[i].WaitOnConnect(0, 1);
|
sc[i]->WaitOnConnect(0, 1);
|
||||||
if (sc[i].IsConnected())
|
if (sc[i]->IsConnected())
|
||||||
{
|
{
|
||||||
sc[i].GetPeer(ipRemote[i]);
|
sc[i]->GetPeer(ipRemote[i]);
|
||||||
strSrvName = ipRemote[i].Hostname();
|
strSrvName = ipRemote[i].Hostname();
|
||||||
serno = InquireSocketNumber(sc[i], "DongleNumber()");
|
serno = InquireSocketNumber(*sc[i], "DongleNumber()");
|
||||||
year = InquireSocketNumber(sc[i], "DongleYear()");
|
year = InquireSocketNumber(*sc[i], "DongleYear()");
|
||||||
|
sc[i]->Discard();
|
||||||
if (year > 0)
|
if (year > 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
sc[i]->Close();
|
||||||
} //for (inti =0...
|
} //for (inti =0...
|
||||||
for (int i = 0; i < MaxSck; i++)
|
for (int i = 0; i < MaxSck; i++) if (sc[i])
|
||||||
sc[i].Destroy();
|
sc[i]->Destroy();
|
||||||
} //for(int j=0...
|
} //for(int j=0...
|
||||||
} //if(strMyIP.Len()...
|
} //if(strMyIP.Len()...
|
||||||
} //if(strSrvName.Is...
|
} //if(strSrvName.Is...
|
||||||
@ -244,3 +257,9 @@ unsigned short ServerLogin(int& year, wxString& strSrvName)
|
|||||||
|
|
||||||
return serno;
|
return serno;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool DictionaryLogin(const wxString& strSrvName)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
@ -11,5 +11,6 @@ void EncodeEutronPassword(char* str);
|
|||||||
unsigned short EutronLogin(int& year);
|
unsigned short EutronLogin(int& year);
|
||||||
|
|
||||||
unsigned short ServerLogin(int& year, wxString& strSrvName);
|
unsigned short ServerLogin(int& year, wxString& strSrvName);
|
||||||
|
bool DictionaryLogin(const wxString& strSrvName);
|
||||||
|
|
||||||
#endif
|
#endif
|
Loading…
x
Reference in New Issue
Block a user