Patch level :
Files correlati : Ricompilazione Demo : [ ] Commento : git-svn-id: svn://10.65.10.50/trunk@15723 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
8abe900362
commit
fdcdb2c058
@ -762,7 +762,7 @@ void CampoSetup::NormalSetup()
|
||||
//SOLO se sta aggiornando una versione antecedente alla 10.0 scrive la variabile Type nel campo.ini..
|
||||
//..ovvero deve testare se Type = 0
|
||||
if (CampoIniMain.GetInt("Type") == 0)
|
||||
CampoIniMain.Set("Type", uInstallationType + 1);
|
||||
CampoIniMain.Set("Type", CampoIniMain.GetInstallationTypeNumber());
|
||||
}
|
||||
|
||||
// 5) COMPILAZIONE\AGGIORNAMENTO INSTALL.INI CON DISKPATH
|
||||
@ -807,18 +807,26 @@ void CampoSetup::NormalSetup()
|
||||
{
|
||||
const wxFileName strExe(strPrgLocPath, wxT("ba0.exe"));
|
||||
wxString strLnk;
|
||||
switch (uInstallationType)
|
||||
|
||||
CampoIniFile CampoIniMain(strPrgLocPath + "/campo.ini", "Main");
|
||||
int nInstType = CampoIniMain.GetInstallationTypeNumber();
|
||||
switch (nInstType)
|
||||
{
|
||||
case 1:
|
||||
strLnk = "Campo (Server)";
|
||||
strLnk = "Campo";
|
||||
break;
|
||||
case 2:
|
||||
strLnk = "Campo (Server)";
|
||||
break;
|
||||
case 3:
|
||||
strLnk = "Campo (Client)";
|
||||
break;
|
||||
default:
|
||||
strLnk = "Campo";
|
||||
break;
|
||||
}
|
||||
|
||||
//crea comunque l'icona
|
||||
CreateIcon(CSIDL_COMMON_DESKTOPDIRECTORY, strExe, strLnk);
|
||||
}
|
||||
|
||||
@ -846,8 +854,10 @@ void CampoSetup::NormalSetup()
|
||||
// 10) CHIUDE IL SETUP LANCIANDO BA1 -6 PER INSTALLAZIONE MODULI
|
||||
//-------------------------------------------------------------
|
||||
//lanciare ba1.exe -6 in uscita
|
||||
wxSetWorkingDirectory(strPrgLocPath);
|
||||
wxExecute("ba1 -6 /uADMIN");
|
||||
if (wxSetWorkingDirectory(strPrgLocPath))
|
||||
wxExecute("ba1 -6 /uADMIN");
|
||||
else
|
||||
ErrorBox("Impossibile installare i moduli. Cartella di destinazione irraggiungibile!");
|
||||
|
||||
}
|
||||
|
||||
|
@ -41,48 +41,43 @@ wxString GetDefaultDestination()
|
||||
}
|
||||
|
||||
//Magico metodo per stabilire se una directory e' condivisa ed e' su un disco locale!!
|
||||
bool IsSharedLocal (const wxString& strDir)
|
||||
bool IsSharedDirectory (const wxString& strDir)
|
||||
{
|
||||
bool found = false;
|
||||
|
||||
wxString strDataDir = strDir.Lower();
|
||||
strDataDir.Replace ("/", "\\");
|
||||
|
||||
UINT nDataDriveType = GetDriveType(strDataDir.Left(3));
|
||||
|
||||
//l'area dati e' su un disco locale?
|
||||
if (nDataDriveType == DRIVE_FIXED)
|
||||
NET_API_STATUS res = ERROR_MORE_DATA;
|
||||
while (res==ERROR_MORE_DATA && !found)
|
||||
{
|
||||
NET_API_STATUS res = ERROR_MORE_DATA;
|
||||
while (res==ERROR_MORE_DATA && !found)
|
||||
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)
|
||||
{
|
||||
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)
|
||||
for (DWORD i = 0; i < nEntriesRead; i++)
|
||||
{
|
||||
for (DWORD i = 0; i < nEntriesRead; i++)
|
||||
/*Oh ignaro programmatore, questa parte commentata utilizza funzioni native di windows che non si sono riuscite..
|
||||
..a far funzionare! Se osi, prova la tua forza rendendole utili!
|
||||
//la directory dei dati deve essere leggibile,scrivibile,e filecreabile
|
||||
int Result = NetShareGetInfo(NULL, shi[i].shi502_netname, 502, (LPBYTE *)&shi[i]);
|
||||
if (shi[i].shi502_permissions & (PERM_FILE_READ | PERM_FILE_WRITE | PERM_FILE_CREATE))*/
|
||||
{
|
||||
/*Oh ignaro programmatore, questa parte commentata utilizza funzioni native di windows che non si sono riuscite..
|
||||
..a far funzionare! Se osi, prova la tua forza rendendole utili!
|
||||
//la directory dei dati deve essere leggibile,scrivibile,e filecreabile
|
||||
int Result = NetShareGetInfo(NULL, shi[i].shi502_netname, 502, (LPBYTE *)&shi[i]);
|
||||
if (shi[i].shi502_permissions & (PERM_FILE_READ | PERM_FILE_WRITE | PERM_FILE_CREATE))*/
|
||||
wxString strPath(shi[i].shi502_path);
|
||||
strPath.MakeLower();
|
||||
//se trova la directory di studio condivisa ed e' su disco locale -> server
|
||||
if (strDir.StartsWith(strPath))
|
||||
{
|
||||
wxString strPath(shi[i].shi502_path);
|
||||
strPath.MakeLower();
|
||||
//se trova la directory di studio condivisa ed e' su disco locale -> server
|
||||
if (strDir.StartsWith(strPath))
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
} //for(DWORD i...
|
||||
NetApiBufferFree(shi);
|
||||
} //if(res ==...
|
||||
} //while (res==ERROR_MORE_DATA...
|
||||
} //if (nDataDriveType...
|
||||
}
|
||||
} //for(DWORD i...
|
||||
NetApiBufferFree(shi);
|
||||
} //if(res ==...
|
||||
} //while (res==ERROR_MORE_DATA...
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
@ -147,15 +142,16 @@ int CampoIniFile::GetInstallationTypeNumber() const
|
||||
int nType = GetInt("Type");
|
||||
if (nType < 1 || nType > 3)
|
||||
{
|
||||
nType = 1; //di base e' standalone
|
||||
const bool bTestDataBase = GetBool("TestDatabase");
|
||||
const bool bTestPrograms = GetBool("TestPrograms");
|
||||
nType = 1; //di base e' standalone
|
||||
|
||||
if (bTestDataBase) //se puo' manipolare i dati e' StandAlone o Server..
|
||||
{
|
||||
//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 (IsSharedLocal(strStudy))
|
||||
if (IsSharedDirectory(strStudy))
|
||||
nType = 2; //e' server
|
||||
}
|
||||
else //..senno' e' client
|
||||
|
@ -372,13 +372,13 @@ CampoWizardPage3::CampoWizardPage3(wxWizard* parent) : CampoWizardPage(parent)
|
||||
switch (nType)
|
||||
{
|
||||
case 1:
|
||||
strPath << " (Standard)";
|
||||
strPath << " (Standard)";
|
||||
break;
|
||||
case 2:
|
||||
strPath << " (Server)";
|
||||
strPath << " (Server)";
|
||||
break;
|
||||
case 3:
|
||||
strPath << " (Client)";
|
||||
strPath << " (Client)";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -1111,22 +1111,35 @@ bool CampoWizardPage8::TransferDataToWindow()
|
||||
|
||||
bool CampoWizardPage8::ForwardValidate()
|
||||
{
|
||||
//controlli su directory selezionate
|
||||
|
||||
//1) directory di installazione programmi
|
||||
const wxString strPrgLocPath = Get(801);
|
||||
//la directory di installazione programmi deve essere su un disco locale (sei un client!)
|
||||
UINT nPrgDriveType = GetDriveType(strPrgLocPath.Left(3));
|
||||
if (nPrgDriveType != DRIVE_FIXED)
|
||||
return ErrorBox("La cartella selezionata per l'installazione dei programmi deve trovarsi su un disco locale!");
|
||||
//controllo esistenza directory vuota per i programmi in locale
|
||||
const wxString strPrgLocPath = Get(801);
|
||||
wxDir dirPrgLocPath(strPrgLocPath);
|
||||
if (dirPrgLocPath.Exists(strPrgLocPath) && (dirPrgLocPath.HasFiles() || dirPrgLocPath.HasSubDirs()))
|
||||
return ErrorBox("La cartella selezionata per l'installazione dei programmi NON e' valida! Selezionarne un'altra!");
|
||||
|
||||
//controllo esistenza directory e programmi sul server
|
||||
//2) directory di origine dei programmi sul server
|
||||
const wxString strPrgNetPath = Get(803);
|
||||
if (!CheckPrgDir(strPrgNetPath))
|
||||
return ErrorBox("La cartella selezionata come origine dei programmi NON e' valida!");
|
||||
|
||||
//controllo esistenza dati sul server...
|
||||
//3) directory dati sul server
|
||||
const wxString strDataPath = Get(805);
|
||||
//la cartella dei dati deve essere in remoto,senno' sei una postazione locale o un server
|
||||
UINT nDataDriveType = GetDriveType(strDataPath.Left(3));
|
||||
if (nDataDriveType != DRIVE_REMOTE)
|
||||
return ErrorBox("La cartella dei dati deve trovarsi su un server remoto e non su un disco locale!");
|
||||
//la cartella dei dati deve contenerli ed essere scrivibile
|
||||
if (!CheckDataDir(strDataPath))
|
||||
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);
|
||||
GetWizard().SetPrgNetPath(strPrgNetPath);
|
||||
|
Loading…
x
Reference in New Issue
Block a user