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();
|
void update_version();
|
||||||
|
|
||||||
int needs_reboot(const TFilename& file) const;
|
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 move_module(const TString& module, TInstall_ini& ini, bool update) const;
|
||||||
|
|
||||||
bool can_install(const char* module, TInstall_ini& ini);
|
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
|
// from: direttorio di partenza
|
||||||
// file: nome del file con path completo da spostare (può includere sottodirettori)
|
// file: nome del file con path completo da spostare (può includere sottodirettori)
|
||||||
// todir: direttorio destinazione (si assume che esista già)
|
// 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];
|
TFilename dest = dst;
|
||||||
xvt_fsys_parse_pathname(file, NULL, NULL, fname, ext, NULL);
|
const int reboot = needs_reboot(dest);
|
||||||
|
|
||||||
const int reboot = needs_reboot(file);
|
|
||||||
if (reboot > NEW_MENU)
|
if (reboot > NEW_MENU)
|
||||||
ext[2] = '_';
|
{
|
||||||
|
dest.rtrim(1);
|
||||||
TFilename dest(todir);
|
dest << '_';
|
||||||
dest.add(fname);
|
}
|
||||||
dest.ext(ext);
|
|
||||||
if (!dest.exist())
|
if (!dest.exist())
|
||||||
{
|
{
|
||||||
TToken_string dirs(dest.path(), SLASH);
|
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);
|
make_dir(subdir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const long filesize = fsize(file);
|
const long filesize = fsize(src);
|
||||||
|
|
||||||
bool space_ok = FALSE;
|
bool space_ok = FALSE;
|
||||||
while (!space_ok)
|
while (!space_ok)
|
||||||
@ -622,12 +620,12 @@ bool TInstaller_mask::move_file(const TFilename& file, const char* todir) const
|
|||||||
bool user_retry = FALSE;
|
bool user_retry = FALSE;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
write_ok = ::fcopy(file, dest);
|
write_ok = ::fcopy(src, dest);
|
||||||
if (write_ok)
|
if (write_ok)
|
||||||
::remove(file);
|
::remove(src);
|
||||||
else
|
else
|
||||||
user_retry = yesno_box(FR("Errore di copia del file %s.\nSi desidera ritentare?"),
|
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);
|
} while (!write_ok && user_retry);
|
||||||
|
|
||||||
if (write_ok)
|
if (write_ok)
|
||||||
@ -641,9 +639,9 @@ bool TInstaller_mask::move_module(const TString& module, TInstall_ini& ini, bool
|
|||||||
{
|
{
|
||||||
bool ok = TRUE;
|
bool ok = TRUE;
|
||||||
|
|
||||||
TFilename src; src.tempdir();
|
TFilename src, dst; src.tempdir();
|
||||||
const TString& dst = get(F_CURPATH);
|
|
||||||
const TFilename tempdir(src);
|
const TFilename tempdir(src);
|
||||||
|
const TString& destdir = get(F_CURPATH);
|
||||||
|
|
||||||
TString_array list;
|
TString_array list;
|
||||||
ini.build_list(module, 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));
|
src.add(file->get(0));
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
|
dst = destdir;
|
||||||
|
dst.add(file->get(0));
|
||||||
const bool move_ok = move_file(src, dst);
|
const bool move_ok = move_file(src, dst);
|
||||||
if (!move_ok)
|
if (!move_ok)
|
||||||
ok = update = FALSE;
|
ok = update = FALSE;
|
||||||
@ -818,7 +818,7 @@ 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
|
||||||
pi.addstatus(1);
|
pi.addstatus(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -948,7 +948,7 @@ bool TInstaller_mask::install(const TString& module, int patchlevel)
|
|||||||
dst.rtrim(1);
|
dst.rtrim(1);
|
||||||
dst << '_';
|
dst << '_';
|
||||||
}
|
}
|
||||||
ok = fcopy(src, dst);
|
ok = ::fcopy(src, dst);
|
||||||
|
|
||||||
if (ok && reboot != NONE)
|
if (ok && reboot != NONE)
|
||||||
_reboot_program |= reboot;
|
_reboot_program |= reboot;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user