Patch level :2.0 492
Files correlati :ba1.exe Ricompilazione Demo : [ ] Commento :aggiunta parte per copiare i files dalla directory temporanea alle subdirectory corrette in installazione (servers,recdesc) git-svn-id: svn://10.65.10.50/trunk@11230 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
925608327f
commit
d2ad12c931
@ -108,7 +108,7 @@ protected:
|
||||
void update_version();
|
||||
|
||||
int needs_reboot(const TFilename& file) const;
|
||||
bool move_file(const TFilename& file, const char* dir) const;
|
||||
bool move_file(const TFilename& src, const TFilename& dst) const;
|
||||
bool move_module(const TString& module, TInstall_ini& ini, bool update) const;
|
||||
|
||||
bool can_install(const char* module, TInstall_ini& ini);
|
||||
@ -569,18 +569,16 @@ int TInstaller_mask::needs_reboot(const TFilename& file) const
|
||||
// from: direttorio di partenza
|
||||
// file: nome del file con path completo da spostare (può includere sottodirettori)
|
||||
// todir: direttorio destinazione (si assume che esista già)
|
||||
bool TInstaller_mask::move_file(const TFilename& file, const char* todir) const
|
||||
bool TInstaller_mask::move_file(const TFilename& src, const TFilename& dst) const
|
||||
{
|
||||
char fname[_MAX_FNAME], ext[_MAX_EXT];
|
||||
xvt_fsys_parse_pathname(file, NULL, NULL, fname, ext, NULL);
|
||||
|
||||
const int reboot = needs_reboot(file);
|
||||
TFilename dest = dst;
|
||||
const int reboot = needs_reboot(dest);
|
||||
if (reboot > NEW_MENU)
|
||||
ext[2] = '_';
|
||||
|
||||
TFilename dest(todir);
|
||||
dest.add(fname);
|
||||
dest.ext(ext);
|
||||
{
|
||||
dest.rtrim(1);
|
||||
dest << '_';
|
||||
}
|
||||
|
||||
if (!dest.exist())
|
||||
{
|
||||
TToken_string dirs(dest.path(), SLASH);
|
||||
@ -596,7 +594,7 @@ bool TInstaller_mask::move_file(const TFilename& file, const char* todir) const
|
||||
make_dir(subdir);
|
||||
}
|
||||
}
|
||||
const long filesize = fsize(file);
|
||||
const long filesize = fsize(src);
|
||||
|
||||
bool space_ok = FALSE;
|
||||
while (!space_ok)
|
||||
@ -622,12 +620,12 @@ bool TInstaller_mask::move_file(const TFilename& file, const char* todir) const
|
||||
bool user_retry = FALSE;
|
||||
do
|
||||
{
|
||||
write_ok = ::fcopy(file, dest);
|
||||
write_ok = ::fcopy(src, dest);
|
||||
if (write_ok)
|
||||
::remove(file);
|
||||
::remove(src);
|
||||
else
|
||||
user_retry = yesno_box(FR("Errore di copia del file %s.\nSi desidera ritentare?"),
|
||||
(const char*)file);
|
||||
(const char*)src);
|
||||
} while (!write_ok && user_retry);
|
||||
|
||||
if (write_ok)
|
||||
@ -641,9 +639,9 @@ bool TInstaller_mask::move_module(const TString& module, TInstall_ini& ini, bool
|
||||
{
|
||||
bool ok = TRUE;
|
||||
|
||||
TFilename src; src.tempdir();
|
||||
const TString& dst = get(F_CURPATH);
|
||||
TFilename src, dst; src.tempdir();
|
||||
const TFilename tempdir(src);
|
||||
const TString& destdir = get(F_CURPATH);
|
||||
|
||||
TString_array list;
|
||||
ini.build_list(module, list);
|
||||
@ -653,6 +651,8 @@ bool TInstaller_mask::move_module(const TString& module, TInstall_ini& ini, bool
|
||||
src.add(file->get(0));
|
||||
if (update)
|
||||
{
|
||||
dst = destdir;
|
||||
dst.add(file->get(0));
|
||||
const bool move_ok = move_file(src, dst);
|
||||
if (!move_ok)
|
||||
ok = update = FALSE;
|
||||
@ -818,7 +818,7 @@ bool TInstaller_mask::install(const TString& module, int patchlevel)
|
||||
|
||||
if (ok)
|
||||
{
|
||||
fcopy(chunk, totti, d > 1); // Somma il chunk al totale
|
||||
::fcopy(chunk, totti, d > 1); // Somma il chunk al totale
|
||||
pi.addstatus(1);
|
||||
}
|
||||
}
|
||||
@ -948,7 +948,7 @@ bool TInstaller_mask::install(const TString& module, int patchlevel)
|
||||
dst.rtrim(1);
|
||||
dst << '_';
|
||||
}
|
||||
ok = fcopy(src, dst);
|
||||
ok = ::fcopy(src, dst);
|
||||
|
||||
if (ok && reboot != NONE)
|
||||
_reboot_program |= reboot;
|
||||
|
Loading…
x
Reference in New Issue
Block a user