Patch level :2.1 22
Files correlati :ba0.exe ba1.exe ba1400a.msk install.ini Ricompilazione Demo : [ ] Commento :corrette le modalita' di installazione git-svn-id: svn://10.65.10.50/trunk@11949 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
829f30e2be
commit
e096f5a9ec
@ -66,6 +66,7 @@ protected: // TApplication
|
||||
|
||||
protected:
|
||||
void deconnect_user();
|
||||
bool dll_changed() const;
|
||||
virtual void main_loop();
|
||||
|
||||
void test_temp();
|
||||
@ -911,6 +912,9 @@ bool TMenu_application::test_programs()
|
||||
app.run();
|
||||
user() = old_user; // Ripristino utente normale
|
||||
more = TRUE; // ricontrolla
|
||||
|
||||
if (dll_changed()) //costringe ad uscire dal programma se si e' installato il modulo SY
|
||||
return false;
|
||||
}
|
||||
_menu.set_dangerous_modules(dangerous);
|
||||
return TRUE;
|
||||
@ -980,14 +984,19 @@ void TMenu_application::deconnect_user()
|
||||
}
|
||||
}
|
||||
|
||||
bool TMenu_application::dll_changed() const
|
||||
{
|
||||
TString_array list;
|
||||
list_files("*.ex_", list);
|
||||
list_files("*.dl_", list);
|
||||
return (list.items() > 0);
|
||||
}
|
||||
|
||||
bool TMenu_application::destroy()
|
||||
{
|
||||
deconnect_user();
|
||||
|
||||
TString_array list;
|
||||
list_files("*.ex_", list);
|
||||
list_files("*.dl_", list);
|
||||
if (list.items() > 0)
|
||||
if (dll_changed())
|
||||
{
|
||||
TExternal_app ba0close("ba0close.exe");
|
||||
ba0close.run(TRUE,TRUE,TRUE); // run asynchronous...
|
||||
|
@ -3,7 +3,7 @@
|
||||
#define F_USERDESC 103
|
||||
#define F_GROUP 104
|
||||
#define F_GROUPNAME 105
|
||||
#define F_TEST 106
|
||||
#define F_PROVA 106
|
||||
#define F_APPLICAT 107
|
||||
#define F_NOWRITE 108
|
||||
|
||||
|
@ -656,7 +656,7 @@ int TSet_users::read(TMask& m)
|
||||
|
||||
const TString16 pwd = decode(r.get("PASSWORD"));
|
||||
m.set(F_PASSWORD, pwd);
|
||||
m.set(F_TEST, pwd);
|
||||
m.set(F_PROVA, pwd);
|
||||
|
||||
build_tree(&r);
|
||||
|
||||
@ -758,7 +758,7 @@ int TSet_user_passwd::read(TMask& m)
|
||||
|
||||
const TString16 pwd =decode(r.get("PASSWORD"));
|
||||
m.set(F_PASSWORD, pwd);
|
||||
m.set(F_TEST, pwd);
|
||||
m.set(F_PROVA, pwd);
|
||||
|
||||
return NOERR;
|
||||
}
|
||||
|
@ -61,11 +61,11 @@ BEGIN
|
||||
GROUP 3
|
||||
END
|
||||
|
||||
STRING F_TEST 8
|
||||
STRING F_PROVA 8
|
||||
BEGIN
|
||||
PROMPT 32 3 "Prova "
|
||||
FLAGS "*"
|
||||
STR_EXPR #F_TEST=#F_PASSWORD
|
||||
STR_EXPR #F_PROVA=#F_PASSWORD
|
||||
WARNING "La password ed la sua prova devono coincidere"
|
||||
GROUP 3
|
||||
END
|
||||
|
105
ba/ba1700.cpp
105
ba/ba1700.cpp
@ -93,7 +93,7 @@ protected: // TSheet
|
||||
virtual bool on_key(KEY key);
|
||||
static bool quit_handler(TMask_field& f, KEY k);
|
||||
static bool tutti_handler(TMask_field& f, KEY k);
|
||||
int get_module_number(const char* module) const;
|
||||
int get_module_number(const TString& module) const;
|
||||
bool has_module(int modnumber) const;
|
||||
bool is_zip_file(const TFilename& n) const;
|
||||
|
||||
@ -201,7 +201,7 @@ 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)))
|
||||
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;
|
||||
}
|
||||
return main_app().has_module(modnumber, CHK_DONGLE);
|
||||
@ -210,17 +210,19 @@ bool TInstaller_mask::has_module(int modnumber) const
|
||||
int TInstaller_mask::precheck_modules(bool only_newer)
|
||||
{
|
||||
TString16 release,currrelease;
|
||||
TString4 cod_module;
|
||||
int patchlevel,modnumber,currpatch;
|
||||
|
||||
TString_array& array = rows_array();
|
||||
FOR_EACH_ARRAY_ROW_BACK(array, r, row)
|
||||
FOR_EACH_ARRAY_ROW(array, r, row)
|
||||
{
|
||||
TToken_string& rigar = *row;
|
||||
cod_module = rigar.get(C_CODE);
|
||||
release = rigar.get(C_RELEASE);
|
||||
patchlevel = rigar.get_int(C_PATCH);
|
||||
currrelease = rigar.get(C_CURRRELEASE);
|
||||
currpatch = rigar.get_int(C_CURRPATCH);
|
||||
modnumber=get_module_number(rigar.get(C_CODE));
|
||||
modnumber = get_module_number(cod_module);
|
||||
if (modnumber >= 0 && has_module(modnumber) &&
|
||||
!release.blank() &&
|
||||
((release > currrelease) ||
|
||||
@ -229,7 +231,14 @@ int TInstaller_mask::precheck_modules(bool only_newer)
|
||||
{
|
||||
// checca il modulo o la patch se ho installata la stessa versione
|
||||
const bool chk = rigar.get_char(C_ISPATCH) != 'X' || release == currrelease;
|
||||
check(r,chk );
|
||||
check(r, chk);
|
||||
if (chk && only_newer && cod_module == "sy") //se viene checkato il modulo sy (sistema) deve togliere..
|
||||
{ //..la possibilita' di installare altri moduli..
|
||||
for (int i = 0; i < array.items(); i++)
|
||||
disable_row(i); //disabilita tutte le righe dello sheet
|
||||
disable(DLG_USER);
|
||||
break; //..ed uscire
|
||||
}
|
||||
}
|
||||
}
|
||||
force_update(); // Indispensabile per vedere le righe aggiornate
|
||||
@ -237,13 +246,16 @@ int TInstaller_mask::precheck_modules(bool only_newer)
|
||||
}
|
||||
|
||||
|
||||
int TInstaller_mask::get_module_number(const char* module) const
|
||||
int TInstaller_mask::get_module_number(const TString& module) const
|
||||
{
|
||||
int aut = -1;
|
||||
if (module && * module)
|
||||
bool ok = FALSE;
|
||||
if (module.not_empty())
|
||||
{
|
||||
if (module == "ba" || module == "sy") //moduli base e sistema: deve ritornare 0;
|
||||
return 0;
|
||||
|
||||
TScanner scanner(AUT_FILE);
|
||||
bool ok = FALSE;
|
||||
for (aut = 0; scanner.line() != ""; aut++)
|
||||
if (scanner.token().starts_with(module))
|
||||
{ ok = TRUE; break; }
|
||||
@ -333,16 +345,13 @@ bool TInstaller_mask::autoload()
|
||||
destroy();
|
||||
force_update();
|
||||
|
||||
ininame=path;
|
||||
ininame.add(TInstall_ini::default_name());
|
||||
|
||||
TString_array modules;
|
||||
|
||||
if (ininame.exist())
|
||||
{
|
||||
// Presente il file ini generale "install.ini"
|
||||
// Presente il file ini generale "install.ini" (moduli;immagine cd)
|
||||
TInstall_ini ini(ininame);
|
||||
ini.list_paragraphs(modules);
|
||||
ini.list_paragraphs(modules); //riempie modules con la lista dei paragrafi sul .ini ***
|
||||
|
||||
FOR_EACH_ARRAY_ROW(modules, i, row)
|
||||
{
|
||||
@ -370,10 +379,10 @@ bool TInstaller_mask::autoload()
|
||||
}
|
||||
else
|
||||
{
|
||||
// Presenti i singoli file ini dei moduli
|
||||
// Presenti i singoli file .ini dei moduli (pacchi ma non patches!)
|
||||
ininame = path;
|
||||
ininame.add("??inst.ini");
|
||||
list_files(ininame, modules);
|
||||
list_files(ininame, modules); //ritorna la lista dei files presenti nel .ini della patch ***
|
||||
FOR_EACH_ARRAY_ROW(modules, m, row)
|
||||
{
|
||||
TString& ininame = *row;
|
||||
@ -385,11 +394,10 @@ bool TInstaller_mask::autoload()
|
||||
add_module(ini, module, FALSE);
|
||||
}
|
||||
}
|
||||
// add patches
|
||||
|
||||
modules.destroy();
|
||||
|
||||
if (internet)
|
||||
if (internet) //internet patches
|
||||
{
|
||||
http_dir(http_server, http_path, modules);
|
||||
for (int i = modules.last(); i >= 0; i--)
|
||||
@ -415,15 +423,36 @@ bool TInstaller_mask::autoload()
|
||||
}
|
||||
modules.pack();
|
||||
}
|
||||
else
|
||||
else //normal patches
|
||||
{
|
||||
ininame = path;
|
||||
ininame.add("??0???a.ini");
|
||||
list_files(ininame, modules);
|
||||
list_files(ininame, modules);
|
||||
}
|
||||
|
||||
modules.sort(); // sort to have patches in patchlevel order
|
||||
if (modules.items() > 0) //ordina i moduli come sull'install.ini locale (per avere SY come primo
|
||||
{ //modulo e via via gli altri)
|
||||
TInstall_ini installini;
|
||||
TString_array paragrafi;
|
||||
installini.list_paragraphs(paragrafi);
|
||||
TFilename file;
|
||||
FOR_EACH_ARRAY_ROW(modules, am, arow)
|
||||
{
|
||||
file = *arow;
|
||||
file = file.name();
|
||||
int pos = paragrafi.find(file.left(2));
|
||||
if (pos <= 0)
|
||||
pos = 10000+am;
|
||||
TString8 str;
|
||||
str.format("%05d", pos); //aggiunge un numero d'ordine sulla sinistra del nome del file..
|
||||
arow->insert(str);
|
||||
}
|
||||
modules.sort(); //..cosi' che la sort (che ordina alfabeticamente) sistemi la lista moduli
|
||||
|
||||
FOR_EACH_ARRAY_ROW(modules, bm, brow) //rimette i nomi dei moduli a posto (toglie il numero d'ordine)
|
||||
brow->ltrim(5);
|
||||
}
|
||||
//genera le righe dello sheet di installazione
|
||||
FOR_EACH_ARRAY_ROW(modules, am, arow)
|
||||
{
|
||||
TString& ininame = *arow;
|
||||
@ -752,7 +781,7 @@ bool TInstaller_mask::install(const TString& module, int patchlevel)
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
// ***************
|
||||
// ==============
|
||||
// decompressione
|
||||
msg = TR("Decompressione");
|
||||
if (is_a_patch)
|
||||
@ -817,7 +846,7 @@ bool TInstaller_mask::install(const TString& module, int patchlevel)
|
||||
aga_unzip(totti, tempdir); // Scompatta il file totale
|
||||
::remove(totti);
|
||||
|
||||
// ***************
|
||||
// =============
|
||||
// trasferimento
|
||||
if (ok)
|
||||
{
|
||||
@ -1027,7 +1056,7 @@ bool TInstaller_mask::install_patches(const TString& module, const TString& last
|
||||
ininame << "0???a.ini";
|
||||
modules.destroy();
|
||||
list_files(ininame, modules);
|
||||
modules.sort(); // sort by patch number
|
||||
modules.sort();
|
||||
FOR_EACH_ARRAY_ROW(modules, am, arow)
|
||||
{
|
||||
TString& ininame = *arow;
|
||||
@ -1081,6 +1110,9 @@ bool TInstaller_mask::path_handler(TMask_field& fld, KEY key)
|
||||
void TInstaller_mask::install_selection()
|
||||
{
|
||||
TString_array& arr = rows_array();
|
||||
|
||||
bool sys_installed = false;
|
||||
|
||||
FOR_EACH_ARRAY_ROW(arr, r, row) if (checked(r))
|
||||
{
|
||||
|
||||
@ -1148,17 +1180,36 @@ void TInstaller_mask::install_selection()
|
||||
message_box(TR("Impossibile installare le patch del modulo '%s'"),(const char *)modulo);
|
||||
}
|
||||
else
|
||||
{
|
||||
ok = install(modulo, 0); // installa il modulo
|
||||
}
|
||||
if (ok)
|
||||
{
|
||||
_installed = TRUE; // Setta il flag di almeno un modulo installato
|
||||
if (ok)
|
||||
check(r, FALSE);
|
||||
if (modulo == "sy") //se ha installato il modulo 'sy' esce
|
||||
{
|
||||
sys_installed = true;
|
||||
enable_row(r); //deve abilitare la riga di system senno' non la puo' uncheckare dopo
|
||||
uncheck(-1); //uncheck di tutti i moduli
|
||||
break;
|
||||
}
|
||||
uncheck(r); //finalmente unchecka i moduli installati
|
||||
}
|
||||
}
|
||||
else
|
||||
check(r,FALSE); // uncheck
|
||||
uncheck(r); // se non ci sono patch o moduli -> uncheck
|
||||
}
|
||||
force_update(); //serve per togliere il check al modulo 'sy' quando viene installato
|
||||
if (installed())
|
||||
message_box(TR("Installazione conclusa"));
|
||||
{
|
||||
if (sys_installed)
|
||||
{
|
||||
warning_box("Modulo SY installato: altri moduli selezionati dovranno essere installati successivamente");
|
||||
send_key(K_SPACE, DLG_QUIT);
|
||||
}
|
||||
else
|
||||
message_box(TR("Installazione conclusa"));
|
||||
}
|
||||
}
|
||||
|
||||
bool TInstaller_mask::install_handler(TMask_field& fld, KEY key)
|
||||
|
2124
ba/install.ini
2124
ba/install.ini
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user