Patch level :4.0 800

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :se sei un server ti installo tutti i moduli cosi' non rompi i coglioni in futuro!


git-svn-id: svn://10.65.10.50/trunk@15688 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca 2007-10-08 10:58:53 +00:00
parent 2a0f1f7b2b
commit cffabe2571

View File

@ -82,6 +82,7 @@ bool is_internet_path(const TString& addr)
class TInstaller_mask : public TArray_sheet
{
static TInstaller_mask* _curr_mask;
int _station_type; //intero che definisce il tipo di installazione (1=std,2=server,3=client)
bool _installed; // Flag per verificare se almeno un modulo e' stato installato
bool _sys_installed; //Flag per controllare l'installazione del modulo di sistema SY
bool _modules_pending; //Flag per controllare se ci sono altri moduli da installare oltre a sy
@ -101,6 +102,7 @@ protected: // TSheet
void create_dirs(const char* path) const;
bool copy_tree(const char* src_study, const char* dst_study) const;
int test_type() const;
protected:
static bool path_handler(TMask_field& fld, KEY key);
@ -132,6 +134,7 @@ public:
bool installed() const { return _installed;}
bool sys_installed() const { return _sys_installed;}
bool modules_pending() const { return _modules_pending && sys_installed();}
int station_type() const {return _station_type;}
bool autoload();
bool install(const TString& module, int patch);
@ -212,15 +215,39 @@ static int compare_modules(const TObject** o1, const TObject** o2)
bool TInstaller_mask::has_module(int modnumber) const
{
if (modnumber == SRAUT)
{
char s[16];
if (xvt_fsys_get_campo_stp_value("Servers", s, sizeof(s)) || xvt_fsys_get_campo_stp_value("Sy", s, sizeof(s))) //***aggiunto il modulo sy
return atoi(s) > 0;
}
//se sei un server hai tutti i moduli da installare
if (station_type() == 2)
return true;
//senno' sei sfigato e ti installa solo i moduli sulla chiave
return main_app().has_module(modnumber, CHK_DONGLE);
}
//che tipo di installazione e'?
int TInstaller_mask::test_type() const
{
TConfig ini(CONFIG_INSTALL, "Main");
int type = ini.get_int("Type");
//se type non e' definito nei valori giusti (1=standard,2=server,3=client)
if (type < 1 || type > 3)
{
const bool testdb = ini.get_bool("TestDatabase");
const bool testprg = ini.get_bool("TestPrograms");
if (testdb)
{
if (dongle().hardware() == _dongle_network) //se usa un server di chiavi->server
type = 2;
else
type = 1;
}
else
type = 3;
ini.set("Type", type); //cosi' lo definisce se non c'e'
}
return type;
}
int TInstaller_mask::precheck_modules(bool only_newer)
{
TString16 release,currrelease;
@ -1443,6 +1470,7 @@ TInstaller_mask::TInstaller_mask()
HR("@1|Modulo@32|Cod.@3|Versione da\ninstallare@11|Liv.\nPatch@6|Data\nRilascio@10|Versione\nInstallata@10|Liv.\nPatch@6|Data\nInstallazione@13|Aggiornamento|Patch Base"),
0x18, 3)
{
_station_type = test_type();
_curr_mask = this;
_installed = false;
_sys_installed = false;
@ -1513,29 +1541,9 @@ protected:
virtual bool use_files() const { return false; }
virtual bool test_assistance_year() const;
virtual void main_loop();
int test_type() const;
void convert_archives();
};
int TInstaller::test_type() const
{
TConfig ini(CONFIG_INSTALL, "Main");
int type = ini.get_int("Type");
//se type non e' definito nei valori giusti (1=standard,2=server,3=client)
if (type < 1 || type > 3)
{
const bool testdb = ini.get_bool("TestDatabase");
const bool testprg = ini.get_bool("TestPrograms");
if (testdb)
type = 1;
else
type = 3;
ini.set("Type", type); //cosi' lo definisce se non c'e'
}
return type;
}
bool TInstaller::test_assistance_year() const
{
@ -1558,7 +1566,7 @@ bool TInstaller::create()
_m = new TInstaller_mask();
//se e' un client
if (test_type() == 3)
if (_m->station_type() == 3)
{
_m->disable_check();
_m->disable(F_PATH);
@ -1591,7 +1599,7 @@ void TInstaller::convert_archives()
void TInstaller::main_loop()
{
_m->run();
if (_m->run_conversion() && test_type() < 3) // Almeno un trr installato e non e' client->conversione ammessa
if (_m->run_conversion() && _m->station_type() < 3) // Almeno un trr installato e non e' client->conversione ammessa
{
convert_archives();
}