Patch level :4.0 e 10.0

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :nuovo setup features


git-svn-id: svn://10.65.10.50/trunk@15721 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca 2007-10-17 09:35:51 +00:00
parent bde6a33ca3
commit fc4bab6d1a
2 changed files with 38 additions and 27 deletions

View File

@ -85,7 +85,7 @@ protected:
void manage_preferred(); void manage_preferred();
bool test_programs(); bool test_programs();
void copy_setup(const TString& remote_path); bool copy_setup(const TString& remote_path);
public: public:
void select_tree_current(); void select_tree_current();
@ -1171,10 +1171,10 @@ static int get_module_version(TConfig& cfg, void* jolly)
return false; return false;
} }
void TMenu_application::copy_setup(const TString& remote_path) bool TMenu_application::copy_setup(const TString& remote_path)
{ {
bool ok = false;
const TFilename local_setupdir = "setup"; const TFilename local_setupdir = "setup";
make_dir(local_setupdir);
TFilename remote_setupdir = remote_path; TFilename remote_setupdir = remote_path;
remote_setupdir.add(local_setupdir.name()); remote_setupdir.add(local_setupdir.name());
@ -1182,15 +1182,26 @@ void TMenu_application::copy_setup(const TString& remote_path)
TString_array ar; TString_array ar;
list_files(remote_setupdir, ar); list_files(remote_setupdir, ar);
if (!ar.empty())
{
make_dir(local_setupdir);
ok = true;
TFilename strsrc, strdst; TFilename strsrc, strdst;
FOR_EACH_ARRAY_ROW (ar, i, row) FOR_EACH_ARRAY_ROW (ar, i, row)
{ {
strsrc = *row; strsrc = *row;
strdst = local_setupdir; strdst = local_setupdir;
strdst.add(strsrc.name()); strdst.add(strsrc.name());
fcopy(strsrc, strdst); if (!fcopy(strsrc, strdst))
{
ok = false;
break;
} }
} }
}
return ok;
}
bool TMenu_application::test_programs() bool TMenu_application::test_programs()
{ {
@ -1273,29 +1284,31 @@ bool TMenu_application::test_programs()
msg << ",etc."; msg << ",etc.";
} }
update_needed++; update_needed++;
} } //if (!v1.blank()...
} } //if (chiavetta.active(module...
} } //FOR_EACH_ASSOC_STR
if (update_needed > 0) if (update_needed > 0)
warning_box(msg); warning_box(msg);
} } //if(remote_name.exist()...
if (update_needed > 0 && yesno_box(TR("Si desidera aggiornare i moduli adesso?"))) if (update_needed > 0 && yesno_box(TR("Si desidera aggiornare i moduli adesso?")))
{ {
//copia il contenuto della setup del server nella setup del client //copia il contenuto della setup del server nella setup del client
copy_setup(remote_name.path()); if (copy_setup(remote_name.path()))
{
//mette il flag di installing //mette il flag di installing
set_installing_flag(); set_installing_flag();
//lancia setup in modalita' aggiornamento client e si suicida! (banzai!!) //lancia setup in modalita' aggiornamento client e si suicida! (banzai!!)
TExternal_app app("setup\\setup.exe -uc"); TExternal_app app("setup\\setup.exe -uc");
app.run(true); app.run(true);
//se lancia un'installazione->esce!!! //se lancia un'installazione->esce!!!
return false; return false;
} }
} } //(if(update_needed>0...
} //if(is_client..
_menu.set_dangerous_modules(dangerous); _menu.set_dangerous_modules(dangerous);
return true; return true;
} }

View File

@ -1306,8 +1306,6 @@ void TManutenzione_app::load_des(const int maxfdir)
for (int n = 0; n < totfiles; n++) for (int n = 0; n < totfiles; n++)
{ {
fn = list.row(n); fn = list.row(n);
if (fn == "recdesc/f159.dir")
int cazzo = n;
if (fn.exist()) if (fn.exist())
{ {
ifstream infile(fn); ifstream infile(fn);