Patch level : 10.0 330
Files correlati : ba1.exe Ricompilazione Demo : [ ] Commento : 0001364: copia dati pre allineamento archivi Descrizione Con il caricamento delle patch fino alla 326, se si conferma la copia della società prima della conversione viene dato errore 13 su tutti i files. git-svn-id: svn://10.65.10.50/trunk@18998 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
37652c98d8
commit
74c15a9ec6
@ -122,10 +122,10 @@ protected: // TSheet
|
|||||||
virtual bool on_key(KEY key);
|
virtual bool on_key(KEY key);
|
||||||
static bool tutti_handler(TMask_field& f, KEY k);
|
static bool tutti_handler(TMask_field& f, KEY k);
|
||||||
int get_module_number(const TString& module) const;
|
int get_module_number(const TString& module) const;
|
||||||
bool has_module(int modnumber) const;
|
bool should_precheck_module(int modnumber) const;
|
||||||
bool is_zip_file(const TFilename& n) const;
|
bool is_zip_file(const TFilename& n) const;
|
||||||
|
|
||||||
void create_dirs(const char* path) const;
|
bool copy_file(const TFilename& src, const TFilename& dst) const;
|
||||||
bool copy_tree(const char* src_study, const char* dst_study) const;
|
bool copy_tree(const char* src_study, const char* dst_study) const;
|
||||||
int test_station_type() const;
|
int test_station_type() const;
|
||||||
|
|
||||||
@ -262,14 +262,35 @@ bool TInstaller_mask::add_header(TConfig& ini, const TString& module)
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TInstaller_mask::has_module(int modnumber) const
|
bool TInstaller_mask::should_precheck_module(int modnumber) const
|
||||||
{
|
{
|
||||||
//se sei un server hai tutti i moduli da installare
|
bool ok = modnumber == 0;
|
||||||
if (station_type() == 2)
|
|
||||||
return dongle().shown(modnumber);
|
if (!ok)
|
||||||
|
{
|
||||||
|
const TDongle& d = dongle();
|
||||||
|
if (station_type() == 2)
|
||||||
|
{
|
||||||
|
//se sei un server hai tutti i moduli da installare
|
||||||
|
ok = d.shown(modnumber);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//senno' sei sfigato e ti installa solo i moduli sulla chiave
|
||||||
|
ok = d.active(modnumber);
|
||||||
|
if (!ok) // Se non hai un modulo ... potresti avere un suo modulo sottinteso
|
||||||
|
{
|
||||||
|
switch (modnumber)
|
||||||
|
{
|
||||||
|
case CAAUT: ok = d.active(CMAUT); break; // Se non hai l'analitica ritenta con le commesse
|
||||||
|
case TPAUT: ok = d.active(DCAUT); break; // Se non hai Pack ritenta con il CONAI
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//senno' sei sfigato e ti installa solo i moduli sulla chiave
|
return ok;
|
||||||
return main_app().has_module(modnumber, CHK_DONGLE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//che tipo di installazione e'?
|
//che tipo di installazione e'?
|
||||||
@ -316,7 +337,7 @@ int TInstaller_mask::precheck_modules(bool only_newer)
|
|||||||
currrelease = rigar.get(C_CURRRELEASE);
|
currrelease = rigar.get(C_CURRRELEASE);
|
||||||
currpatch = rigar.get_int(C_CURRPATCH);
|
currpatch = rigar.get_int(C_CURRPATCH);
|
||||||
modnumber = get_module_number(cod_module);
|
modnumber = get_module_number(cod_module);
|
||||||
if (modnumber >= 0 && has_module(modnumber) &&
|
if (modnumber >= 0 && should_precheck_module(modnumber) &&
|
||||||
release.full() &&
|
release.full() &&
|
||||||
((release > currrelease) ||
|
((release > currrelease) ||
|
||||||
(release == currrelease && (only_newer ? patchlevel > currpatch : patchlevel >= currpatch) ))
|
(release == currrelease && (only_newer ? patchlevel > currpatch : patchlevel >= currpatch) ))
|
||||||
@ -721,31 +742,17 @@ bool TInstaller_mask::is_zip_file(const TFilename& n) const
|
|||||||
{
|
{
|
||||||
bool yes = xvt_str_compare_ignoring_case(n.ext(), "zip") == 0 &&
|
bool yes = xvt_str_compare_ignoring_case(n.ext(), "zip") == 0 &&
|
||||||
xvt_str_compare_ignoring_case(n.name_only(), "dninst") != 0;
|
xvt_str_compare_ignoring_case(n.name_only(), "dninst") != 0;
|
||||||
return yes;
|
return yes;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TInstaller_mask::create_dirs(const char* path) const
|
bool TInstaller_mask::copy_file(const TFilename& src, const TFilename& dst) const
|
||||||
{
|
{
|
||||||
/*
|
bool ok = xvt_fsys_mkdir(dst.path()) != FALSE;
|
||||||
TToken_string dirs(path, SLASH);
|
if (ok)
|
||||||
if (SLASH == '\\')
|
ok = ::fcopy(src, dst);
|
||||||
dirs.replace('/', SLASH);
|
|
||||||
else
|
else
|
||||||
dirs.replace('\\', SLASH);
|
error_box(FR("Impossibile creare la cartella %s"), dst.path());
|
||||||
|
return ok;
|
||||||
// file contains non existent subdir specification ?
|
|
||||||
TFilename subdir;
|
|
||||||
for (int c=0; c < dirs.items()-1; c++)
|
|
||||||
{
|
|
||||||
subdir.add(dirs.get(c));
|
|
||||||
if (subdir.right(1) == ":" )
|
|
||||||
subdir << SLASH;
|
|
||||||
if (!subdir.exist() )
|
|
||||||
// build destination directory
|
|
||||||
make_dir(subdir);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
xvt_fsys_mkdir(path); // La nuova versione crea l'albero autonomamente
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// sposta il file dal direttorio temporaneo a quello passato come destinazione
|
// sposta il file dal direttorio temporaneo a quello passato come destinazione
|
||||||
@ -759,16 +766,13 @@ bool TInstaller_mask::move_file(const TFilename& src, const TFilename& dst) cons
|
|||||||
dest << '_';
|
dest << '_';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!dest.exist())
|
|
||||||
create_dirs(dest.path());
|
|
||||||
|
|
||||||
const bool is_zip = is_zip_file(src);
|
const bool is_zip = is_zip_file(src);
|
||||||
const long filesize = fsize(src) * (is_zip ? 4 : 1);
|
const long filesize = fsize(src) * (is_zip ? 4 : 1);
|
||||||
|
|
||||||
if (xvt_fsys_test_disk_free_space(dest.path(), filesize) == 0)
|
if (xvt_fsys_test_disk_free_space(dest.path(), filesize) == 0)
|
||||||
return error_box(TR("Lo spazio disponibile e' insufficiente!"));
|
return error_box(TR("Lo spazio disponibile e' insufficiente!"));
|
||||||
|
|
||||||
const bool write_ok = ::fcopy(src, dest);
|
const bool write_ok = copy_file(src, dest);
|
||||||
if (write_ok && is_zip)
|
if (write_ok && is_zip)
|
||||||
aga_unzip(src, dest.path());
|
aga_unzip(src, dest.path());
|
||||||
|
|
||||||
@ -861,8 +865,7 @@ bool TInstaller_mask::copy_tree(const char* src_study, const char* dst_study) co
|
|||||||
dst = dst_study;
|
dst = dst_study;
|
||||||
dst.add(name);
|
dst.add(name);
|
||||||
dst.add(src.name());
|
dst.add(src.name());
|
||||||
create_dirs(dst);
|
copy_file(src, dst);
|
||||||
fcopy(src, dst);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1251,15 +1254,12 @@ 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 << '_';
|
||||||
}
|
}
|
||||||
if (!dst.exist())
|
ok = copy_file(src, dst);
|
||||||
create_dirs(dst.path());
|
|
||||||
|
|
||||||
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());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user