1998-11-04 18:04:26 +00:00
|
|
|
#include <prefix.h>
|
2002-12-20 16:15:03 +00:00
|
|
|
#include <inst.h>
|
|
|
|
#include <modaut.h>
|
2003-08-01 09:29:13 +00:00
|
|
|
#include <tabutil.h>
|
1998-11-04 18:04:26 +00:00
|
|
|
#include "bainst.h"
|
|
|
|
#include "bainst38.h"
|
|
|
|
|
|
|
|
class TInstall_SV : public TInstallmodule_app
|
|
|
|
{
|
|
|
|
protected:
|
2002-12-20 16:15:03 +00:00
|
|
|
virtual int module_number() const {return SVAUT;}
|
2001-04-30 14:22:43 +00:00
|
|
|
virtual bool install_firm() {return TRUE;}
|
|
|
|
virtual bool install_com();
|
2003-08-01 09:29:13 +00:00
|
|
|
virtual bool load_default_data() const ;
|
1998-11-04 18:04:26 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
virtual ~TInstall_SV () {}
|
|
|
|
};
|
|
|
|
|
2001-04-30 14:22:43 +00:00
|
|
|
bool TInstall_SV ::install_com()
|
|
|
|
{
|
|
|
|
// ciclo su ogni ditta
|
|
|
|
TStd_filename txtfile(module_code());
|
|
|
|
txtfile << "tab.txt";
|
|
|
|
if (txtfile.check(TRUE))
|
|
|
|
{
|
|
|
|
// carica le tabelle nei file di default
|
2003-08-01 09:29:13 +00:00
|
|
|
TSystemtempfile tabstd(LF_TAB);
|
2001-04-30 14:22:43 +00:00
|
|
|
TFilename stdtabname(prefix().get_studio());
|
|
|
|
stdtabname << "STD\\lf0005.txt";
|
|
|
|
tabstd.load(txtfile);
|
|
|
|
tabstd.load(stdtabname);
|
|
|
|
tabstd.set_autodel();
|
|
|
|
TFilename tempfile;
|
|
|
|
tempfile.temp();
|
|
|
|
|
|
|
|
// riconverte le macro delle date
|
|
|
|
tabstd.dump(tempfile);
|
|
|
|
TScanner scan(tempfile);
|
|
|
|
FILE *dest=fopen((const char *)stdtabname,"w");
|
|
|
|
while (TRUE) {
|
|
|
|
TString &line=scan.line();
|
|
|
|
if (line.empty()) break;
|
|
|
|
|
|
|
|
int pos=(line.find("-0000"));
|
|
|
|
while (pos >= 0 )
|
|
|
|
{
|
|
|
|
line.overwrite("%yr%",pos+1);
|
|
|
|
pos=(line.find("-0000"));
|
|
|
|
}
|
|
|
|
line << '\n' ;
|
|
|
|
fputs((const char * )line,dest);
|
|
|
|
}
|
|
|
|
fclose(dest);
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2003-08-01 09:29:13 +00:00
|
|
|
bool TInstall_SV ::load_default_data() const
|
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
1998-11-04 18:04:26 +00:00
|
|
|
int bainst38(int argc, char** argv)
|
|
|
|
{
|
|
|
|
TInstall_SV app;
|
|
|
|
app.run(argc, argv);
|
|
|
|
return 0;
|
|
|
|
}
|