Migliorato supporto installazione SSA remoto

git-svn-id: svn://10.65.10.50/branches/R_10_00@22641 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2012-04-13 15:13:31 +00:00
parent c8e2f83670
commit 09c99c0bae
2 changed files with 71 additions and 56 deletions

View File

@ -201,13 +201,27 @@ static unsigned short InquireSocketNumber(wxSocketClient& sc, const wxString& st
return (unsigned short)number[1];
}
//metodo per sapere dal server di chiave quanti sono gli utonti connessi;non funziona finchè ai servers non..
//..viene aggiunto il metodo NumberActiveUsers (è qui come segnaposto futuro)
//metodo per sapere dal server di chiave quanti sono gli utonti connessi
unsigned short ServerLoggedUsers(const wxString& strSrvName)
{
unsigned short nUtonti = 0;
wxIPV4address ip;
if (ip.Hostname(strSrvName) && ip.Service("1883")) //riesce a connettersi
wxString strHost, strService;
const int nColon = strSrvName.Find(':');
if (nColon > 0)
{
strHost = strSrvName.Left(nColon);
strService = strSrvName.Mid(nColon+1);
}
else
{
strHost = strSrvName;
strService = wxT("1883");
}
if (ip.Hostname(strHost) && ip.Service(strService)) //riesce a connettersi
{
wxSocketClient& sc = m_bordello.Zoccola(ip);
if (sc.IsConnected() || sc.Connect(ip)) //il computer remoto risponde
@ -224,8 +238,21 @@ static unsigned short InquireServer(const wxString& strSrvName, int& year, const
unsigned short serno = 0xFFFF;
year = 0;
wxString strHost, strService;
const int nColon = strSrvName.Find(':');
if (nColon > 0)
{
strHost = strSrvName.Left(nColon);
strService = strSrvName.Mid(nColon+1);
}
else
{
strHost = strSrvName;
strService = wxT("1883");
}
wxIPV4address ip;
if (!ip.Hostname(strSrvName) || !ip.Service("1883")) //indirizzo NON valido o porta scazzata!
if (!ip.Hostname(strHost) || !ip.Service(strService)) //indirizzo NON valido o porta scazzata!
{
if (bMsg)
ErrorBox("Indirizzo IP errato!");
@ -244,7 +271,7 @@ static unsigned short InquireServer(const wxString& strSrvName, int& year, const
if (bMsg)
{
wxString strMsg;
strMsg << "Il server " << strSrvName << " non e' raggiungibile!";
strMsg << "Il server " << strSrvName << " non risponde!";
ErrorBox(strMsg);
}
}

View File

@ -677,8 +677,25 @@ void CampoWizardPage4::OnSRPick(wxCommandEvent& e)
void CampoWizardPage4::OnSSAPick(wxCommandEvent& e)
{
wxString path("../../chiavi/ssa/GetInfo.exe");
wxExecute(path, wxEXEC_SYNC);
wxString strSerial;
strSerial = ::wxGetTextFromUser(_T("Inserire il numero di serie assegnato da Sirio"), _T("Richiesta numero di serie"), strSerial, this);
const int nSerial = wxAtoi(strSerial);
if (nSerial > 1000 && nSerial < 10000)
{
wxString path("./SSAGetInfo.exe -nome ");
path << strSerial;
wxExecute(path, wxEXEC_SYNC);
strSerial += wxT(".ssax");
if (wxFileName::FileExists(strSerial))
{
wxString msg = _T("Spedire il file ") + strSerial + _(" a abilitazioni_software@sirio-is.it\nper ottenere il file della licenza da copiare nella cartella di installazione.");
MessageBox(msg);
}
else
ErrorBox(_T("Non è stato possibile generare il file di richiesta licenza"));
}
else
ErrorBox(_T("Numero di serie non valido"));
}
@ -834,7 +851,21 @@ int CampoWizardPage4::DongleTest()
serno = SSALogin(yearKey);
if (serno != 0xFFFF)
dongle_type = 4; //chiave software
}
}
if (serno == 0xFFFF)
{
wxString strSSA = wxFindFirstFile("*.ssax");
if (!strSSA.IsEmpty())
{
strSSA = strSSA.After('\\');
serno = wxAtoi(strSSA);
if (serno > 1000 && serno < 65000)
dongle_type = 4; //chiave software
else
serno = 0xFFFF;
}
}
return dongle_type;
@ -1496,7 +1527,7 @@ CampoWizardPage8::CampoWizardPage8(wxWizard* parent) : CampoWizardPage(parent)
/**********************************************************************************************************/
// 9 pagina con la creazione icona sul desktop, lanciatore del lurch e installatore teleassistenza
// 9 pagina con la creazione icona sul desktop, lanciatore del lurch
/**********************************************************************************************************/
class CampoWizardPage9 : public CampoWizardPage
{
@ -1513,32 +1544,12 @@ bool CampoWizardPage9::TransferDataToWindow()
//setta il checkbox del link
Set(901, GetWizard().GetDesktopShortcut());
//controlla se il programma di teleassistenza e' gia' installato sul computer e decide se spuntare o meno..
//..il checkbox
bool bChkTeleass = false;
if (FindReseller() <= 0)
{
const wxString strTVDir = GetWindowsProgramDirectory() + "/TeamViewer/Version5";
wxFileName fnFileToCheck(strTVDir, "TeamViewer");
fnFileToCheck.SetExt("exe");
bChkTeleass = !fnFileToCheck.FileExists();
}
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 strTitle = wxT("Collegamenti");
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 TeamViewer. 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)
@ -1547,15 +1558,8 @@ bool CampoWizardPage9::TransferDataToWindow()
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();
strBody += wxT("numero e nella data delle registrazioni. La cartella di installazione della ");
strBody += wxT("versione dimostrativa e' C:/CampoDemo e dispone di un'area dati precaricata.</p>");
}
SetHTMLText(strTitle, strBody);
@ -1569,14 +1573,6 @@ bool CampoWizardPage9::ForwardValidate()
const bool bDesktopShortcut = GetBool(901);
GetWizard().SetDesktopShortcut(bDesktopShortcut);
//installazione programma teleassistenza
const bool bInstallTeleass = GetBool(902);
if (bInstallTeleass)
{
wxString strPath("../../teleassistenza/TeamViewerQS_it.exe");
wxExecute(strPath, wxEXEC_SYNC);
}
return true;
}
@ -1584,14 +1580,6 @@ CampoWizardPage9::CampoWizardPage9(wxWizard* parent) : CampoWizardPage(parent)
{
wxCheckBox* pIcon = new wxCheckBox(this, 901, wxT("Creare l'icona sul desktop"));
GetSizer()->Add(pIcon, 0, wxALL, 0);
GetSizer()->AddSpacer(10);
wxCheckBox* pTeleass = new wxCheckBox(this, 902, wxT("Installare il programma di teleassistenza"));
GetSizer()->Add(pTeleass, 0, wxALL, 0);
if (FindReseller() > 0)
pTeleass->Hide();
}