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

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

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