Patch level :
Files correlati : Ricompilazione Demo : [ ] Commento : git-svn-id: svn://10.65.10.50/trunk@15665 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
107df0858c
commit
e0bb357fbe
@ -35,8 +35,8 @@ wxString GetDefaultDestination()
|
||||
return strDest;
|
||||
}
|
||||
|
||||
//Magico metodo per stabilire se una directory e' condivisa!!
|
||||
bool IsWriteShared (const wxString& strDir)
|
||||
//Magico metodo per stabilire se una directory e' condivisa ed e' su un disco locale!!
|
||||
bool IsSharedLocal (const wxString& strDir)
|
||||
{
|
||||
bool found = false;
|
||||
|
||||
@ -54,7 +54,7 @@ bool IsWriteShared (const wxString& strDir)
|
||||
PSHARE_INFO_502 shi;
|
||||
DWORD nEntriesRead =0, nTotalEntries = 0, nResume = 0;
|
||||
res = NetShareEnum(NULL, 502, (LPBYTE *)&shi, -1, &nEntriesRead, &nTotalEntries, &nResume);
|
||||
if(res == ERROR_SUCCESS || res == ERROR_MORE_DATA)
|
||||
if (res == ERROR_SUCCESS || res == ERROR_MORE_DATA)
|
||||
{
|
||||
for (DWORD i = 0; i < nEntriesRead; i++)
|
||||
{
|
||||
@ -73,13 +73,12 @@ bool IsWriteShared (const wxString& strDir)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} //for(DWORD i...
|
||||
NetApiBufferFree(shi);
|
||||
}
|
||||
}
|
||||
}
|
||||
} //if(res ==...
|
||||
} //while (res==ERROR_MORE_DATA...
|
||||
} //if (nDataDriveType...
|
||||
return found;
|
||||
|
||||
}
|
||||
|
||||
//finestre per messaggi vari
|
||||
@ -151,7 +150,7 @@ int CampoIniFile::GetInstallationTypeNumber() const
|
||||
//ma e' Standalone o Server?
|
||||
//se la directory dei dati e' condivisa in scrittura e' un server (almeno al 99%)
|
||||
const wxString strStudy = Get("Study");
|
||||
if (IsWriteShared(strStudy))
|
||||
if (IsSharedLocal(strStudy))
|
||||
nType = 2; //e' server
|
||||
}
|
||||
else //..senno' e' client
|
||||
|
111
setup/wizard.cpp
111
setup/wizard.cpp
@ -21,7 +21,8 @@ protected:
|
||||
wxString Bold(const wxString strStr) const;
|
||||
void AddLabel(wxSizer* pSizer, const wxChar* label);
|
||||
void AddLabel(wxGridBagSizer* pSizer, const wxChar* label, unsigned int row, unsigned int column);
|
||||
bool CheckDataDir(wxString& strDataPath) const;
|
||||
bool CheckDataDir(wxString strDataPath) const;
|
||||
bool CheckPrgDir(const wxString& strPrgPath) const;
|
||||
|
||||
public:
|
||||
virtual bool ForwardValidate() { return true; }
|
||||
@ -115,10 +116,11 @@ void CampoWizardPage::AddLabel(wxGridBagSizer* pSizer, const wxChar* label, unsi
|
||||
}
|
||||
|
||||
//metodo per il controllo della validita' di un'area dati
|
||||
bool CampoWizardPage::CheckDataDir(wxString& strDataPath) const
|
||||
bool CampoWizardPage::CheckDataDir(wxString strDataPath) const
|
||||
{
|
||||
wxDir dirDataPath(strDataPath);
|
||||
bool ok_data = false;
|
||||
wxDir dirDataPath(strDataPath);
|
||||
|
||||
//deve esistere non vuota, e contenere la sottodirectory "com" con i dati comuni
|
||||
if (dirDataPath.Exists(strDataPath) && dirDataPath.HasSubDirs("com"))
|
||||
{
|
||||
@ -126,11 +128,47 @@ bool CampoWizardPage::CheckDataDir(wxString& strDataPath) const
|
||||
wxFileName fnFileToCheck(strDataPath, "tabcom");
|
||||
fnFileToCheck.SetExt("dbf");
|
||||
if (fnFileToCheck.FileExists())
|
||||
ok_data = true;
|
||||
{
|
||||
ok_data = fnFileToCheck.IsFileWritable();
|
||||
}
|
||||
}
|
||||
return ok_data;
|
||||
}
|
||||
|
||||
//metodo per il controllo della validita' di un'area programmi
|
||||
bool CampoWizardPage::CheckPrgDir(const wxString& strPrgPath) const
|
||||
{
|
||||
bool ok_prg = false;
|
||||
wxDir dirPrgPath(strPrgPath);
|
||||
|
||||
//deve esistere non vuota e con sottodirecrory (almeno res e recdesc ci vogliono)
|
||||
if (dirPrgPath.Exists(strPrgPath) && dirPrgPath.HasFiles() && dirPrgPath.HasSubDirs())
|
||||
{
|
||||
wxFileName fnFileToCheck(strPrgPath, "campo");
|
||||
fnFileToCheck.SetExt("ini");
|
||||
if (fnFileToCheck.FileExists())
|
||||
{
|
||||
fnFileToCheck.SetName("install");
|
||||
fnFileToCheck.SetExt("ini");
|
||||
if (fnFileToCheck.FileExists())
|
||||
{
|
||||
fnFileToCheck.SetName("campo");
|
||||
fnFileToCheck.SetExt("aut");
|
||||
if (fnFileToCheck.FileExists())
|
||||
{
|
||||
fnFileToCheck.SetName("ba0");
|
||||
fnFileToCheck.SetExt("exe");
|
||||
if (fnFileToCheck.FileExists())
|
||||
{
|
||||
ok_prg = true;
|
||||
} //if(ba0..
|
||||
} //if(campo..
|
||||
} //if(install..
|
||||
} //if(ini...
|
||||
} //if(dirPrgPath..
|
||||
return ok_prg;
|
||||
}
|
||||
|
||||
//costruttore della finestra standard
|
||||
CampoWizardPage::CampoWizardPage(wxWizard* parent)
|
||||
: wxWizardPageSimple(parent)
|
||||
@ -236,7 +274,6 @@ bool CampoWizardPage3::ForwardValidate()
|
||||
const int iLastRow = m_pRadioBox->GetRowCount() - 1;
|
||||
const int iSelectedRow = m_pRadioBox->GetSelection();
|
||||
wxString strPrgPath;
|
||||
wxString strStudy;
|
||||
wxString strSrvAuth;
|
||||
wxString strSrvDict;
|
||||
|
||||
@ -261,13 +298,13 @@ bool CampoWizardPage3::ForwardValidate()
|
||||
return ErrorBox(strMsg);
|
||||
}
|
||||
|
||||
strStudy = CampoIni.Get("Study");
|
||||
const wxString strStudy = CampoIni.Get("Study");
|
||||
CampoIniFile CampoServerIni(strPrgPath + "/campo.ini", "Server");
|
||||
strSrvAuth = CampoServerIni.Get("Dongle");
|
||||
strSrvDict = CampoServerIni.Get("Dictionary");
|
||||
|
||||
if (!CheckDataDir(strStudy))
|
||||
return ErrorBox("La cartella indicata come area dati NON e' valida!\nInterrompere l'installazione e selezionare un'area dati valida\ncon il programma APPNAME");
|
||||
return ErrorBox("La cartella indicata come area dati NON e' valida!\nInterrompere l'installazione e selezionare un'area dati valida\ncon il programma");
|
||||
GetWizard().SetDataPath(strStudy);
|
||||
|
||||
if (!strSrvAuth.IsEmpty())
|
||||
@ -326,14 +363,10 @@ CampoWizardPage3::CampoWizardPage3(wxWizard* parent) : CampoWizardPage(parent)
|
||||
|
||||
//sono installazioni valide quelle che presentano la coppia di files campo.ini e campo.aut (senza..
|
||||
//..questi 2 soggetti il programma non parte)
|
||||
wxString strCampoIni = strPath;
|
||||
strCampoIni << "/campo.ini";
|
||||
wxString strCampoAut = strPath;
|
||||
strCampoAut << "/campo.aut";
|
||||
if (wxFileName::FileExists(strCampoIni) && wxFileName::FileExists(strCampoAut))
|
||||
if (CheckPrgDir(strPath))
|
||||
{
|
||||
//controlla il tipo di installazione rilevata (Standalone,Server,Client)
|
||||
CampoIniFile iniCampo(strCampoIni, "Main");
|
||||
CampoIniFile iniCampo(strPath + "/campo.ini", "Main");
|
||||
const int nType = iniCampo.GetInstallationTypeNumber();
|
||||
switch (nType)
|
||||
{
|
||||
@ -376,15 +409,15 @@ CampoWizardPage3::CampoWizardPage3(wxWizard* parent) : CampoWizardPage(parent)
|
||||
{
|
||||
strTitle += wxT("Scelta Aggiornamento / Installazione");
|
||||
strBody += wxT("<p>E' possibile <b>AGGIORNARE (scelta consigliata)</b> una installazione di <b><i>APPNAME</i></b> gia' presente oppure <b>INSTALLARE</b> in un nuovo direttorio.</p>");
|
||||
strBody += wxT("<p>Selezionare l'opzione desiderata nel riquadro sottostante. In caso di piu' di una installazione ");
|
||||
strBody += wxT("presente sara' preselezionata la eventuale installazione di tipo <b>Server</b>, in quanto <u>deve essere aggiornata per prima</u>! ");
|
||||
strBody += wxT("<p>Selezionare l'opzione desiderata nel riquadro sottostante. In caso di piu' di una installazione presente sul computer ");
|
||||
strBody += wxT("sara' preselezionata la eventuale installazione di tipo <b>Server</b> o <b>Standard</b>, in quanto <u>deve essere aggiornata per prima</u>! ");
|
||||
strBody += wxT("<p>In questo caso procedere all'aggiornamento di tale installazione Server e <u>aggiornare successivamente le postazioni client ");
|
||||
strBody += wxT("lanciando il programma <b><i>APPNAME</i></b> su di esse</u></p>");
|
||||
|
||||
//radiobutton con le scelte aggiornamento
|
||||
asCampi.Add("Nuova installazione");
|
||||
m_pRadioBox = new wxRadioBox(this, 301, "Selezionare l'installazione da aggiornare (consigliato) o Nuova installazione", wxDefaultPosition,
|
||||
wxDefaultSize, asCampi, 0, wxRA_SPECIFY_ROWS);
|
||||
m_pRadioBox = new wxRadioBox(this, 301, "Selezionare l'installazione da aggiornare (consigliato) o Nuova installazione",
|
||||
wxDefaultPosition, wxDefaultSize, asCampi, 0, wxRA_SPECIFY_ROWS);
|
||||
if (prechecked > 0)
|
||||
m_pRadioBox->SetSelection(prechecked);
|
||||
}
|
||||
@ -1077,40 +1110,13 @@ bool CampoWizardPage8::ForwardValidate()
|
||||
|
||||
//controllo esistenza directory e programmi sul server
|
||||
const wxString strPrgNetPath = Get(803);
|
||||
wxDir dirPrgPath(strPrgNetPath);
|
||||
bool ok_prg = false;
|
||||
//deve esistere non vuota, e contenere almeno campo.ini,install.ini,campo.aut,ba0.exe
|
||||
if (dirPrgPath.Exists(strPrgNetPath) && dirPrgPath.HasFiles() && dirPrgPath.HasSubDirs())
|
||||
{
|
||||
wxFileName fnFileToCheck(strPrgNetPath, "campo");
|
||||
fnFileToCheck.SetExt("ini");
|
||||
if (fnFileToCheck.FileExists())
|
||||
{
|
||||
fnFileToCheck.SetName("install");
|
||||
fnFileToCheck.SetExt("ini");
|
||||
if (fnFileToCheck.FileExists())
|
||||
{
|
||||
fnFileToCheck.SetName("campo");
|
||||
fnFileToCheck.SetExt("aut");
|
||||
if (fnFileToCheck.FileExists())
|
||||
{
|
||||
fnFileToCheck.SetName("ba0");
|
||||
fnFileToCheck.SetExt("exe");
|
||||
if (fnFileToCheck.FileExists())
|
||||
{
|
||||
ok_prg = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!ok_prg)
|
||||
if (!CheckPrgDir(strPrgNetPath))
|
||||
return ErrorBox("La cartella selezionata come origine dei programmi NON e' valida!");
|
||||
|
||||
//controllo esistenza dati sul server
|
||||
wxString strDataPath = Get(805);
|
||||
//controllo esistenza dati sul server...
|
||||
const wxString strDataPath = Get(805);
|
||||
if (!CheckDataDir(strDataPath))
|
||||
return ErrorBox("La cartella selezionata come area dati NON e' valida!");
|
||||
return ErrorBox("La cartella selezionata come area dati NON e' valida o non accessibile in scrittura!");
|
||||
|
||||
//setta alla pagina riassuntiva i valori della pagina attuale
|
||||
GetWizard().SetPrgLocPath(strPrgLocPath);
|
||||
@ -1351,9 +1357,14 @@ bool CampoWizardPage10::TransferDataToWindow()
|
||||
{
|
||||
strBody += wxT("<p>Cartella di origine dei files del programma: ");
|
||||
strBody += wxT(Bold(_strPrgNetPath) + "</p>");
|
||||
strBody += wxT("<p>Cartella dati da utilizzare: ");
|
||||
strBody += wxT(Bold(_strDataPath) + "</p>");
|
||||
}
|
||||
else
|
||||
{
|
||||
strBody += wxT("<p>Cartella dati da creare: ");
|
||||
strBody += wxT(Bold(_strDataPath) + "</p>");
|
||||
}
|
||||
strBody += wxT("<p>Cartella dati da creare: ");
|
||||
strBody += wxT(Bold(_strDataPath) + "</p>");
|
||||
}
|
||||
}
|
||||
//installazione servers...
|
||||
|
Loading…
x
Reference in New Issue
Block a user