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;
 | 
					  return strDest;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//Magico metodo per stabilire se una directory e' condivisa!!
 | 
					//Magico metodo per stabilire se una directory e' condivisa ed e' su un disco locale!!
 | 
				
			||||||
bool IsWriteShared (const wxString& strDir)
 | 
					bool IsSharedLocal (const wxString& strDir)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  bool found = false;
 | 
					  bool found = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -73,13 +73,12 @@ bool IsWriteShared (const wxString& strDir)
 | 
				
			|||||||
              break;
 | 
					              break;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
        }
 | 
					        } //for(DWORD i...
 | 
				
			||||||
        NetApiBufferFree(shi);
 | 
					        NetApiBufferFree(shi);
 | 
				
			||||||
      }
 | 
					      } //if(res ==...
 | 
				
			||||||
    }
 | 
					    } //while (res==ERROR_MORE_DATA...
 | 
				
			||||||
  }
 | 
					  } //if (nDataDriveType...
 | 
				
			||||||
  return found;
 | 
					  return found;
 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//finestre per messaggi vari
 | 
					//finestre per messaggi vari
 | 
				
			||||||
@ -151,7 +150,7 @@ int CampoIniFile::GetInstallationTypeNumber() const
 | 
				
			|||||||
      //ma e' Standalone o Server?
 | 
					      //ma e' Standalone o Server?
 | 
				
			||||||
      //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 (IsWriteShared(strStudy))
 | 
					      if (IsSharedLocal(strStudy))
 | 
				
			||||||
        nType = 2;  //e' server
 | 
					        nType = 2;  //e' server
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    else                //..senno' e' client
 | 
					    else                //..senno' e' client
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										107
									
								
								setup/wizard.cpp
									
									
									
									
									
								
							
							
						
						
									
										107
									
								
								setup/wizard.cpp
									
									
									
									
									
								
							@ -21,7 +21,8 @@ protected:
 | 
				
			|||||||
  wxString Bold(const wxString strStr) const;
 | 
					  wxString Bold(const wxString strStr) const;
 | 
				
			||||||
  void AddLabel(wxSizer* pSizer, const wxChar* label);
 | 
					  void AddLabel(wxSizer* pSizer, const wxChar* label);
 | 
				
			||||||
  void AddLabel(wxGridBagSizer* pSizer, const wxChar* label, unsigned int row, unsigned int column);
 | 
					  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:
 | 
					public:
 | 
				
			||||||
  virtual bool ForwardValidate() { return true; }
 | 
					  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
 | 
					//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;
 | 
					  bool ok_data = false;
 | 
				
			||||||
 | 
					  wxDir dirDataPath(strDataPath);
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
  //deve esistere non vuota, e contenere la sottodirectory "com" con i dati comuni
 | 
					  //deve esistere non vuota, e contenere la sottodirectory "com" con i dati comuni
 | 
				
			||||||
  if (dirDataPath.Exists(strDataPath) && dirDataPath.HasSubDirs("com"))
 | 
					  if (dirDataPath.Exists(strDataPath) && dirDataPath.HasSubDirs("com"))
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
@ -126,11 +128,47 @@ bool CampoWizardPage::CheckDataDir(wxString& strDataPath) const
 | 
				
			|||||||
    wxFileName fnFileToCheck(strDataPath, "tabcom");
 | 
					    wxFileName fnFileToCheck(strDataPath, "tabcom");
 | 
				
			||||||
    fnFileToCheck.SetExt("dbf");
 | 
					    fnFileToCheck.SetExt("dbf");
 | 
				
			||||||
    if (fnFileToCheck.FileExists())
 | 
					    if (fnFileToCheck.FileExists())
 | 
				
			||||||
      ok_data = true;
 | 
					    {
 | 
				
			||||||
 | 
					      ok_data = fnFileToCheck.IsFileWritable();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  return ok_data;
 | 
					  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
 | 
					//costruttore della finestra standard
 | 
				
			||||||
CampoWizardPage::CampoWizardPage(wxWizard* parent)
 | 
					CampoWizardPage::CampoWizardPage(wxWizard* parent)
 | 
				
			||||||
            : wxWizardPageSimple(parent)
 | 
					            : wxWizardPageSimple(parent)
 | 
				
			||||||
@ -236,7 +274,6 @@ bool CampoWizardPage3::ForwardValidate()
 | 
				
			|||||||
  const int iLastRow = m_pRadioBox->GetRowCount() - 1;
 | 
					  const int iLastRow = m_pRadioBox->GetRowCount() - 1;
 | 
				
			||||||
  const int iSelectedRow = m_pRadioBox->GetSelection();
 | 
					  const int iSelectedRow = m_pRadioBox->GetSelection();
 | 
				
			||||||
  wxString strPrgPath;
 | 
					  wxString strPrgPath;
 | 
				
			||||||
  wxString strStudy;
 | 
					 | 
				
			||||||
  wxString strSrvAuth;
 | 
					  wxString strSrvAuth;
 | 
				
			||||||
  wxString strSrvDict;
 | 
					  wxString strSrvDict;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -261,13 +298,13 @@ bool CampoWizardPage3::ForwardValidate()
 | 
				
			|||||||
      return ErrorBox(strMsg);
 | 
					      return ErrorBox(strMsg);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    strStudy = CampoIni.Get("Study");
 | 
					    const wxString strStudy = CampoIni.Get("Study");
 | 
				
			||||||
    CampoIniFile CampoServerIni(strPrgPath + "/campo.ini", "Server");
 | 
					    CampoIniFile CampoServerIni(strPrgPath + "/campo.ini", "Server");
 | 
				
			||||||
    strSrvAuth = CampoServerIni.Get("Dongle");
 | 
					    strSrvAuth = CampoServerIni.Get("Dongle");
 | 
				
			||||||
    strSrvDict = CampoServerIni.Get("Dictionary");
 | 
					    strSrvDict = CampoServerIni.Get("Dictionary");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (!CheckDataDir(strStudy))
 | 
					    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);
 | 
					    GetWizard().SetDataPath(strStudy);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (!strSrvAuth.IsEmpty())
 | 
					    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..
 | 
					    //sono installazioni valide quelle che presentano la coppia di files campo.ini e campo.aut (senza..
 | 
				
			||||||
    //..questi 2 soggetti il programma non parte)
 | 
					    //..questi 2 soggetti il programma non parte)
 | 
				
			||||||
    wxString strCampoIni = strPath;
 | 
					    if (CheckPrgDir(strPath))
 | 
				
			||||||
    strCampoIni << "/campo.ini";
 | 
					 | 
				
			||||||
    wxString strCampoAut = strPath;
 | 
					 | 
				
			||||||
    strCampoAut << "/campo.aut";
 | 
					 | 
				
			||||||
    if (wxFileName::FileExists(strCampoIni) && wxFileName::FileExists(strCampoAut))
 | 
					 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      //controlla il tipo di installazione rilevata (Standalone,Server,Client)
 | 
					      //controlla il tipo di installazione rilevata (Standalone,Server,Client)
 | 
				
			||||||
      CampoIniFile iniCampo(strCampoIni, "Main");
 | 
					      CampoIniFile iniCampo(strPath + "/campo.ini", "Main");
 | 
				
			||||||
      const int nType = iniCampo.GetInstallationTypeNumber();
 | 
					      const int nType = iniCampo.GetInstallationTypeNumber();
 | 
				
			||||||
      switch (nType)
 | 
					      switch (nType)
 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
@ -376,15 +409,15 @@ CampoWizardPage3::CampoWizardPage3(wxWizard* parent) : CampoWizardPage(parent)
 | 
				
			|||||||
  {
 | 
					  {
 | 
				
			||||||
    strTitle += wxT("Scelta Aggiornamento / Installazione");
 | 
					    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>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("<p>Selezionare l'opzione desiderata nel riquadro sottostante. In caso di piu' di una installazione presente sul computer ");
 | 
				
			||||||
    strBody += wxT("presente sara' preselezionata la eventuale installazione di tipo <b>Server</b>, in quanto <u>deve essere aggiornata per prima</u>! ");
 | 
					    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("<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>");
 | 
					    strBody += wxT("lanciando il programma <b><i>APPNAME</i></b> su di esse</u></p>");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    //radiobutton con le scelte aggiornamento
 | 
					    //radiobutton con le scelte aggiornamento
 | 
				
			||||||
    asCampi.Add("Nuova installazione");
 | 
					    asCampi.Add("Nuova installazione");
 | 
				
			||||||
    m_pRadioBox = new wxRadioBox(this, 301, "Selezionare l'installazione da aggiornare (consigliato) o Nuova installazione", wxDefaultPosition, 
 | 
					    m_pRadioBox = new wxRadioBox(this, 301, "Selezionare l'installazione da aggiornare (consigliato) o Nuova installazione", 
 | 
				
			||||||
                               wxDefaultSize, asCampi, 0, wxRA_SPECIFY_ROWS);
 | 
					                                 wxDefaultPosition, wxDefaultSize, asCampi, 0, wxRA_SPECIFY_ROWS);
 | 
				
			||||||
    if (prechecked > 0)
 | 
					    if (prechecked > 0)
 | 
				
			||||||
      m_pRadioBox->SetSelection(prechecked);
 | 
					      m_pRadioBox->SetSelection(prechecked);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
@ -1077,40 +1110,13 @@ bool CampoWizardPage8::ForwardValidate()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  //controllo esistenza directory e programmi sul server
 | 
					  //controllo esistenza directory e programmi sul server
 | 
				
			||||||
  const wxString strPrgNetPath = Get(803);
 | 
					  const wxString strPrgNetPath = Get(803);
 | 
				
			||||||
  wxDir dirPrgPath(strPrgNetPath);
 | 
					  if (!CheckPrgDir(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)
 | 
					 | 
				
			||||||
    return ErrorBox("La cartella selezionata come origine dei programmi NON e' valida!");
 | 
					    return ErrorBox("La cartella selezionata come origine dei programmi NON e' valida!");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  //controllo esistenza dati sul server
 | 
					  //controllo esistenza dati sul server...
 | 
				
			||||||
  wxString strDataPath = Get(805);
 | 
					  const wxString strDataPath = Get(805);
 | 
				
			||||||
  if (!CheckDataDir(strDataPath))
 | 
					  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
 | 
					  //setta alla pagina riassuntiva i valori della pagina attuale
 | 
				
			||||||
  GetWizard().SetPrgLocPath(strPrgLocPath);
 | 
					  GetWizard().SetPrgLocPath(strPrgLocPath);
 | 
				
			||||||
@ -1351,11 +1357,16 @@ bool CampoWizardPage10::TransferDataToWindow()
 | 
				
			|||||||
      {
 | 
					      {
 | 
				
			||||||
        strBody += wxT("<p>Cartella di origine dei files del programma:  ");
 | 
					        strBody += wxT("<p>Cartella di origine dei files del programma:  ");
 | 
				
			||||||
        strBody += wxT(Bold(_strPrgNetPath) + "</p>");
 | 
					        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("<p>Cartella dati da creare:  ");
 | 
				
			||||||
        strBody += wxT(Bold(_strDataPath) + "</p>");
 | 
					        strBody += wxT(Bold(_strDataPath) + "</p>");
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
  //installazione servers...
 | 
					  //installazione servers...
 | 
				
			||||||
  if (!_strSrvAuth.IsEmpty())
 | 
					  if (!_strSrvAuth.IsEmpty())
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user