Patch level :10.0 244
Files correlati : Ricompilazione Demo : [ ] Commento :Sistemato problema aggiornamento client in presenza di file da killare che compaiono in una patch e non in una versione (problema segnalato da installazione Verga). Adesso è possibile aggiungere files da uccidere anche nelle patch. Resta ovviamente sottinteso che PRIMA va aggiornato il server e POI il client. git-svn-id: svn://10.65.10.50/trunk@18303 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
16cef4ca99
commit
b434396504
@ -224,7 +224,7 @@ int TInstall_ini::build_kill_list(const TString& module, TString_array& a,
|
|||||||
return a.items();
|
return a.items();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TInstall_ini::export_paragraph(const char* module, const char* summary,const bool remove_old)
|
void TInstall_ini::export_paragraph(const char* module, const char* summary, const bool remove_old)
|
||||||
{
|
{
|
||||||
CHECK(module && *module > ' ', "Can't export NULL module");
|
CHECK(module && *module > ' ', "Can't export NULL module");
|
||||||
CHECK(summary && *summary > ' ', "Can't export to NULL .ini");
|
CHECK(summary && *summary > ' ', "Can't export to NULL .ini");
|
||||||
@ -254,13 +254,13 @@ void TInstall_ini::export_paragraph(const char* module, const char* summary,cons
|
|||||||
TString ;
|
TString ;
|
||||||
FOR_EACH_ASSOC_STRING(ass, obj, key, str)
|
FOR_EACH_ASSOC_STRING(ass, obj, key, str)
|
||||||
{
|
{
|
||||||
if (!remove_old && is_submodule && strncmp(key, "File", 4)==0 )
|
if (!remove_old && is_submodule && strncmp(key, "File", 4) == 0 )
|
||||||
{
|
{
|
||||||
// merging "File(X)" items...
|
// merging "File(X)" items...
|
||||||
item_value=str;
|
item_value = str;
|
||||||
tmps=item_value.get(0);
|
tmps = item_value.get(0);
|
||||||
int item_number=find(tmps, old_list);
|
int item_number = find(tmps, old_list);
|
||||||
if (item_number>=0)
|
if (item_number >= 0)
|
||||||
{
|
{
|
||||||
// file sostituito
|
// file sostituito
|
||||||
TString old_smodule(old_list.row(item_number).get(2));
|
TString old_smodule(old_list.row(item_number).get(2));
|
||||||
@ -276,7 +276,7 @@ void TInstall_ini::export_paragraph(const char* module, const char* summary,cons
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
while (obj);
|
while (obj);
|
||||||
newkey=obj->key();
|
newkey = obj->key();
|
||||||
if (old_smodule!=module)
|
if (old_smodule!=module)
|
||||||
{
|
{
|
||||||
// devo cancellare il file dal vecchio sottomodulo
|
// devo cancellare il file dal vecchio sottomodulo
|
||||||
|
277
ba/ba1700.cpp
277
ba/ba1700.cpp
@ -137,11 +137,12 @@ protected:
|
|||||||
static bool install_handler(TMask_field& fld, KEY key);
|
static bool install_handler(TMask_field& fld, KEY key);
|
||||||
static bool update_handler(TMask_field& f, KEY k);
|
static bool update_handler(TMask_field& f, KEY k);
|
||||||
|
|
||||||
bool add_module(TConfig& ini, const TString& module, bool patch, int pos=-1);
|
bool add_module(TConfig& ini, const TString& module, bool patch, int pos = -1);
|
||||||
bool add_header(TConfig& ini, const TString& module);
|
bool add_header(TConfig& ini, const TString& module);
|
||||||
int precheck_modules(bool only_newer=true);
|
int precheck_modules(bool only_newer = true);
|
||||||
void update_version();
|
void update_version();
|
||||||
void update_install_ini() const;
|
void update_disk_and_web_path();
|
||||||
|
void kill_files();
|
||||||
|
|
||||||
int needs_reboot(const TFilename& file) const;
|
int needs_reboot(const TFilename& file) const;
|
||||||
bool move_file(const TFilename& src, const TFilename& dst) const;
|
bool move_file(const TFilename& src, const TFilename& dst) const;
|
||||||
@ -149,8 +150,8 @@ protected:
|
|||||||
|
|
||||||
bool can_install(const char* module, TInstall_ini& ini);
|
bool can_install(const char* module, TInstall_ini& ini);
|
||||||
void install_selection();
|
void install_selection();
|
||||||
bool install_patches(const TString& module, const TString& lastrelease, int lastpatch , bool onlynew=true);
|
bool install_patches(const TString& module, const TString& lastrelease, int lastpatch , bool onlynew = true);
|
||||||
KEY askdisk(TString & path, TFilename & cmdline, int d, int dischi, const char * modulo);
|
KEY askdisk(TString& path, TFilename& cmdline, int d, int dischi, const char* modulo);
|
||||||
|
|
||||||
bool do_process(TToken_string& commands) const;
|
bool do_process(TToken_string& commands) const;
|
||||||
bool pre_process(TInstall_ini& ini, const char* module) const;
|
bool pre_process(TInstall_ini& ini, const char* module) const;
|
||||||
@ -869,13 +870,81 @@ KEY TInstaller_mask::askdisk(TString & path, TFilename & cmdline, int d, int dis
|
|||||||
return k;
|
return k;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//rimozione da disco dei files da eliminare indicati nei paragrafi kill..
|
||||||
|
//..e successivo aggiornamento dell'install.ini in modo da non avere più tra i piedi i files killati
|
||||||
|
void TInstaller_mask::kill_files()
|
||||||
|
{
|
||||||
|
//apre l'install.ini locale per effettuare l'aggiornamento
|
||||||
|
TInstall_ini ini;
|
||||||
|
//giro su tutti i sottomoduli di tipo 99 con l'elenco dei files da uccidere
|
||||||
|
TString_array paragraph_names;
|
||||||
|
ini.list_paragraphs(paragraph_names);
|
||||||
|
|
||||||
|
FOR_EACH_ARRAY_ROW(paragraph_names, nriga, riga)
|
||||||
|
{
|
||||||
|
//interessano solo i paragrafi con le killer list
|
||||||
|
if (riga->ends_with("99") && ini.set_paragraph(*riga))
|
||||||
|
{
|
||||||
|
TString_array killed;
|
||||||
|
|
||||||
|
TToken_string rigaini;
|
||||||
|
TFilename filetokill;
|
||||||
|
for (int k = 0;; k++)
|
||||||
|
{
|
||||||
|
rigaini = ini.get("Kill", NULL, k, "");
|
||||||
|
if (rigaini.empty())
|
||||||
|
break;
|
||||||
|
filetokill = rigaini.get(0);
|
||||||
|
if (filetokill.find('*') >= 0 || filetokill.find('?') >= 0)
|
||||||
|
{
|
||||||
|
TString_array filelist;
|
||||||
|
list_files (filetokill, filelist);
|
||||||
|
FOR_EACH_ARRAY_ROW(filelist, r, file)
|
||||||
|
{
|
||||||
|
if (fexist(*file))
|
||||||
|
::remove_file(*file);
|
||||||
|
killed.add(*file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (fexist(filetokill))
|
||||||
|
::remove_file(filetokill);
|
||||||
|
killed.add(filetokill);
|
||||||
|
}
|
||||||
|
} //for(int k=0...
|
||||||
|
|
||||||
|
for (int s = 0; s <= 9 && !killed.empty(); s++)
|
||||||
|
{
|
||||||
|
const TString4 mod = riga->left(2);
|
||||||
|
const int cicli = mod == "ba" ? 2 : 1;
|
||||||
|
for (int c = 1; c <= cicli; c++)
|
||||||
|
{
|
||||||
|
TString4 module = c == 1 ? mod : "sy";
|
||||||
|
module << s;
|
||||||
|
TAssoc_array& vars = ini.list_variables(module);
|
||||||
|
FOR_EACH_ASSOC_STRING(vars, hobj, key, str)
|
||||||
|
{
|
||||||
|
const int idx = killed.find(str);
|
||||||
|
if (idx >= 0)
|
||||||
|
{
|
||||||
|
ini.remove(key);
|
||||||
|
killed.destroy(idx, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} //for (int s...
|
||||||
|
} //if (riga->ends_with...
|
||||||
|
} //FOR_EACH_ARRAY_ROW(...
|
||||||
|
}
|
||||||
|
|
||||||
bool TInstaller_mask::install(const TString& module, int patchlevel)
|
bool TInstaller_mask::install(const TString& module, int patchlevel)
|
||||||
{
|
{
|
||||||
bool cancelled = false;
|
bool cancelled = false;
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
TString msg; // stringa per i messaggi
|
TString msg; // stringa per i messaggi
|
||||||
TString16 lastrelease; // release che sto installando
|
TString16 lastrelease; // release che sto installando
|
||||||
int lastpatch=patchlevel; // patchlevel che sto installando
|
int lastpatch = patchlevel; // patchlevel che sto installando
|
||||||
|
|
||||||
TFilename path ;
|
TFilename path ;
|
||||||
TString http_server;
|
TString http_server;
|
||||||
@ -886,64 +955,81 @@ bool TInstaller_mask::install(const TString& module, int patchlevel)
|
|||||||
parse_internet_path(http_server,http_path );
|
parse_internet_path(http_server,http_path );
|
||||||
|
|
||||||
const bool is_a_patch = (patchlevel > 0);
|
const bool is_a_patch = (patchlevel > 0);
|
||||||
TFilename ininame = path;
|
//file .ini con le info di installazione (es. bainst.ini o ba0883.ini)
|
||||||
ininame.add(module);
|
TFilename remote_ininame = path;
|
||||||
|
remote_ininame.add(module);
|
||||||
|
|
||||||
|
//completa il nome del file .ini controllando se è una patch (es. ba0883a.ini) o se è un pacco (es. bainst.ini)
|
||||||
if (is_a_patch)
|
if (is_a_patch)
|
||||||
{
|
{
|
||||||
TString16 name;
|
TString16 name;
|
||||||
name.format("%04da.ini", patchlevel);
|
name.format("%04da.ini", patchlevel);
|
||||||
ininame << name;
|
remote_ininame << name;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ininame << "inst.ini";
|
remote_ininame << "inst.ini";
|
||||||
|
|
||||||
if (internet && !ininame.exist())
|
if (internet && !remote_ininame.exist())
|
||||||
{
|
{
|
||||||
TFilename remote = ininame.name();
|
TFilename remote = remote_ininame.name();
|
||||||
remote.insert(http_path, 0);
|
remote.insert(http_path, 0);
|
||||||
http_get(http_server, remote, ininame);
|
http_get(http_server, remote, remote_ininame);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ininame.exist())
|
if (remote_ininame.exist())
|
||||||
{
|
{
|
||||||
// esiste un particolare .ini con formato XXinst.ini (moduli) o con XX9999a.ini (patch)
|
// esiste un particolare .ini con formato XXinst.ini (moduli) o con XX9999a.ini (patch)
|
||||||
// (installazione da directory con .zip)
|
//----------------------------------------------
|
||||||
TInstall_ini* ini = new TInstall_ini(ininame);
|
// (INSTALLAZIONE DA DIRECTORY CON FILES .ZIP)
|
||||||
ini->write_protect();
|
//----------------------------------------------
|
||||||
lastpatch=ini->get_int("Patch",module);
|
//remote_ini è il file .ini con le info di installazione (es. ba0883a.ini, bainst.ini)
|
||||||
lastrelease=ini->get("Versione",module);
|
TInstall_ini* remote_ini = new TInstall_ini(remote_ininame);
|
||||||
if (!can_install(module, *ini))
|
remote_ini->write_protect();
|
||||||
|
lastpatch = remote_ini->get_int("Patch", module);
|
||||||
|
lastrelease = remote_ini->get("Versione", module);
|
||||||
|
|
||||||
|
//se non può installare il modulo chiude il remote_ini
|
||||||
|
if (!can_install(module, *remote_ini))
|
||||||
{
|
{
|
||||||
delete ini;
|
delete remote_ini;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const int dischi = ini->get_int("Dischi", module);
|
|
||||||
|
//antico controllo del numero di dischetti (ora sempre = 1)
|
||||||
|
const int dischi = remote_ini->get_int("Dischi", module);
|
||||||
ok = dischi > 0;
|
ok = dischi > 0;
|
||||||
if (!ok)
|
if (!ok)
|
||||||
return error_box(FR("Impossibile determinare il numero dei dischetti in %s"),ininame.name());
|
return error_box(FR("Impossibile determinare il numero dei dischetti in %s"), remote_ininame.name());
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (patchlevel==0)
|
if (patchlevel == 0)
|
||||||
ok = pre_process(*ini, module);
|
ok = pre_process(*remote_ini, module);
|
||||||
if (!ok)
|
if (!ok)
|
||||||
{
|
{
|
||||||
delete ini;
|
delete remote_ini;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ==============
|
|
||||||
// decompressione
|
// DECOMPRESSIONE
|
||||||
|
// ----------------
|
||||||
|
// viene decompresso il file .zip collegato al file remote_ini (es. ba0883a1.zip, bainst.zip)
|
||||||
msg = TR("Decompressione");
|
msg = TR("Decompressione");
|
||||||
if (is_a_patch)
|
if (is_a_patch)
|
||||||
msg << TR(" della patch ") << patchlevel ;
|
msg << TR(" della patch ") << patchlevel ;
|
||||||
msg << TR(" del modulo '") << module << TR("' in corso...");
|
msg << TR(" del modulo '") << module << TR("' in corso...");
|
||||||
|
|
||||||
TProgind pi(dischi, msg, false, true);
|
TProgind pi(dischi, msg, false, true);
|
||||||
TFilename tempdir; tempdir.tempdir();
|
|
||||||
|
TFilename tempdir;
|
||||||
|
tempdir.tempdir();
|
||||||
|
|
||||||
// File tottale dei vari sotto-zip
|
// File tottale dei vari sotto-zip
|
||||||
TFilename totti = tempdir; totti.add(module); totti.ext("zip");
|
TFilename totti = tempdir;
|
||||||
|
totti.add(module);
|
||||||
|
totti.ext("zip");
|
||||||
|
|
||||||
|
//si costruisce il nome dello zip
|
||||||
for (int d = 1; d <= dischi && ok; d++)
|
for (int d = 1; d <= dischi && ok; d++)
|
||||||
{
|
{
|
||||||
TFilename chunk = path;
|
TFilename chunk = path;
|
||||||
@ -966,22 +1052,23 @@ bool TInstaller_mask::install(const TString& module, int patchlevel)
|
|||||||
error_box(FR("Errore di trasferimento del file '%s'"), (const char*)remote);
|
error_box(FR("Errore di trasferimento del file '%s'"), (const char*)remote);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//antichi controlli in caso di multidischetto
|
||||||
ok = chunk.exist();
|
ok = chunk.exist();
|
||||||
if (!ok && !internet) // Chiedi cambio disco (solo se non sta scaricando da internet)
|
if (!ok && !internet) // Chiedi cambio disco (solo se non sta scaricando da internet)
|
||||||
{
|
{
|
||||||
while (!ok)
|
while (!ok)
|
||||||
{
|
{
|
||||||
if (askdisk(path,chunk,d,dischi,(const char*)ini->get("Descrizione"))==K_QUIT)
|
if (askdisk(path, chunk, d, dischi, (const char*)remote_ini->get("Descrizione")) == K_QUIT)
|
||||||
break;
|
break;
|
||||||
ok = chunk.exist();
|
ok = chunk.exist();
|
||||||
if (!ok)
|
if (!ok)
|
||||||
message_box(FR("Impossibile trovare il file '%s'"),(const char*)chunk);
|
message_box(FR("Impossibile trovare il file '%s'"), (const char*)chunk);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
const long required = fsize(chunk) * (dischi-d+1) * 4;
|
const long required = fsize(chunk) * (dischi - d + 1) * 4;
|
||||||
if (!xvt_fsys_test_disk_free_space(tempdir, required))
|
if (!xvt_fsys_test_disk_free_space(tempdir, required))
|
||||||
{
|
{
|
||||||
ok = yesno_box(TR("Lo spazio su disco potrebbe essere insufficiente:\nSi desidera continuare ugualmente?"));
|
ok = yesno_box(TR("Lo spazio su disco potrebbe essere insufficiente:\nSi desidera continuare ugualmente?"));
|
||||||
@ -991,43 +1078,47 @@ bool TInstaller_mask::install(const TString& module, int patchlevel)
|
|||||||
if (ok)
|
if (ok)
|
||||||
::fcopy(chunk, totti, d > 1); // Somma il chunk al totale
|
::fcopy(chunk, totti, d > 1); // Somma il chunk al totale
|
||||||
}
|
}
|
||||||
aga_unzip(totti, tempdir); // Scompatta il file totale
|
|
||||||
::remove(totti);
|
|
||||||
|
|
||||||
// =============
|
//scompattamento vero e proprio dello zip
|
||||||
// trasferimento
|
aga_unzip(totti, tempdir); // Scompatta il file totale zip
|
||||||
|
::remove(totti); // Elimina il file totale zip
|
||||||
|
|
||||||
|
|
||||||
|
// TRASFERIMENTO
|
||||||
|
// -----------------
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
// si assicura che sia leggibile il .ini del primo disco
|
// si assicura che sia leggibile il .ini del primo disco
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
TFilename cmdline = path;
|
TFilename cmdline = path;
|
||||||
cmdline.add(ininame.name());
|
cmdline.add(remote_ininame.name());
|
||||||
ok = cmdline.exist();
|
ok = cmdline.exist();
|
||||||
if (!ok)
|
if (!ok)
|
||||||
{
|
{
|
||||||
if (askdisk(path,cmdline,1,dischi,(const char*)ini->get("Descrizione"))==K_QUIT)
|
if (askdisk(path, cmdline, 1, dischi, (const char*)remote_ini->get("Descrizione")) == K_QUIT)
|
||||||
break;
|
break;
|
||||||
ok = fexist(cmdline);
|
ok = fexist(cmdline);
|
||||||
if (!ok)
|
if (!ok)
|
||||||
message_box(FR("Impossibile trovare %s\n"),(const char*)cmdline);
|
message_box(FR("Impossibile trovare %s\n"), (const char*)cmdline);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
delete ini;
|
delete remote_ini;
|
||||||
ini = new TInstall_ini (cmdline);
|
remote_ini = new TInstall_ini (cmdline);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while (!ok);
|
} while (!ok);
|
||||||
|
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
msg.cut(0);
|
msg.cut(0);
|
||||||
msg << TR("Aggiornamento del modulo '") << module << TR("' in corso...");
|
msg << TR("Aggiornamento del modulo '") << module << TR("' in corso...");
|
||||||
pi.set_text(msg);
|
pi.set_text(msg);
|
||||||
ok = move_module(module, *ini, true);
|
ok = move_module(module, *remote_ini, true);
|
||||||
|
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
TAuto_token_string altri(ini->get("Moduli", module));
|
TAuto_token_string altri(remote_ini->get("Moduli", module));
|
||||||
FOR_EACH_TOKEN(altri, mod)
|
FOR_EACH_TOKEN(altri, mod)
|
||||||
{
|
{
|
||||||
const TString16 submod = mod;
|
const TString16 submod = mod;
|
||||||
@ -1036,70 +1127,42 @@ bool TInstaller_mask::install(const TString& module, int patchlevel)
|
|||||||
bool upd = ok;
|
bool upd = ok;
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
TInstall_ini curini;
|
TInstall_ini local_cur_ini;
|
||||||
const TString16 curver = curini.version(submod);
|
const TString16 curver = local_cur_ini.version(submod);
|
||||||
const int curpatch = curini.patch(submod);
|
const int curpatch = local_cur_ini.patch(submod);
|
||||||
const TString16 reqver = ini->version(submod);
|
const TString16 reqver = remote_ini->version(submod);
|
||||||
const int reqpatch = ini->patch(submod);
|
const int reqpatch = remote_ini->patch(submod);
|
||||||
|
|
||||||
int distance = compare_version(reqver, reqpatch, curver, curpatch);
|
int distance = compare_version(reqver, reqpatch, curver, curpatch);
|
||||||
upd = distance > 0;
|
upd = distance > 0;
|
||||||
}
|
}
|
||||||
ok &= move_module(submod, *ini, upd);
|
ok &= move_module(submod, *remote_ini, upd);
|
||||||
if (upd && ok) // marca sull'install.ini di destinazione l'avvenuta installazione del sottomodulo "esterno"
|
if (upd && ok) // marca sull'install.ini di destinazione l'avvenuta installazione del sottomodulo "esterno"
|
||||||
ini->export_paragraph(submod, ini->default_name(), !is_a_patch);
|
remote_ini->export_paragraph(submod, TInstall_ini::default_name(), !is_a_patch);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ok) //rimozione files da eliminare indicati nel .ini
|
} //if(ok)..
|
||||||
{
|
} //if(ok)..
|
||||||
TString killmod;
|
|
||||||
killmod << module << 99;
|
|
||||||
if (ini->set_paragraph(killmod))
|
|
||||||
{
|
|
||||||
TToken_string rigaini;
|
|
||||||
TFilename filetokill;
|
|
||||||
for (int k=0; ;k++)
|
|
||||||
{
|
|
||||||
rigaini = ini->get("Kill", NULL, k, "");
|
|
||||||
if (rigaini.empty())
|
|
||||||
break;
|
|
||||||
filetokill = rigaini.get(0);
|
|
||||||
if (filetokill.find('*') >= 0 || filetokill.find('?') >=0)
|
|
||||||
{
|
|
||||||
TString_array filelist;
|
|
||||||
list_files (filetokill, filelist);
|
|
||||||
FOR_EACH_ARRAY_ROW(filelist, r, file)
|
|
||||||
{
|
|
||||||
::remove_file((const char *)file);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
::remove_file(filetokill);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (ok) // marca sull'install.ini di destinazione l'avvenuta installazione del modulo
|
if (ok) // marca sull'install.ini di destinazione l'avvenuta installazione del modulo
|
||||||
ini->export_module_paragraphs(module, ini->default_name(),!is_a_patch);
|
remote_ini->export_module_paragraphs(module, TInstall_ini::default_name(), !is_a_patch);
|
||||||
} // installazione da directory con zip
|
} // installazione da directory con zip
|
||||||
else
|
else
|
||||||
if (!is_a_patch)
|
if (!is_a_patch)
|
||||||
{
|
{
|
||||||
//
|
// non c'e' il .ini del modulo ma un unico "install.ini" (es. aggiornamento client)
|
||||||
// non c'e' il .ini del modulo ma un unico "install.ini"
|
//------------------------------------------------
|
||||||
// (installazione da directory con eseguibili)
|
// (INSTALLAZIONE DA DIRECTORY CON ESEGUIBILI)
|
||||||
ininame = path;
|
//------------------------------------------------
|
||||||
ininame.add(TInstall_ini::default_name());
|
remote_ininame = path;
|
||||||
ok = fexist(ininame);
|
remote_ininame.add(TInstall_ini::default_name());
|
||||||
|
ok = fexist(remote_ininame);
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
TInstall_ini ini(ininame);
|
TInstall_ini ini(remote_ininame);
|
||||||
ini.write_protect();
|
ini.write_protect();
|
||||||
lastpatch=ini.get_int("Patch",module);
|
lastpatch = ini.get_int("Patch", module);
|
||||||
lastrelease=ini.get("Versione",module);
|
lastrelease = ini.get("Versione", module);
|
||||||
if (!can_install(module, ini))
|
if (!can_install(module, ini))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -1107,7 +1170,7 @@ bool TInstaller_mask::install(const TString& module, int patchlevel)
|
|||||||
const int files = ini.build_complete_list(module, list);
|
const int files = ini.build_complete_list(module, list);
|
||||||
if (files > 0)
|
if (files > 0)
|
||||||
{
|
{
|
||||||
if (patchlevel==0)
|
if (patchlevel == 0)
|
||||||
ok = pre_process(ini, module);
|
ok = pre_process(ini, module);
|
||||||
|
|
||||||
if (ok)
|
if (ok)
|
||||||
@ -1123,7 +1186,7 @@ bool TInstaller_mask::install(const TString& module, int patchlevel)
|
|||||||
src = path;
|
src = path;
|
||||||
src.add(dst);
|
src.add(dst);
|
||||||
const int reboot = needs_reboot(dst);
|
const int reboot = needs_reboot(dst);
|
||||||
if ((reboot & NEW_SYS)!=0 && dst.exist())
|
if ((reboot & NEW_SYS) !=0 && dst.exist())
|
||||||
{
|
{
|
||||||
dst.rtrim(1);
|
dst.rtrim(1);
|
||||||
dst << '_';
|
dst << '_';
|
||||||
@ -1132,6 +1195,7 @@ bool TInstaller_mask::install(const TString& module, int patchlevel)
|
|||||||
create_dirs(dst.path());
|
create_dirs(dst.path());
|
||||||
|
|
||||||
ok = ::fcopy(src, dst);
|
ok = ::fcopy(src, dst);
|
||||||
|
|
||||||
if (ok && is_zip_file(src))
|
if (ok && is_zip_file(src))
|
||||||
aga_unzip(src, dst.path());
|
aga_unzip(src, dst.path());
|
||||||
|
|
||||||
@ -1144,7 +1208,7 @@ bool TInstaller_mask::install(const TString& module, int patchlevel)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ok) // marca sull'install.ini di destinazione l'avvenuta installazione del modulo
|
if (ok) // marca sull'install.ini di destinazione l'avvenuta installazione del modulo
|
||||||
ini.export_module_paragraphs(module, ini.default_name(),true);
|
ini.export_module_paragraphs(module, ini.default_name(), true);
|
||||||
} // controllo esistenza lista di file non vuota per questo modulo
|
} // controllo esistenza lista di file non vuota per questo modulo
|
||||||
} // controllo esistenza install.ini
|
} // controllo esistenza install.ini
|
||||||
} // fine installazione da directory con eseguibili
|
} // fine installazione da directory con eseguibili
|
||||||
@ -1152,10 +1216,9 @@ bool TInstaller_mask::install(const TString& module, int patchlevel)
|
|||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
update_install_ini(); //aggiorna diskpath e webpath
|
|
||||||
TInstall_ini ini;
|
TInstall_ini ini;
|
||||||
ini.set("Data", TDate(TODAY), module);
|
ini.set("Data", TDate(TODAY), module);
|
||||||
ini.update_prices(ininame);
|
ini.update_prices(remote_ininame);
|
||||||
}
|
}
|
||||||
// Non togliere le parentesi graffe soprastanti per permettere l'aggiornamento fisico del .ini (CON LA CHIAMATA DEL DISTRUTTORE)
|
// Non togliere le parentesi graffe soprastanti per permettere l'aggiornamento fisico del .ini (CON LA CHIAMATA DEL DISTRUTTORE)
|
||||||
update_version();
|
update_version();
|
||||||
@ -1298,10 +1361,11 @@ bool TInstaller_mask::web_handler(TMask_field& fld, KEY key)
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Aggiorna l'install.ini con eventuali modifiche dell'utente.
|
|
||||||
|
// Aggiorna l'install.ini con eventuali modifiche dell'utente su dispath e/o webpath
|
||||||
// Decisivo in caso di cambio path d'installazione
|
// Decisivo in caso di cambio path d'installazione
|
||||||
// Serve a setup
|
// Serve a setup (deve essere chiamata in caso di esecuzioni passive di setup, tipo -uw, -uw)
|
||||||
void TInstaller_mask::update_install_ini() const
|
void TInstaller_mask::update_disk_and_web_path()
|
||||||
{
|
{
|
||||||
TInstall_ini ini;
|
TInstall_ini ini;
|
||||||
ini.set("DiskPath", get(F_PATH));
|
ini.set("DiskPath", get(F_PATH));
|
||||||
@ -1424,7 +1488,7 @@ void TInstaller_mask::install_selection()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
update_install_ini(); //aggiorna l'install.ini
|
update_disk_and_web_path(); //aggiorna l'install.ini
|
||||||
//lancia setup in modalita' aggiornamento da disco
|
//lancia setup in modalita' aggiornamento da disco
|
||||||
_setup_run = xvt_sys_execute("setup\\setup.exe -ud", false, false) !=0;
|
_setup_run = xvt_sys_execute("setup\\setup.exe -ud", false, false) !=0;
|
||||||
}
|
}
|
||||||
@ -1468,7 +1532,7 @@ void TInstaller_mask::install_selection()
|
|||||||
file_copied = http_get(http_server, remote_file, local_file); //occhio alle maiuscole!!!!
|
file_copied = http_get(http_server, remote_file, local_file); //occhio alle maiuscole!!!!
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
update_install_ini(); //aggiorna l'install.ini
|
update_disk_and_web_path(); //aggiorna l'install.ini
|
||||||
//lancia setup in modalita' aggiornamento web
|
//lancia setup in modalita' aggiornamento web
|
||||||
_setup_run = xvt_sys_execute("setup\\setup.exe -uw", false, false) != 0;
|
_setup_run = xvt_sys_execute("setup\\setup.exe -uw", false, false) != 0;
|
||||||
}
|
}
|
||||||
@ -1502,7 +1566,12 @@ void TInstaller_mask::install_selection()
|
|||||||
uncheck(r); // se non ci sono patch o moduli -> uncheck
|
uncheck(r); // se non ci sono patch o moduli -> uncheck
|
||||||
} //FOR_EACH_ARRAY_ROW(arr...
|
} //FOR_EACH_ARRAY_ROW(arr...
|
||||||
|
|
||||||
force_update(); //serve per togliere il check al modulo 'sy' quando viene installato
|
//aggiorna definitivamente i path su install.ini
|
||||||
|
update_disk_and_web_path();
|
||||||
|
//accoppa i files nelle kill lists e aggiorna install.ini
|
||||||
|
kill_files();
|
||||||
|
//serve per togliere il check al modulo 'sy' quando viene installato
|
||||||
|
force_update();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TInstaller_mask::install_handler(TMask_field& fld, KEY key)
|
bool TInstaller_mask::install_handler(TMask_field& fld, KEY key)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user