Patch level : 12.0 902
Files correlati : ba1.exe Commento : Aggiunta firma nel programma delle patch
This commit is contained in:
parent
7bbcac8f00
commit
6830096fbf
2965
exe/install.ini
2965
exe/install.ini
File diff suppressed because it is too large
Load Diff
@ -1997,7 +1997,10 @@ bool TFascicolator_mask::set_version_info(const TFilename& filename,
|
||||
ok = outfile.good() != 0;
|
||||
if (!ok)
|
||||
error_box("Error writing signature in %s error n. %d", (const char *) filename, errno);
|
||||
}
|
||||
}
|
||||
if (outfile.is_open())
|
||||
outfile.close(); // Qualcuno qui si dimentica di chiuderli i file eh?! Aspettiamo che il programma termini per rilasciare le risorse?
|
||||
SIRIOSIGN(filename); // Super modifica per la firma durante la creazione delle patch. Tolta firma in post-compilazione. (Solo per exe, dll ancora in post-compilazione)
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
@ -2093,7 +2096,7 @@ bool TCreadischi_mask::zip_module(const TString& main_module, bool agg, int patc
|
||||
TString4 submod;
|
||||
submod.strncpy(row->get(2), 2);
|
||||
set_version_info(cmd, ini, submod);
|
||||
}
|
||||
}
|
||||
_stat((const char *)cmd,&info);
|
||||
lasttime = max(lasttime, info.st_mtime);
|
||||
}
|
||||
|
@ -94,46 +94,46 @@ bool fcopy(
|
||||
|
||||
// @comm Nel caso vengano ravvisati degli errori durante l'operazione vengono
|
||||
// creati dei box di comunicazione che indicano la causa del problema
|
||||
{
|
||||
{
|
||||
CHECK(orig && *orig && dest && *dest, "fcopy: Invalid file name");
|
||||
|
||||
if (append || !advanced)
|
||||
{
|
||||
const char* const rflag = "rb";
|
||||
const char* wflag = append ? "ab" : "wb";
|
||||
|
||||
|
||||
// Copia il file su se stesso?
|
||||
if (xvt_str_same(orig, dest))
|
||||
return true; // Or FALSE?
|
||||
|
||||
FILE* i = NULL; fopen_s(&i, orig, rflag);
|
||||
if (i == NULL)
|
||||
if (i == NULL)
|
||||
return error_box(FR("Impossibile leggere il file '%s'\nda copiare in '%s'\nErrore %d"), orig, dest, errno);
|
||||
|
||||
if (!append)
|
||||
xvt_fsys_remove_file(dest);
|
||||
FILE* o = NULL; fopen_s(&o, dest, wflag);
|
||||
if (o == NULL)
|
||||
if (o == NULL)
|
||||
{
|
||||
fclose(i);
|
||||
if (append)
|
||||
return error_box(FR("Impossibile aprire il file '%s'\nper accodare il file '%s'\nErrore %d"), dest, orig, errno);
|
||||
else
|
||||
return error_box(FR("Impossibile scrivere il file '%s'\nper copiare il file '%s'\nErrore %d"), dest, orig, errno);
|
||||
}
|
||||
}
|
||||
|
||||
const int size = 16*1024;
|
||||
TString buffer(size);
|
||||
|
||||
bool ok = true;
|
||||
|
||||
bool ok = true;
|
||||
while (ok)
|
||||
{
|
||||
const word letti = fread(buffer.get_buffer(), 1, size, i);
|
||||
ok = fwrite(buffer.get_buffer(), 1, letti, o) == letti;
|
||||
if (letti < size) break;
|
||||
}
|
||||
|
||||
if (!ok)
|
||||
}
|
||||
|
||||
if (!ok)
|
||||
error_box(FR("Errore di scrittura: controllare lo spazio libero sul disco!"));
|
||||
|
||||
fclose(o);
|
||||
@ -154,20 +154,20 @@ bool fcopy(
|
||||
// @flag FALSE | Se il file non esiste
|
||||
bool fexist(
|
||||
const char* file) // @parm Nome del file di cui contrallare l'esistenza
|
||||
{
|
||||
{
|
||||
return file && *file && xvt_fsys_file_exists(file) != 0;
|
||||
}
|
||||
}
|
||||
|
||||
bool dexist(
|
||||
const char* file) // @parm Nome del file di cui contrallare l'esistenza
|
||||
{
|
||||
{
|
||||
return file && *file && xvt_fsys_dir_exists(file) != 0;
|
||||
}
|
||||
|
||||
long fsize(const char* name)
|
||||
{
|
||||
return (name && *name) ? xvt_fsys_file_attr(name, XVT_FILE_ATTR_SIZE) : 0L;
|
||||
}
|
||||
}
|
||||
|
||||
// @doc EXTERNAL
|
||||
|
||||
@ -197,7 +197,7 @@ bool remove_file(const char* file) // @parm Nome del file da cancellare
|
||||
|
||||
int remove_files(const char* path, bool subdirs) // @parm maschera files da cancellare, es: "c:\temp\*.tmp"
|
||||
{
|
||||
TFilename dir(path);
|
||||
TFilename dir(path);
|
||||
if (dir.find('*') < 0 && dir.find('?') < 0 && dexist(dir))
|
||||
dir.add("*.*");
|
||||
|
||||
@ -207,8 +207,8 @@ int remove_files(const char* path, bool subdirs) // @parm maschera files da canc
|
||||
{
|
||||
dir = dir.path();
|
||||
// Windows XP doesn't support multi file deletion ...
|
||||
if (xvt_fsys_files_remove(dir, files) <= 0)
|
||||
{
|
||||
if (xvt_fsys_files_remove(dir, files) <= 0)
|
||||
{
|
||||
dir.insert(TR("Cancellazione cartella ")); // ... do it manually
|
||||
TProgress_monitor bar(count, dir);
|
||||
for (SLIST_ELT e = xvt_slist_get_first(files); e; e = xvt_slist_get_next(files, e))
|
||||
@ -228,13 +228,13 @@ int remove_files(const char* path, bool subdirs) // @parm maschera files da canc
|
||||
|
||||
int count_files(const char* dir, bool subdirs)
|
||||
{
|
||||
TFilename d(dir);
|
||||
if (d.find('*') < 0 && d.find('?') < 0)
|
||||
TFilename d(dir);
|
||||
if (d.find('*') < 0 && d.find('?') < 0)
|
||||
d.add("*.*");
|
||||
SLIST files = xvt_fsys_list_files("", d, subdirs);
|
||||
const int count = xvt_slist_count(files);
|
||||
xvt_slist_destroy(files);
|
||||
return count;
|
||||
return count;
|
||||
}
|
||||
|
||||
// @doc EXTERNAL
|
||||
@ -245,20 +245,20 @@ int count_files(const char* dir, bool subdirs)
|
||||
// @rdesc Ritorna il numero di file che soddisfano la condizione passata (numero di elementi
|
||||
// di result)
|
||||
int list_files(
|
||||
const char* filelist, // @parm Stringa contenente la maschera di estrazione
|
||||
const char* filelist, // @parm Stringa contenente la maschera di estrazione
|
||||
TString_array& result) // @parm Array da riempire con la lista dei file
|
||||
|
||||
{
|
||||
|
||||
{
|
||||
TString mask(filelist);
|
||||
|
||||
mask.replace('\\', '/');
|
||||
SLIST files = xvt_fsys_list_files("", mask, FALSE);
|
||||
const int count = xvt_slist_count(files);
|
||||
|
||||
|
||||
for (SLIST_ELT e = xvt_slist_get_first(files); e; e = xvt_slist_get_next(files, e))
|
||||
result.add(xvt_slist_get(files, e, NULL));
|
||||
result.add(xvt_slist_get(files, e, NULL));
|
||||
xvt_slist_destroy(files);
|
||||
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
@ -271,13 +271,23 @@ bool input_filename(TFilename& file)
|
||||
const bool good = xvt_dm_post_file_open(&fs, TR("Selezionare il file")) == FL_OK;
|
||||
|
||||
xvt_fsys_set_dir(&dir);
|
||||
|
||||
|
||||
if (good)
|
||||
xvt_fsys_convert_fspec_to_str(&fs, file.get_buffer(), file.size());
|
||||
|
||||
return good;
|
||||
}
|
||||
return good;
|
||||
}
|
||||
|
||||
void sirio_codesigning(const TFilename& filename)
|
||||
{
|
||||
TConfig installini("install.ini", "Main");
|
||||
TString command = installini.get("SirioSignCommand", nullptr, -1, "");
|
||||
if (command.empty())
|
||||
command << R"("C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x64\signtool.exe" sign /a /s MY /n "Sirio Informatica e Sistemi SPA" /t http://timestamp.verisign.com/scripts/timstamp.dll /v)";
|
||||
command << " \"" << filename.path() << static_cast<const char*>((const TFilename&)filename) << "\"";
|
||||
message_box(command);
|
||||
xvt_sys_execute(command, TRUE, FALSE);
|
||||
}
|
||||
|
||||
// Certified 99%
|
||||
// @doc EXTERNAL
|
||||
@ -293,7 +303,7 @@ char* format(
|
||||
// stringa di destinazione alla funzione.
|
||||
{
|
||||
char buf[512];
|
||||
va_list pars;
|
||||
va_list pars;
|
||||
va_start(pars, fmt);
|
||||
const int tot = _vsnprintf(buf, sizeof(buf), fmt, pars);
|
||||
va_end(pars);
|
||||
@ -318,7 +328,7 @@ void log_message(const char* fmt, ...)
|
||||
else
|
||||
flog = fopen(f, "a");
|
||||
}
|
||||
|
||||
|
||||
if (fmt && *fmt)
|
||||
{
|
||||
TString80 str;
|
||||
@ -326,12 +336,12 @@ void log_message(const char* fmt, ...)
|
||||
str << ctime(&t);
|
||||
str.rtrim() << ' ';
|
||||
fprintf(flog, (const char*)str);
|
||||
|
||||
va_list pars;
|
||||
|
||||
va_list pars;
|
||||
va_start(pars, fmt);
|
||||
const int tot = vfprintf(flog, fmt, pars);
|
||||
va_end(pars);
|
||||
}
|
||||
}
|
||||
fputc('\n', flog);
|
||||
}
|
||||
|
||||
@ -345,8 +355,8 @@ const char* cmd2name(
|
||||
const char* argv1) // @parm Nome del parametro (default "")
|
||||
{
|
||||
TFilename app(argv0);
|
||||
app = app.name();
|
||||
if (argv1 && *argv1)
|
||||
app = app.name();
|
||||
if (argv1 && *argv1)
|
||||
app << ' ' << argv1;
|
||||
else
|
||||
{
|
||||
@ -354,11 +364,11 @@ const char* cmd2name(
|
||||
if (space != NULL)
|
||||
app << space;
|
||||
}
|
||||
|
||||
|
||||
app.lower();
|
||||
|
||||
const int par = app.find(" -");
|
||||
const int num = par > 0 ? atoi(app.mid(par+2))+1 : 1;
|
||||
const int num = par > 0 ? atoi(app.mid(par+2))+1 : 1;
|
||||
|
||||
const char c = (num > 9) ? ('a'+num-10) : ('0'+num);
|
||||
app.cut(3);
|
||||
@ -461,7 +471,7 @@ const char* esc(
|
||||
{
|
||||
const char *s1 = s == NULL ? "" : s;
|
||||
char* encoded = get_tmp_string().get_buffer(strlen(s));
|
||||
char* s2 = encoded;
|
||||
char* s2 = encoded;
|
||||
while (*s1)
|
||||
{
|
||||
if (*s1 == '\\')
|
||||
@ -484,12 +494,12 @@ const char* esc(
|
||||
if (*s1 == '0')
|
||||
{
|
||||
s1++;
|
||||
if (tolower(*s1) == 'x')
|
||||
if (tolower(*s1) == 'x')
|
||||
{
|
||||
s1++;
|
||||
base = 16;
|
||||
}
|
||||
else
|
||||
else
|
||||
base = 8;
|
||||
}
|
||||
*s2 = 0;
|
||||
@ -542,7 +552,7 @@ const char* unesc(
|
||||
case '\t':
|
||||
*s2++ = '\\'; *s2++ = 't';
|
||||
break;
|
||||
default:
|
||||
default:
|
||||
*s2++ = '\\'; *s2++ = '0'; *s2++ = 'x';
|
||||
sprintf(s2, "%02x", int(c)); s2 += 2;
|
||||
break;
|
||||
@ -562,7 +572,7 @@ const char * encode(const char* data)
|
||||
{
|
||||
char* tmp = get_tmp_string(strlen(data)).get_buffer();
|
||||
xvt_str_encode(data, tmp, 0);
|
||||
return tmp;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
// @doc EXTERNAL
|
||||
@ -572,7 +582,7 @@ const char* decode(const char* data)
|
||||
{
|
||||
char* tmp = get_tmp_string(strlen(data)).get_buffer();
|
||||
xvt_str_decode(data, tmp, 0);
|
||||
return tmp;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
//salta gli spazi bianchi ad inizio file
|
||||
@ -610,8 +620,8 @@ long daytime()
|
||||
// DON'T cache this bool because hostname can be local or server
|
||||
static bool is_sirio_station(const char* hostname)
|
||||
{
|
||||
const char* const ranger[] =
|
||||
{
|
||||
const char* const ranger[] =
|
||||
{
|
||||
"NBKI7HPFERRANDI", // Davide
|
||||
"NBKDELLI7TOLLAR", // Mattia
|
||||
"MOBILE", // Roberto
|
||||
@ -619,7 +629,7 @@ static bool is_sirio_station(const char* hostname)
|
||||
"ARCHIMEDE", // Alessandro
|
||||
"SIRIOCOMP",
|
||||
"NBK_SPALACINO_A", // Simone
|
||||
NULL
|
||||
NULL
|
||||
};
|
||||
for (int i = 0; ranger[i]; i++)
|
||||
if (xvt_str_same(hostname, ranger[i]))
|
||||
|
@ -20,6 +20,9 @@
|
||||
#define SAFE_DELETE(p) { delete p; p = NULL; }
|
||||
#define DEBUG_ENABLED is_debug_station()
|
||||
|
||||
void sirio_codesigning(const TFilename& filename);
|
||||
#define SIRIOSIGN(filename) sirio_codesigning((const TFilename&)((filename)))
|
||||
|
||||
|
||||
class TPerformance_profiler : public TObject
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user