Patch level :4.0 800
Files correlati : Ricompilazione Demo : [ ] Commento :migliorata la gestione riavvio client in aggiornamento (semplicemente non c'era!) git-svn-id: svn://10.65.10.50/trunk@15686 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
2e78c0292f
commit
2a0f1f7b2b
@ -1514,28 +1514,27 @@ protected:
|
|||||||
virtual bool test_assistance_year() const;
|
virtual bool test_assistance_year() const;
|
||||||
virtual void main_loop();
|
virtual void main_loop();
|
||||||
|
|
||||||
bool testdatabase() const;
|
int test_type() const;
|
||||||
bool testprograms() const;
|
|
||||||
int testtype() const;
|
|
||||||
void convert_archives();
|
void convert_archives();
|
||||||
};
|
};
|
||||||
|
|
||||||
bool TInstaller::testdatabase() const
|
int TInstaller::test_type() const
|
||||||
{
|
{
|
||||||
TConfig ini(CONFIG_INSTALL, "Main");
|
TConfig ini(CONFIG_INSTALL, "Main");
|
||||||
return ini.get("TestDatabase","Main",-1,"Y") != "N";
|
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;
|
||||||
|
|
||||||
bool TInstaller::testprograms() const
|
ini.set("Type", type); //cosi' lo definisce se non c'e'
|
||||||
{
|
}
|
||||||
TConfig ini(CONFIG_INSTALL, "Main");
|
return type;
|
||||||
char c = ini.get("TestPrograms","Main",-1,"N")[0];
|
|
||||||
return c == 'X' || c == 'Y';
|
|
||||||
}
|
|
||||||
|
|
||||||
int TInstaller::testtype() const
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TInstaller::test_assistance_year() const
|
bool TInstaller::test_assistance_year() const
|
||||||
@ -1555,17 +1554,24 @@ bool TInstaller::create()
|
|||||||
else
|
else
|
||||||
update_dninst(false); // Aggiorna se necessario
|
update_dninst(false); // Aggiorna se necessario
|
||||||
|
|
||||||
if (testprograms())
|
//crea la maschera di installazione
|
||||||
|
_m = new TInstaller_mask();
|
||||||
|
|
||||||
|
//se e' un client
|
||||||
|
if (test_type() == 3)
|
||||||
{
|
{
|
||||||
_m = new TInstaller_mask() ;
|
|
||||||
_m->disable_check();
|
_m->disable_check();
|
||||||
_m->disable(F_PATH);
|
_m->disable(F_PATH);
|
||||||
_m->disable(F_UPDATE);
|
_m->disable(F_UPDATE);
|
||||||
_m->disable(DLG_USER);
|
_m->disable(DLG_USER);
|
||||||
return TSkeleton_application::create();
|
}
|
||||||
|
else //se e' standalone o server...
|
||||||
|
{
|
||||||
|
if (user() != ::dongle().administrator())
|
||||||
|
return error_box(TR("Solo l'utente amministratore puo' aggiornare questa postazione!"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return error_box(FR("L'utente %s non è abilitato all'uso di questo programma"), (const char *)user());
|
return TSkeleton_application::create();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TInstaller::convert_archives()
|
void TInstaller::convert_archives()
|
||||||
@ -1585,68 +1591,26 @@ void TInstaller::convert_archives()
|
|||||||
void TInstaller::main_loop()
|
void TInstaller::main_loop()
|
||||||
{
|
{
|
||||||
_m->run();
|
_m->run();
|
||||||
if (_m->run_conversion() && testdatabase()) // Almeno un trr installato ?
|
if (_m->run_conversion() && test_type() < 3) // Almeno un trr installato e non e' client->conversione ammessa
|
||||||
{
|
|
||||||
convert_archives();
|
|
||||||
}
|
|
||||||
delete _m; _m = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
class TExtendedInstaller : public TInstaller
|
|
||||||
{
|
|
||||||
protected:
|
|
||||||
virtual bool create();
|
|
||||||
virtual void main_loop();
|
|
||||||
};
|
|
||||||
|
|
||||||
bool TExtendedInstaller::create()
|
|
||||||
{
|
|
||||||
if (!TApplication::test_assistance_year())
|
|
||||||
{
|
|
||||||
TExternal_app attivazione("ba1 -4");
|
|
||||||
attivazione.run();
|
|
||||||
dongle().login(); // Rilegge anno assistenza
|
|
||||||
}
|
|
||||||
else
|
|
||||||
update_dninst(false); // Aggiorna se necessario
|
|
||||||
|
|
||||||
_m = new TInstaller_mask() ;
|
|
||||||
return TSkeleton_application::create();
|
|
||||||
}
|
|
||||||
|
|
||||||
void TExtendedInstaller::main_loop()
|
|
||||||
{
|
|
||||||
_m->run();
|
|
||||||
if (_m->run_conversion() && testdatabase()) // Almeno un modulo installato ?
|
|
||||||
{
|
{
|
||||||
convert_archives();
|
convert_archives();
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool pending = _m->modules_pending();
|
const bool pending = _m->modules_pending();
|
||||||
delete _m; _m = NULL;
|
delete _m; _m = NULL;
|
||||||
//le graffe servono per salvare il file campo.ini!! NON eliminarle
|
//le graffe servono per salvare il file campo.ini!! NON eliminarle
|
||||||
{
|
{
|
||||||
TConfig campo(CONFIG_INSTALL, "ba0close");
|
TConfig campo(CONFIG_INSTALL, "ba0close");
|
||||||
campo.set("ModulesPending", pending ? "1" : "0");
|
campo.set("ModulesPending", pending ? "1" : "0");
|
||||||
}
|
}
|
||||||
TExternal_app ba0close("ba0close.exe");
|
TExternal_app ba0close("ba0close.exe");
|
||||||
|
|
||||||
ba0close.run(true,true,false); // run asynchronous and not iconized!
|
ba0close.run(true, true, false); // run asynchronous and not iconized!
|
||||||
}
|
}
|
||||||
|
|
||||||
int ba1700(int argc, char* argv[])
|
int ba1700(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
const char* const PROGNAME = TR("Installazione moduli");
|
TInstaller app;
|
||||||
|
app.run(argc, argv, TR("Installazione moduli"));
|
||||||
if (user() != ::dongle().administrator())
|
|
||||||
{
|
|
||||||
TInstaller app;
|
|
||||||
app.run(argc, argv, PROGNAME);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
TExtendedInstaller app;
|
|
||||||
app.run(argc, argv, PROGNAME);
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user