Patch level : 1.32 nopatch

Files correlati     : Tg2-Odeon ...
Ricompilazione Demo : [ ]
Commento            :


git-svn-id: svn://10.65.10.50/trunk@10257 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2002-05-27 13:16:06 +00:00
parent b4592c4df8
commit 24035af0d5
10 changed files with 80 additions and 155 deletions

View File

@ -24,7 +24,8 @@ int main(int argc,char** argv)
ba1700(argc,argv); break;
case 7:
ba1800(argc,argv); break;
case 8:
ba1900(argc,argv); break;
default:
ba1100(argc,argv); break; // Manutenzione
}

View File

@ -33,6 +33,7 @@ public:
virtual ~TInformazione_moduli() {};
};
bool update_dninst(bool force);
bool update_assistance_year();
#endif

View File

@ -107,14 +107,13 @@ HIDDEN int module2number(const TString& mod)
return n;
}
bool update_assistance_year()
{
bool update_dninst(bool force)
{
const TFilename keys_name = "dninst.zip";
TFilename remote_name;
if (remote_name.empty()) // Dummy test
if (force || !keys_name.exist())
{
TConfig ini("install.ini", "Main");
remote_name = ini.get("DiskPath");
TFilename remote_name = ini.get("DiskPath");
if (os_is_removable_drive(remote_name))
message_box("Assicuratevi che il CD di installazione sia nel lettore %c:", remote_name[0]);
remote_name.add(keys_name);
@ -124,9 +123,15 @@ bool update_assistance_year()
else
build_dninst(remote_name);
#endif
}
}
return TRUE;
}
TScanner keys(keys_name);
bool update_assistance_year()
{
update_dninst(TRUE);
TScanner keys("dninst.zip");
bool ok = FALSE;
if (keys.ok())
{
@ -147,7 +152,7 @@ bool update_assistance_year()
break;
decode_string(dninst_key, line.get_buffer());
sn = atoi(line);
if (sn == serno || line[0] == '*')
if (sn == serno)
{
/*
TToken_string moduli(line, ';');

View File

@ -1,4 +1,5 @@
#include <sys/stat.h>
#include <agasys.h>
#include <applicat.h>
#include <defmask.h>
@ -1583,12 +1584,17 @@ bool TCreadischi_mask::zip_file(const char* archive, const char* listfile) const
TIndwin waitw(100,msg,FALSE,FALSE);
TWait_cursor hourglass;
#ifdef XVAGA
return aga_zip_filelist(listfile, archive);
#else
TFilename cmd;
int err=0;
cmd << "zip.pif " << archive << ' ' << listfile;
TExternal_app app(cmd);
err = app.run(FALSE, FALSE, FALSE, FALSE);
return err == 0;
#endif
}
bool TCreadischi_mask::move_file(const TFilename& file, const char* dir) const
@ -2033,8 +2039,6 @@ int find(const TString& name, TString_array & rows)
return r;
}
int ba1600(int argc, char* argv[])
{
if (user() == ::dongle().administrator())

View File

@ -1,5 +1,4 @@
#include <applicat.h>
#include <colors.h>
#include <defmask.h>
#include <dongle.h>
#include <execp.h>
@ -8,8 +7,8 @@
#include <progind.h>
#include <sheet.h>
#include <utility.h>
#include <prefix.h>
#include <urldefid.h>
#include <agasys.h>
#include "ba1.h"
#include "ba1500.h"
@ -271,21 +270,7 @@ bool TInstaller_mask::autoload()
if (internet)
{
parse_internet_path(http_server,http_path );
/* http_server = get(F_PATH);
if (http_server.compare("http://", 7, TRUE) == 0)
http_server.ltrim(7);
const int slash = http_server.find('/');
if (slash > 0)
{
http_path = http_server.mid(slash);
if (http_path.right(1) != "/")
http_path << '/';
http_server.cut(slash);
}
else
http_path = http_default_path;*/
parse_internet_path(http_server,http_path);
make_dir(path);
@ -325,11 +310,6 @@ bool TInstaller_mask::autoload()
return error_box("Specificare un percorso valido");
TWait_cursor hourglass;
// !?!?!? modifica per correggere il bug di libreria su _parked dei TSheet:
// !?!?!? (uso della stringa _park e dell'indice _parked )
// !?!?!? rimuovere appena si è corretto l'errore
// for (short pisellone =0; pisellone<100; pisellone++) add("");
// !?!?! fine modifica
destroy();
force_update();
@ -342,8 +322,8 @@ bool TInstaller_mask::autoload()
{
// Presente il file ini generale "install.ini"
TInstall_ini ini(ininame);
ini.list_paragraphs(modules);
FOR_EACH_ARRAY_ROW(modules, i, row)
{
const TString& module = *row;
@ -580,27 +560,14 @@ bool TInstaller_mask::move_file(const TFilename& from, const TFilename& file, co
bool space_ok = FALSE;
while (!space_ok)
{
/*
int disk = 0;
if (dest[1] == ':')
{
const char letter = toupper(dest[0]);
disk = 'A' - letter + 1;
}
struct _diskfree_t drive;
_dos_getdiskfree(disk, &drive);
const unsigned requested_clusters = unsigned(filesize / drive.sectors_per_cluster / drive.bytes_per_sector) + 1;
space_ok = requested_clusters <= drive.avail_clusters;
*/
space_ok = os_test_disk_free_space(dest, filesize);
if (!space_ok)
{
TString msg;
msg << "Lo spazio su disco e' insufficiente:\n";
if (::os_is_removable_drive(todir))
msg << "Lo spazio sull'unita' e' insufficiente";
if (os_is_removable_drive(dest))
{
msg << "Inserire un nuovo disco e ritentare?";
msg << ":\nInserire un nuovo disco e ritentare?";
if (!yesno_box(msg))
return FALSE;
}
@ -781,17 +748,21 @@ bool TInstaller_mask::install(const TString& module, int patchlevel)
{
TFilename remote = cmdline.name();
remote.insert(http_path, 0);
http_get(http_server, remote, cmdline);
if (!http_get(http_server, remote, cmdline))
error_box("Errore di trasferimento del file '%s'", (const char*)remote);
}
ok = cmdline.exist();
while (!ok)
if (!ok && !internet) // Chiedi cambio disco (sole se non sta scaricando da internet)
{
if (askdisk(path,cmdline,d,dischi,(const char*)ini->get("Descrizione"))==K_QUIT)
break;
ok = fexist(cmdline);
if (!ok)
message_box("Impossibile trovare %s\n",(const char*)cmdline);
while (!ok)
{
if (askdisk(path,cmdline,d,dischi,(const char*)ini->get("Descrizione"))==K_QUIT)
break;
ok = fexist(cmdline);
if (!ok)
message_box("Impossibile trovare il file '%s'",(const char*)cmdline);
}
}
if (ok)
@ -807,11 +778,14 @@ bool TInstaller_mask::install(const TString& module, int patchlevel)
if (ok)
{
TWait_cursor hourglass;
#ifdef XVAGA
aga_unzip(cmdline, tempdir);
#else
cmdline.insert("unzip.pif -o ", 0);
cmdline << " -d " << tempdir;
TExternal_app app(cmdline);
ok = app.run(FALSE, FALSE, FALSE, FALSE) == 0;
#endif
pi.addstatus(1);
}
}
@ -845,8 +819,7 @@ bool TInstaller_mask::install(const TString& module, int patchlevel)
pi.set_text(msg);
ok = move_module(module, *ini, TRUE);
TAuto_token_string altri(ini->get("Moduli", module));
FOR_EACH_TOKEN(altri, mod)
if (ok)
{
TAuto_token_string altri(ini->get("Moduli", module));
FOR_EACH_TOKEN(altri, mod)
@ -1207,9 +1180,7 @@ TInstaller_mask::TInstaller_mask()
add_string(F_PATH, 0, "Installa da ", 1, 1, 50);
add_string(F_CURPATH, 0, "Installa in ", 1, 2, 50, "D");
//TMask::add_button(F_UPDATE, 0, "Rileggi", 60,1,9,1,""/*,BMP_LINK*/);
add_button(F_UPDATE, "Rileggi", '\0');
//TMask::add_button(F_INSTALL, 0, "Installa", 60,1,9,1,""/*,BMP_LINK*/);
add_button(F_INSTALL, "Installa", '\0'); // NON mettere 'I'
set_handler(F_PATH, path_handler);
@ -1293,13 +1264,13 @@ protected:
bool TInstaller::testdatabase() const
{
TConfig ini(CONFIG_INSTALL);
TConfig ini(CONFIG_INSTALL, "Main");
return ini.get("TestDatabase","Main",-1,"Y") != "N";
}
bool TInstaller::testprograms() const
{
TConfig ini(CONFIG_INSTALL);
TConfig ini(CONFIG_INSTALL, "Main");
char c = ini.get("TestPrograms","Main",-1,"N")[0];
return c == 'X' || c == 'Y';
}
@ -1318,6 +1289,8 @@ bool TInstaller::create()
attivazione.run();
dongle().login(); // Rilegge anno assistenza
}
else
update_dninst(FALSE); // Aggiorna se necessario
if (testprograms())
{
@ -1360,6 +1333,8 @@ bool TExtendedInstaller::create()
attivazione.run();
dongle().login(); // Rilegge anno assistenza
}
else
update_dninst(FALSE); // Aggiorna se necessario
_m = new TInstaller_mask() ;
return TSkeleton_application::create();

View File

@ -8,18 +8,12 @@ int main(int argc, char** argv)
switch (r)
{
case 1:
ba2200(argc, argv); break;
case 2:
ba2300(argc, argv) ; break;
case 3:
ba2400(argc, argv) ; break;
case 4:
ba2500(argc, argv) ; break;
case 5:
ba2600(argc, argv) ; break;
default:
ba2100(argc, argv); break;
case 1: ba2200(argc, argv); break;
case 2: ba2300(argc, argv); break;
case 3: ba2400(argc, argv); break;
case 4: ba2500(argc, argv); break;
case 5: ba2600(argc, argv); break;
default: ba2100(argc, argv); break;
}
exit(0);
return 0;

View File

@ -1,12 +1,8 @@
#include <direct.h>
#ifndef XVAGA
#define XVT_INCL_NATIVE
#include <archives.h>
#endif
#include <agasys.h>
#include <automask.h>
#include <config.h>
#include <execp.h>
#include <isam.h>
#include <mailbox.h>
@ -41,28 +37,28 @@ public:
TArchive_mask::TArchive_mask() : TAutomask("ba2200")
{
#if XVT_OS == XVT_OS_WIN16
TList_field& lf = (TList_field&)field(F_FLOPPY);
TToken_string codes, values;
TString4 str;
int k = 0;
for (int d = 0; d < 26; d++)
{
UINT t = ::GetDriveType(d);
if (t != 0)
str.format("%c:/", d+'A');
const bool isrem = os_is_removable_drive(str);
const bool isfix = !isrem && os_is_fixed_drive(str);
if (isrem || isfix)
{
str.format("%c:", d+'A');
str.rtrim(1); // Togli slash finale
codes.add(str);
values.add(str);
TToken_string& message = *lf.message(k++, TRUE);
if (t == DRIVE_REMOVABLE)
if (isrem)
message.format("DISABLE,%d", F_PATH);
else
message.format("ENABLE,%d", F_PATH);
}
}
lf.replace_items(codes, values);
#endif
}
bool TArchive_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
@ -154,8 +150,6 @@ KEY TArchive_app::query(int& mode, long& firm, TFilename& floppy_path, TString&
mode |= 0x4;
if (m.get_bool(F_770))
mode |= 0x8;
if (m.get_bool(F_CESP))
mode |= 0x10;
floppy_path.format("%c:%c", toupper(m.get(F_FLOPPY)[0]), SLASH);
floppy_path.add(m.get(F_PATH));
@ -228,30 +222,21 @@ bool TArchive_app::zip_dir(const TFilename& name, unsigned long max_chunk)
tmp.ext("zip");
TFilename filenames = name; filenames.add("*.*");
ofstream o("ziplist.txt");
o << filenames << endl;
o.close();
TString msg;
msg << "Creazione del file temporaneo " << tmp << "...";
TIndwin waitw(100,msg,FALSE,FALSE);
TWait_cursor hourglass;
TFilename cmd;
cmd << "zip.pif " << tmp << ' ' << "ziplist.txt" << " -j"; // -j NON salvare i path
TExternal_app app(cmd);
int err = app.run(FALSE, FALSE, FALSE, FALSE);
remove("ziplist.txt");
if (err == 0 && tmp.exist())
{
if (!split_file(tmp, max_chunk))
err = 1;
remove(tmp);
}
return err == 0;
bool ok = aga_zip(filenames, tmp);
if (ok && tmp.exist())
{
ok = split_file(tmp, max_chunk);
remove(tmp);
}
return ok;
}
bool TArchive_app::can_save_as(const TFilename& src, const TFilename& dst) const
@ -402,13 +387,6 @@ void TArchive_app::backup(int mode, long firm, const TFilename& floppy_path, con
ok = zip_dir(name, max_chunk);
}
if (ok && (mode & 0x10))
{
name = firm2dir(-1); // __ptprf
name.add("cesp"); // Aggiungi cespiti
ok = zip_dir(name, max_chunk);
}
prefix().set(old); // Ripristina prefix
if (ok)
@ -525,9 +503,6 @@ void TArchive_app::restore(int mode, long firm, const TFilename& floppy_path)
if (mode & 0x8)
read_paragraph(ini, "m770");
if (mode & 0x10)
read_paragraph(ini, "cesp");
const int tot = _zip_list.items();
if (tot > 0)
{
@ -571,40 +546,15 @@ void TArchive_app::interactive_mode()
{
if (k == K_SAVE)
{
const bool use_zip = TRUE;
if (use_zip)
backup(mode, firm, floppy_path, desc);
else
{
TArchive arc;
arc.backup(mode, firm, floppy_path[0], desc);
}
backup(mode, firm, floppy_path, desc);
}
else
{
TFilename ini_name; ini_name = floppy_path; ini_name.add("backup.ini");
TFilename ini_name = floppy_path; ini_name.add("backup.ini");
if (os_is_removable_drive(floppy_path.left(3)))
message_box("Inserire il primo disco del backup nel drive %c", floppy_path[0]);
if (ini_name.exist())
{
#ifdef XVAGA
restore(mode, firm, floppy_path);
#else
bool use_zip = FALSE;
{
TConfig ini(ini_name, "Main");
ini.write_protect();
use_zip = ini.get("Format").compare("zip", TRUE) == 0;
}
if (use_zip)
restore(mode, firm, floppy_path);
else
{
TArchive arc;
arc.restore(mode, firm, floppy_path[0], FALSE);
}
#endif
}
restore(mode, firm, floppy_path);
else
error_box("Impossibile trovare il file %s", (const char*)ini_name);
}

View File

@ -11,4 +11,3 @@
#define F_COM 111
#define F_CONFIG 112
#define F_770 113
#define F_CESP 114

View File

@ -7,6 +7,7 @@ BEGIN
PROMPT 1 1 "Disco "
ITEM "A|A:" MESSAGE CLEAR,F_PATH
ITEM "B|B:" MESSAGE CLEAR,F_PATH
ITEM "C|C:" MESSAGE ENABLE,F_PATH
END
STRING F_PATH 45
@ -17,7 +18,7 @@ END
BOOLEAN F_DITTA
BEGIN
PROMPT 1 2 "Dati ditta"
MESSAGE TRUE ENABLE,1@|"X",F_770|"X",F_CESP
MESSAGE TRUE ENABLE,1@|"X",F_770
MESSAGE FALSE CLEAR,1@
END
@ -37,11 +38,6 @@ BEGIN
PROMPT 1 5 "Dati 770"
END
BOOLEAN F_CESP
BEGIN
PROMPT 1 6 "Cespiti"
END
NUMBER F_CODDITTA 5
BEGIN
PROMPT 15 2 ""
@ -64,7 +60,7 @@ END
BUTTON F_ALL 10 2
BEGIN
PROMPT 58 4 "~Tutti"
MESSAGE "X",F_DITTA|"X",F_COM|"X",F_CONFIG|"X",F_770|"X",F_CESP|"",F_CODDITTA
MESSAGE "X",F_DITTA|"X",F_COM|"X",F_CONFIG|"X",F_770|"",F_CODDITTA
END
STRING F_DESCR 50

View File

@ -6,7 +6,7 @@
#endif
#ifndef __CONFIG_H
class TConfig;
#include <config.h>
#endif
class TArchive_app : public TSkeleton_application