diff --git a/ba/ba1700.cpp b/ba/ba1700.cpp index f9d20e62f..7a8d3a03d 100755 --- a/ba/ba1700.cpp +++ b/ba/ba1700.cpp @@ -103,7 +103,7 @@ protected: int precheck_modules(bool only_newer=TRUE); void update_version(); - int needs_underscore(const TFilename& file) const; + int needs_reboot(const TFilename& file) const; bool move_file(const TFilename& file, const char* dir) const; bool move_module(const TString& module, TInstall_ini& ini, bool update) const; @@ -532,7 +532,7 @@ bool TInstaller_mask::can_install(const char* module, TInstall_ini& ini) return ok; } -int TInstaller_mask::needs_underscore(const TFilename& file) const +int TInstaller_mask::needs_reboot(const TFilename& file) const { char fname[_MAX_FNAME], ext[_MAX_EXT]; xvt_fsys_parse_pathname(file, NULL, NULL, fname, ext, NULL); @@ -544,12 +544,11 @@ int TInstaller_mask::needs_underscore(const TFilename& file) const underscore = NEW_MENUPRG; else if (xvt_str_compare_ignoring_case(fname, "ba1") == 0) underscore = NEW_INSTALLER; - } - else - { - if (xvt_str_compare_ignoring_case(ext, ".dll") == 0) - underscore = NEW_DLL; - } + } else + if (xvt_str_compare_ignoring_case(ext, ".dll") == 0) + underscore = NEW_DLL; else + if (xvt_str_compare_ignoring_case(ext, ".men") == 0) + underscore = NEW_MENU; return underscore; } @@ -563,8 +562,8 @@ bool TInstaller_mask::move_file(const TFilename& file, const char* todir) const char fname[_MAX_FNAME], ext[_MAX_EXT]; xvt_fsys_parse_pathname(file, NULL, NULL, fname, ext, NULL); - const int underscore = needs_underscore(file); - if (underscore) + const int reboot = needs_reboot(file); + if (reboot > NEW_MENU) ext[2] = '_'; TFilename dest(todir); @@ -621,10 +620,7 @@ bool TInstaller_mask::move_file(const TFilename& file, const char* todir) const if (write_ok) { - int rp = underscore; - if (rp == NONE && xvt_str_compare_ignoring_case(ext, ".men")==0) - rp = NEW_MENU; - (int&)_reboot_program |= rp; // Skip const! + (int&)_reboot_program |= reboot; // Skip const! } return write_ok; } @@ -658,7 +654,7 @@ bool TInstaller_mask::move_module(const TString& module, TInstall_ini& ini, bool KEY TInstaller_mask::askdisk(TString & path, TFilename & cmdline, int d, int dischi, const char * modulo) { - TMask retry_mask(TR("Inserimento dischi"),1,80,10); + TMask retry_mask(TR("Inserimento disco"),1,80,10); retry_mask.add_static((F_PATH==101 ? 102:101),0, format(FR("Inserire il disco %d di %d del modulo'%s' nell'unità"), d, dischi, modulo) @@ -934,16 +930,16 @@ bool TInstaller_mask::install(const TString& module, int patchlevel) dst.lower(); src = path; src.add(dst); - const int underscore = needs_underscore(dst); - if (underscore) + const int reboot = needs_reboot(dst); + if (reboot > NEW_MENU) { dst.rtrim(1); dst << '_'; } ok = fcopy(src, dst); - if (ok && underscore != NONE) - _reboot_program |= underscore; + if (ok && reboot != NONE) + _reboot_program |= reboot; cancelled = pi.iscancelled(); }