2002-07-03 14:48:48 +00:00
# include <agasys.h>
1997-10-30 15:13:59 +00:00
# include <applicat.h>
1999-05-24 13:34:11 +00:00
# include <execp.h>
1998-08-21 10:58:38 +00:00
# include <isamrpc.h>
Patch level : 2.0 490
Files correlati : ba1.exe
Ricompilazione Demo : [ ]
Commento :
AO20049
Utilizzando una schedina EUTRON una volta aperto l'installer di Campo non
vengono riportati automaticamente i moduli attivati su tale schedina.
AO20050
Una volta installato Campo con una schedina EUTRON e finita la conversione
(anche uscendo da Campo e riavviando il PC), per i moduli installati non
vengono abilitate le rispettive voci nei sottomenù (quindi ad es.
Contabilità Generale, Documenti di Vendita, ecc
)
ATTENZIONE: Ovvia conseguenza del AO20049
AO20051
Utilizzando una schedina HARDLOCK se vado su Installazione Moduli va
automaticamente su Attivazione Moduli e restituisce il messaggio
"Il contratto 2001 è stato attivato automaticamente", una volta dato
l'OK ritorna su Installazione Moduli e presenta l'elenco corretto dei
moduli da installare, solo che una volta lanciata l'installazione per ogni
modulo restituisce un altro messaggio "Per installare la versione 20020200
del modulo 'xx' occorre il contratto di assistenza per l'anno 2002"
nonostante la schedina in questione è stata abilitata all'assistenza 2003
(infatti a seguito di questo riporta sulla schedina l'assistenza 2001).
Non si riesce pertanto ad installare i moduli, questo è dovuto al fatto
che nella cartella di Campo viene riportato anche il file dninst.zip
sul quale probabilmente c'era il numero di schedina che ho usato per
fare la prova (HARDLOCK 05714).
AO20052
Per provare a risolvere il problema della segnalazione precedente (AO20051)
si è provato a cancellare il file dninst.zip dalla cartella di Campo,
solo che una volta avviato Campo viene restituito il messaggio
"Impossibile trovare il file dninst.zip" seguito da un errore fatale su BA1;
in tutte le prove successive però si è notato che il file dninst.zip
veniva rigenerato ogni volta.
AO20054
Provato a fare un'installazione in rete utilizzando come server il PC usato
per l'installazione Standard con schedina EUTRON, come per l'installazione
standard prendendo dal server i programmi non ha riportato selezionati i
moduli attivi su questa seconda schedina, il problema è pertanto uguale a
quello della segnalazione AO20049 e AO20050.
ATTENZIONE: Segnalazione intrinsecamente superflua.
Quando la chiavetta non viene riconosciuta come valida,
e' MOLTO probabile che lo risulti su tutti i computer (server e non).
AO20055
Ho provato l'installazione in rete con programmi e dati sul server,
una volta finita non si riesce ad entrare in Campo perché sembra che invece
di fare riferimento al Campo.ini che ha in locale fa riferimento al Campo.ini
sul server.
AO20056
Ho provato a fare un'installazione di una postazione con server di chiavi,
non appena arriva all'installazione del server di chiavi restituisce
il messaggio: "Errore fatale! .\Si è verificato un errore copiando e
decomprimendo il file \", quindi l'installazione va in errore.
ATTENZIONE: Eliminato ogni riferimento a Frontend.exe.
D'ora in poi usare il server Authoriz.exe
AO20057
Ho provato a fare un'installazione di una postazione con Master Server,
l'installazione prosegue normalmente (fatte eccezione per le segnalazioni
precedenti) ma non crea il file Lerch.exe sotto la cartella Servers di Campo,
quindi quando cerca di avviare il programma dall'esecuzione automatica non
trova il file.
git-svn-id: svn://10.65.10.50/trunk@11214 c028cbd2-c16b-5b4b-a496-9718f37d4682
2003-06-05 13:39:12 +00:00
# include <modaut.h>
2007-10-04 15:20:11 +00:00
# include <prefix.h>
1997-10-30 15:13:59 +00:00
# include <progind.h>
1997-12-04 14:07:49 +00:00
# include <sheet.h>
2008-05-15 15:01:55 +00:00
# include <statbar.h>
# include <urldefid.h>
1997-10-30 15:13:59 +00:00
# include <utility.h>
2002-05-27 13:16:06 +00:00
1997-10-30 15:13:59 +00:00
# include "ba1.h"
1997-12-15 15:11:40 +00:00
# include "ba1500.h"
1997-10-30 15:13:59 +00:00
# include "ba1600.h"
# include "ba1700a.h"
1998-02-24 10:30:04 +00:00
1998-02-18 13:46:52 +00:00
// definizioni delle colonne dello sheet
# define C_MODULE 1
# define C_CODE 2
# define C_RELEASE 3
# define C_PATCH 4
# define C_DATAREL 5
# define C_CURRRELEASE 6
# define C_CURRPATCH 7
# define C_CURRDATAREL 8
# define C_ISPATCH 9
2003-03-14 14:54:28 +00:00
# define C_BASEPATCH 10
1998-01-29 13:42:30 +00:00
2007-12-19 11:41:00 +00:00
///////////////////////////////////////////////////////
// Metodi di utility
///////////////////////////////////////////////////////
2009-01-12 16:52:14 +00:00
HIDDEN const TString & http_default_path ( )
2010-03-29 14:36:06 +00:00
{ return get_oem_info ( " Web " , " www.aga.it/release100/ " ) ; }
1999-04-06 15:34:39 +00:00
1998-01-23 14:55:34 +00:00
HIDDEN int compare_version ( const char * v1 , int p1 , const char * v2 , int p2 )
1997-10-30 15:13:59 +00:00
{
1998-08-25 17:46:29 +00:00
TString16 ver1 ( v1 ) , ver2 ( v2 ) ;
2007-03-07 10:23:42 +00:00
1997-10-30 15:13:59 +00:00
ver1 . trim ( ) ;
2007-03-07 10:23:42 +00:00
ver1 . ltrim ( ver1 . len ( ) = = 4 ? 2 : 4 ) ;
1997-10-30 15:13:59 +00:00
ver2 . trim ( ) ;
2007-03-07 10:23:42 +00:00
ver2 . ltrim ( ver2 . len ( ) = = 4 ? 2 : 4 ) ;
int res = ver1 . compare ( ver2 , - 1 , TRUE ) ;
if ( res = = 0 )
1998-08-25 17:46:29 +00:00
1998-01-23 14:55:34 +00:00
res = p1 - p2 ;
1998-08-25 17:46:29 +00:00
1998-01-22 11:56:14 +00:00
return res ;
1997-10-30 15:13:59 +00:00
}
1997-12-15 15:11:40 +00:00
HIDDEN word version2year ( const char * v )
1998-08-25 17:46:29 +00:00
{
1997-12-15 15:11:40 +00:00
TString16 ver ( v ) ;
1998-08-25 17:46:29 +00:00
if ( ver . len ( ) = = 4 )
1997-12-15 15:11:40 +00:00
ver . insert ( ( v [ 0 ] = = ' 9 ' ) ? " 19 " : " 20 " , 0 ) ;
1998-08-25 17:46:29 +00:00
ver . cut ( 4 ) ;
1997-12-15 15:11:40 +00:00
return atoi ( ver ) ;
}
2007-12-19 11:41:00 +00:00
static int compare_modules ( const TObject * * o1 , const TObject * * o2 )
{
TToken_string & ts1 = * ( TToken_string * ) ( * o1 ) ;
TToken_string & ts2 = * ( TToken_string * ) ( * o2 ) ;
int res = 0 ;
for ( int i = 2 ; i < 5 & & res = = 0 ; i + + )
{
TString16 s1 = ts1 . get ( i ) ;
const char * s2 = ts2 . get ( i ) ;
res = s1 . compare ( s2 ) ;
}
return res ;
}
1998-08-25 17:46:29 +00:00
bool is_internet_path ( const TString & addr )
{
2008-03-19 15:31:53 +00:00
if ( addr . starts_with ( " www. " , true ) | | addr . starts_with ( " http: " , true ) )
2006-08-01 13:41:55 +00:00
return true ;
1998-08-25 17:46:29 +00:00
int a1 , a2 , a3 , a4 ;
if ( sscanf ( addr , " %d.%d.%d.%d " , & a1 , & a2 , & a3 , & a4 ) = = 4 )
2006-08-01 13:41:55 +00:00
return true ;
1998-08-25 17:46:29 +00:00
2006-08-01 13:41:55 +00:00
return false ;
1998-08-25 17:46:29 +00:00
}
1997-10-30 15:13:59 +00:00
///////////////////////////////////////////////////////////
// Maschera principale
///////////////////////////////////////////////////////////
1997-12-04 14:07:49 +00:00
class TInstaller_mask : public TArray_sheet
1998-08-25 17:46:29 +00:00
{
1997-12-04 14:07:49 +00:00
static TInstaller_mask * _curr_mask ;
2007-10-08 10:58:53 +00:00
int _station_type ; //intero che definisce il tipo di installazione (1=std,2=server,3=client)
1998-01-29 13:42:30 +00:00
bool _installed ; // Flag per verificare se almeno un modulo e' stato installato
2007-12-19 11:41:00 +00:00
bool _setup_run ; //Flag che indica se e' stato lanciato il programma setup.exe
2003-05-26 13:00:26 +00:00
2006-12-13 16:22:33 +00:00
enum { NONE = 0 , NEW_MENU = 1 ,
NEW_MENUPRG = 2 , NEW_INSTALLER = 4 , NEW_DLL = 8 , NEW_SYS = 14 ,
NEW_TRR = 16 } ;
2003-05-26 13:00:26 +00:00
int _reboot_program ;
1997-12-04 14:07:49 +00:00
protected : // TSheet
1997-12-15 15:11:40 +00:00
virtual bool on_key ( KEY key ) ;
1998-02-09 12:06:44 +00:00
static bool tutti_handler ( TMask_field & f , KEY k ) ;
2004-04-08 15:42:30 +00:00
int get_module_number ( const TString & module ) const ;
2009-06-08 15:06:41 +00:00
bool should_precheck_module ( int modnumber ) const ;
2003-10-03 08:12:08 +00:00
bool is_zip_file ( const TFilename & n ) const ;
1997-12-04 14:07:49 +00:00
2009-06-08 15:06:41 +00:00
bool copy_file ( const TFilename & src , const TFilename & dst ) const ;
2007-10-04 15:20:11 +00:00
bool copy_tree ( const char * src_study , const char * dst_study ) const ;
2007-12-19 11:41:00 +00:00
int test_station_type ( ) const ;
2003-10-24 08:17:32 +00:00
1997-10-30 15:13:59 +00:00
protected :
static bool path_handler ( TMask_field & fld , KEY key ) ;
2007-12-19 11:41:00 +00:00
static bool web_handler ( TMask_field & fld , KEY key ) ;
1997-10-30 15:13:59 +00:00
static bool sheet_notify ( TSheet_field & s , int r , KEY k ) ;
static bool install_handler ( TMask_field & fld , KEY key ) ;
1998-08-25 17:46:29 +00:00
static bool update_handler ( TMask_field & f , KEY k ) ;
1997-10-30 15:13:59 +00:00
2009-02-20 14:02:37 +00:00
bool add_module ( TConfig & ini , const TString & module , bool patch , int pos = - 1 ) ;
2007-12-19 11:41:00 +00:00
bool add_header ( TConfig & ini , const TString & module ) ;
2009-02-20 14:02:37 +00:00
int precheck_modules ( bool only_newer = true ) ;
1997-10-30 15:13:59 +00:00
void update_version ( ) ;
2009-02-20 14:02:37 +00:00
void update_disk_and_web_path ( ) ;
void kill_files ( ) ;
1997-12-15 15:11:40 +00:00
2003-05-29 07:57:20 +00:00
int needs_reboot ( const TFilename & file ) const ;
2003-06-11 14:19:56 +00:00
bool move_file ( const TFilename & src , const TFilename & dst ) const ;
1997-12-15 15:11:40 +00:00
bool move_module ( const TString & module , TInstall_ini & ini , bool update ) const ;
bool can_install ( const char * module , TInstall_ini & ini ) ;
1997-12-04 14:07:49 +00:00
void install_selection ( ) ;
2009-02-20 14:02:37 +00:00
bool install_patches ( const TString & module , const TString & lastrelease , int lastpatch , bool onlynew = true ) ;
KEY askdisk ( TString & path , TFilename & cmdline , int d , int dischi , const char * modulo ) ;
1997-10-30 15:13:59 +00:00
1997-12-15 15:11:40 +00:00
bool do_process ( TToken_string & commands ) const ;
1997-10-30 15:13:59 +00:00
bool pre_process ( TInstall_ini & ini , const char * module ) const ;
bool post_process ( TInstall_ini & ini , const char * module ) const ;
2007-12-19 11:41:00 +00:00
bool get_patches_path ( TFilename & path ) const ;
2004-03-05 08:59:03 +00:00
void parse_internet_path ( TString & http_server , TFilename & http_path ) const ;
2009-02-26 11:01:21 +00:00
bool is_program_dir ( const TFilename & path ) ;
2009-05-27 13:23:41 +00:00
bool is_visible_patch ( TConfig & ini ) const ;
1997-10-30 15:13:59 +00:00
1998-01-29 13:42:30 +00:00
public :
2004-07-23 13:04:28 +00:00
bool installed ( ) const { return _installed ; }
2007-12-19 11:41:00 +00:00
bool setup_run ( ) const { return _setup_run ; }
2007-10-08 10:58:53 +00:00
int station_type ( ) const { return _station_type ; }
1997-10-30 15:13:59 +00:00
bool autoload ( ) ;
1998-01-23 14:55:34 +00:00
bool install ( const TString & module , int patch ) ;
2007-10-04 15:20:11 +00:00
void backup ( ) const ;
2006-12-13 16:22:33 +00:00
bool run_conversion ( ) const
2007-12-19 11:41:00 +00:00
{ return installed ( ) & & ( _reboot_program & NEW_TRR ) ! = 0 ; }
1997-10-30 15:13:59 +00:00
TInstaller_mask ( ) ;
1997-12-04 14:07:49 +00:00
virtual ~ TInstaller_mask ( ) ;
1997-10-30 15:13:59 +00:00
} ;
1997-12-04 14:07:49 +00:00
TInstaller_mask * TInstaller_mask : : _curr_mask = NULL ;
2009-05-27 13:23:41 +00:00
bool TInstaller_mask : : is_visible_patch ( TConfig & ini ) const
{
bool yes = true ;
const TString & module = ini . get_paragraph ( ) ;
CHECKS ( module . len ( ) = = 2 , " Invalid module " , ( const char * ) module ) ;
const int mod = dongle ( ) . module_name2code ( module ) ;
if ( mod > BAAUT & & mod < ENDAUT )
{
TAuto_token_string oem = ini . get ( " OEM " ) ;
if ( oem . blank ( ) )
{
// Pezza temporanea: assegno OEM noti
switch ( mod )
{
2010-01-04 10:11:51 +00:00
case LVAUT : oem = " 2 " ; break ;
2009-05-27 13:23:41 +00:00
case PEAUT : oem = " 3 " ; break ;
case COAUT : oem = " 5 " ; break ;
default : break ;
} ;
}
if ( oem . full ( ) )
yes = oem . get_pos ( dongle ( ) . oem ( ) ) > = 0 ;
else
{
// Pezza temporanea: Ee significava AGA only
const bool ee = ini . get_bool ( " Ee " ) ;
if ( ee & & dongle ( ) . oem ( ) ! = 0 )
yes = false ;
}
}
return yes ;
}
1997-10-30 15:13:59 +00:00
// Copia nello sheet i dati di un modulo prendendoli da un .ini
1998-02-18 13:46:52 +00:00
bool TInstaller_mask : : add_module ( TConfig & ini , const TString & module , bool patch , int pos )
1997-10-30 15:13:59 +00:00
{
1998-01-26 10:45:15 +00:00
ini . write_protect ( ) ;
2006-12-13 16:22:33 +00:00
if ( ! ini . set_paragraph ( module ) )
return false ;
2001-04-30 14:22:43 +00:00
2009-05-20 15:37:50 +00:00
// Nasconde i moduli riservati da occhi indiscreti
2009-05-27 13:23:41 +00:00
if ( ! is_visible_patch ( ini ) )
return false ;
2006-12-13 16:22:33 +00:00
const int numpatch = ini . get_int ( " Patch " ) ;
TString4 strpatch ;
if ( numpatch > 0 )
2007-10-15 10:01:44 +00:00
strpatch . format ( " %04d " , numpatch ) ;
2006-12-13 16:22:33 +00:00
TToken_string row ;
row = " " ; // Not selected
row . add ( ini . get ( " Descrizione " ) ) ;
row . add ( module ) ;
row . add ( ini . get ( " Versione " ) ) ;
row . add ( strpatch ) ;
row . add ( ini . get ( " Data " ) ) ;
row . add ( patch ? " X " : " " , C_ISPATCH ) ;
2009-02-23 11:40:41 +00:00
if ( pos < 0 )
2006-12-13 16:22:33 +00:00
add ( row ) ;
else
insert ( row , pos ) ;
return true ;
1997-10-30 15:13:59 +00:00
}
2007-12-19 11:41:00 +00:00
// Copia nello sheet l'intestazione di un modulo prendendola da un .ini
bool TInstaller_mask : : add_header ( TConfig & ini , const TString & module )
1998-02-09 12:06:44 +00:00
{
ini . write_protect ( ) ;
bool ok = ini . set_paragraph ( module ) ;
if ( ok )
1998-08-25 17:46:29 +00:00
{
1998-02-09 12:06:44 +00:00
TToken_string row ;
row = " " ; // Not selected
row . add ( ini . get ( " Descrizione " ) ) ;
row . add ( ini . get ( " " ) ) ;
2006-08-01 13:41:55 +00:00
enable_row ( add ( row ) , false ) ;
1998-02-09 12:06:44 +00:00
}
return ok ;
}
2009-06-08 15:06:41 +00:00
bool TInstaller_mask : : should_precheck_module ( int modnumber ) const
Patch level : 2.0 490
Files correlati : ba1.exe
Ricompilazione Demo : [ ]
Commento :
AO20049
Utilizzando una schedina EUTRON una volta aperto l'installer di Campo non
vengono riportati automaticamente i moduli attivati su tale schedina.
AO20050
Una volta installato Campo con una schedina EUTRON e finita la conversione
(anche uscendo da Campo e riavviando il PC), per i moduli installati non
vengono abilitate le rispettive voci nei sottomenù (quindi ad es.
Contabilità Generale, Documenti di Vendita, ecc
)
ATTENZIONE: Ovvia conseguenza del AO20049
AO20051
Utilizzando una schedina HARDLOCK se vado su Installazione Moduli va
automaticamente su Attivazione Moduli e restituisce il messaggio
"Il contratto 2001 è stato attivato automaticamente", una volta dato
l'OK ritorna su Installazione Moduli e presenta l'elenco corretto dei
moduli da installare, solo che una volta lanciata l'installazione per ogni
modulo restituisce un altro messaggio "Per installare la versione 20020200
del modulo 'xx' occorre il contratto di assistenza per l'anno 2002"
nonostante la schedina in questione è stata abilitata all'assistenza 2003
(infatti a seguito di questo riporta sulla schedina l'assistenza 2001).
Non si riesce pertanto ad installare i moduli, questo è dovuto al fatto
che nella cartella di Campo viene riportato anche il file dninst.zip
sul quale probabilmente c'era il numero di schedina che ho usato per
fare la prova (HARDLOCK 05714).
AO20052
Per provare a risolvere il problema della segnalazione precedente (AO20051)
si è provato a cancellare il file dninst.zip dalla cartella di Campo,
solo che una volta avviato Campo viene restituito il messaggio
"Impossibile trovare il file dninst.zip" seguito da un errore fatale su BA1;
in tutte le prove successive però si è notato che il file dninst.zip
veniva rigenerato ogni volta.
AO20054
Provato a fare un'installazione in rete utilizzando come server il PC usato
per l'installazione Standard con schedina EUTRON, come per l'installazione
standard prendendo dal server i programmi non ha riportato selezionati i
moduli attivi su questa seconda schedina, il problema è pertanto uguale a
quello della segnalazione AO20049 e AO20050.
ATTENZIONE: Segnalazione intrinsecamente superflua.
Quando la chiavetta non viene riconosciuta come valida,
e' MOLTO probabile che lo risulti su tutti i computer (server e non).
AO20055
Ho provato l'installazione in rete con programmi e dati sul server,
una volta finita non si riesce ad entrare in Campo perché sembra che invece
di fare riferimento al Campo.ini che ha in locale fa riferimento al Campo.ini
sul server.
AO20056
Ho provato a fare un'installazione di una postazione con server di chiavi,
non appena arriva all'installazione del server di chiavi restituisce
il messaggio: "Errore fatale! .\Si è verificato un errore copiando e
decomprimendo il file \", quindi l'installazione va in errore.
ATTENZIONE: Eliminato ogni riferimento a Frontend.exe.
D'ora in poi usare il server Authoriz.exe
AO20057
Ho provato a fare un'installazione di una postazione con Master Server,
l'installazione prosegue normalmente (fatte eccezione per le segnalazioni
precedenti) ma non crea il file Lerch.exe sotto la cartella Servers di Campo,
quindi quando cerca di avviare il programma dall'esecuzione automatica non
trova il file.
git-svn-id: svn://10.65.10.50/trunk@11214 c028cbd2-c16b-5b4b-a496-9718f37d4682
2003-06-05 13:39:12 +00:00
{
2009-06-08 15:06:41 +00:00
bool ok = modnumber = = 0 ;
if ( ! ok )
{
2010-01-28 14:01:15 +00:00
//se l'installazione <20> un server, prechecka tutti i moduli, a meno che non sia in funzione il server..
//..di chiavi; in questo caso infatti la chiave <20> unica, ha dunque sicuramente tutti i moduli comuni..
//..alle varie installazioni client, e quindi basta checkare i moduli sulla chiave come per qualsiasi..
//..altra installazione
2009-06-08 15:06:41 +00:00
const TDongle & d = dongle ( ) ;
2010-01-28 14:01:15 +00:00
if ( station_type ( ) = = 2 & & d . hardware ( ) ! = _dongle_network )
2009-06-08 15:06:41 +00:00
{
//se sei un server hai tutti i moduli da installare
ok = d . shown ( modnumber ) ;
}
else
{
//senno' sei sfigato e ti installa solo i moduli sulla chiave
ok = d . active ( modnumber ) ;
if ( ! ok ) // Se non hai un modulo ... potresti avere un suo modulo sottinteso
{
switch ( modnumber )
{
case CAAUT : ok = d . active ( CMAUT ) ; break ; // Se non hai l'analitica ritenta con le commesse
case TPAUT : ok = d . active ( DCAUT ) ; break ; // Se non hai Pack ritenta con il CONAI
default : break ;
}
}
}
}
2007-10-08 10:58:53 +00:00
2009-06-08 15:06:41 +00:00
return ok ;
2007-10-08 10:58:53 +00:00
}
//che tipo di installazione e'?
2007-12-19 11:41:00 +00:00
int TInstaller_mask : : test_station_type ( ) const
2007-10-08 10:58:53 +00:00
{
TConfig ini ( CONFIG_INSTALL , " Main " ) ;
int type = ini . get_int ( " Type " ) ;
//se type non e' definito nei valori giusti (1=standard,2=server,3=client)
if ( type < 1 | | type > 3 )
Patch level : 2.0 490
Files correlati : ba1.exe
Ricompilazione Demo : [ ]
Commento :
AO20049
Utilizzando una schedina EUTRON una volta aperto l'installer di Campo non
vengono riportati automaticamente i moduli attivati su tale schedina.
AO20050
Una volta installato Campo con una schedina EUTRON e finita la conversione
(anche uscendo da Campo e riavviando il PC), per i moduli installati non
vengono abilitate le rispettive voci nei sottomenù (quindi ad es.
Contabilità Generale, Documenti di Vendita, ecc
)
ATTENZIONE: Ovvia conseguenza del AO20049
AO20051
Utilizzando una schedina HARDLOCK se vado su Installazione Moduli va
automaticamente su Attivazione Moduli e restituisce il messaggio
"Il contratto 2001 è stato attivato automaticamente", una volta dato
l'OK ritorna su Installazione Moduli e presenta l'elenco corretto dei
moduli da installare, solo che una volta lanciata l'installazione per ogni
modulo restituisce un altro messaggio "Per installare la versione 20020200
del modulo 'xx' occorre il contratto di assistenza per l'anno 2002"
nonostante la schedina in questione è stata abilitata all'assistenza 2003
(infatti a seguito di questo riporta sulla schedina l'assistenza 2001).
Non si riesce pertanto ad installare i moduli, questo è dovuto al fatto
che nella cartella di Campo viene riportato anche il file dninst.zip
sul quale probabilmente c'era il numero di schedina che ho usato per
fare la prova (HARDLOCK 05714).
AO20052
Per provare a risolvere il problema della segnalazione precedente (AO20051)
si è provato a cancellare il file dninst.zip dalla cartella di Campo,
solo che una volta avviato Campo viene restituito il messaggio
"Impossibile trovare il file dninst.zip" seguito da un errore fatale su BA1;
in tutte le prove successive però si è notato che il file dninst.zip
veniva rigenerato ogni volta.
AO20054
Provato a fare un'installazione in rete utilizzando come server il PC usato
per l'installazione Standard con schedina EUTRON, come per l'installazione
standard prendendo dal server i programmi non ha riportato selezionati i
moduli attivi su questa seconda schedina, il problema è pertanto uguale a
quello della segnalazione AO20049 e AO20050.
ATTENZIONE: Segnalazione intrinsecamente superflua.
Quando la chiavetta non viene riconosciuta come valida,
e' MOLTO probabile che lo risulti su tutti i computer (server e non).
AO20055
Ho provato l'installazione in rete con programmi e dati sul server,
una volta finita non si riesce ad entrare in Campo perché sembra che invece
di fare riferimento al Campo.ini che ha in locale fa riferimento al Campo.ini
sul server.
AO20056
Ho provato a fare un'installazione di una postazione con server di chiavi,
non appena arriva all'installazione del server di chiavi restituisce
il messaggio: "Errore fatale! .\Si è verificato un errore copiando e
decomprimendo il file \", quindi l'installazione va in errore.
ATTENZIONE: Eliminato ogni riferimento a Frontend.exe.
D'ora in poi usare il server Authoriz.exe
AO20057
Ho provato a fare un'installazione di una postazione con Master Server,
l'installazione prosegue normalmente (fatte eccezione per le segnalazioni
precedenti) ma non crea il file Lerch.exe sotto la cartella Servers di Campo,
quindi quando cerca di avviare il programma dall'esecuzione automatica non
trova il file.
git-svn-id: svn://10.65.10.50/trunk@11214 c028cbd2-c16b-5b4b-a496-9718f37d4682
2003-06-05 13:39:12 +00:00
{
2007-10-08 10:58:53 +00:00
const bool testdb = ini . get_bool ( " TestDatabase " ) ;
const bool testprg = ini . get_bool ( " TestPrograms " ) ;
if ( testdb )
{
if ( dongle ( ) . hardware ( ) = = _dongle_network ) //se usa un server di chiavi->server
type = 2 ;
else
type = 1 ;
}
else
type = 3 ;
ini . set ( " Type " , type ) ; //cosi' lo definisce se non c'e'
Patch level : 2.0 490
Files correlati : ba1.exe
Ricompilazione Demo : [ ]
Commento :
AO20049
Utilizzando una schedina EUTRON una volta aperto l'installer di Campo non
vengono riportati automaticamente i moduli attivati su tale schedina.
AO20050
Una volta installato Campo con una schedina EUTRON e finita la conversione
(anche uscendo da Campo e riavviando il PC), per i moduli installati non
vengono abilitate le rispettive voci nei sottomenù (quindi ad es.
Contabilità Generale, Documenti di Vendita, ecc
)
ATTENZIONE: Ovvia conseguenza del AO20049
AO20051
Utilizzando una schedina HARDLOCK se vado su Installazione Moduli va
automaticamente su Attivazione Moduli e restituisce il messaggio
"Il contratto 2001 è stato attivato automaticamente", una volta dato
l'OK ritorna su Installazione Moduli e presenta l'elenco corretto dei
moduli da installare, solo che una volta lanciata l'installazione per ogni
modulo restituisce un altro messaggio "Per installare la versione 20020200
del modulo 'xx' occorre il contratto di assistenza per l'anno 2002"
nonostante la schedina in questione è stata abilitata all'assistenza 2003
(infatti a seguito di questo riporta sulla schedina l'assistenza 2001).
Non si riesce pertanto ad installare i moduli, questo è dovuto al fatto
che nella cartella di Campo viene riportato anche il file dninst.zip
sul quale probabilmente c'era il numero di schedina che ho usato per
fare la prova (HARDLOCK 05714).
AO20052
Per provare a risolvere il problema della segnalazione precedente (AO20051)
si è provato a cancellare il file dninst.zip dalla cartella di Campo,
solo che una volta avviato Campo viene restituito il messaggio
"Impossibile trovare il file dninst.zip" seguito da un errore fatale su BA1;
in tutte le prove successive però si è notato che il file dninst.zip
veniva rigenerato ogni volta.
AO20054
Provato a fare un'installazione in rete utilizzando come server il PC usato
per l'installazione Standard con schedina EUTRON, come per l'installazione
standard prendendo dal server i programmi non ha riportato selezionati i
moduli attivi su questa seconda schedina, il problema è pertanto uguale a
quello della segnalazione AO20049 e AO20050.
ATTENZIONE: Segnalazione intrinsecamente superflua.
Quando la chiavetta non viene riconosciuta come valida,
e' MOLTO probabile che lo risulti su tutti i computer (server e non).
AO20055
Ho provato l'installazione in rete con programmi e dati sul server,
una volta finita non si riesce ad entrare in Campo perché sembra che invece
di fare riferimento al Campo.ini che ha in locale fa riferimento al Campo.ini
sul server.
AO20056
Ho provato a fare un'installazione di una postazione con server di chiavi,
non appena arriva all'installazione del server di chiavi restituisce
il messaggio: "Errore fatale! .\Si è verificato un errore copiando e
decomprimendo il file \", quindi l'installazione va in errore.
ATTENZIONE: Eliminato ogni riferimento a Frontend.exe.
D'ora in poi usare il server Authoriz.exe
AO20057
Ho provato a fare un'installazione di una postazione con Master Server,
l'installazione prosegue normalmente (fatte eccezione per le segnalazioni
precedenti) ma non crea il file Lerch.exe sotto la cartella Servers di Campo,
quindi quando cerca di avviare il programma dall'esecuzione automatica non
trova il file.
git-svn-id: svn://10.65.10.50/trunk@11214 c028cbd2-c16b-5b4b-a496-9718f37d4682
2003-06-05 13:39:12 +00:00
}
2007-10-08 10:58:53 +00:00
return type ;
Patch level : 2.0 490
Files correlati : ba1.exe
Ricompilazione Demo : [ ]
Commento :
AO20049
Utilizzando una schedina EUTRON una volta aperto l'installer di Campo non
vengono riportati automaticamente i moduli attivati su tale schedina.
AO20050
Una volta installato Campo con una schedina EUTRON e finita la conversione
(anche uscendo da Campo e riavviando il PC), per i moduli installati non
vengono abilitate le rispettive voci nei sottomenù (quindi ad es.
Contabilità Generale, Documenti di Vendita, ecc
)
ATTENZIONE: Ovvia conseguenza del AO20049
AO20051
Utilizzando una schedina HARDLOCK se vado su Installazione Moduli va
automaticamente su Attivazione Moduli e restituisce il messaggio
"Il contratto 2001 è stato attivato automaticamente", una volta dato
l'OK ritorna su Installazione Moduli e presenta l'elenco corretto dei
moduli da installare, solo che una volta lanciata l'installazione per ogni
modulo restituisce un altro messaggio "Per installare la versione 20020200
del modulo 'xx' occorre il contratto di assistenza per l'anno 2002"
nonostante la schedina in questione è stata abilitata all'assistenza 2003
(infatti a seguito di questo riporta sulla schedina l'assistenza 2001).
Non si riesce pertanto ad installare i moduli, questo è dovuto al fatto
che nella cartella di Campo viene riportato anche il file dninst.zip
sul quale probabilmente c'era il numero di schedina che ho usato per
fare la prova (HARDLOCK 05714).
AO20052
Per provare a risolvere il problema della segnalazione precedente (AO20051)
si è provato a cancellare il file dninst.zip dalla cartella di Campo,
solo che una volta avviato Campo viene restituito il messaggio
"Impossibile trovare il file dninst.zip" seguito da un errore fatale su BA1;
in tutte le prove successive però si è notato che il file dninst.zip
veniva rigenerato ogni volta.
AO20054
Provato a fare un'installazione in rete utilizzando come server il PC usato
per l'installazione Standard con schedina EUTRON, come per l'installazione
standard prendendo dal server i programmi non ha riportato selezionati i
moduli attivi su questa seconda schedina, il problema è pertanto uguale a
quello della segnalazione AO20049 e AO20050.
ATTENZIONE: Segnalazione intrinsecamente superflua.
Quando la chiavetta non viene riconosciuta come valida,
e' MOLTO probabile che lo risulti su tutti i computer (server e non).
AO20055
Ho provato l'installazione in rete con programmi e dati sul server,
una volta finita non si riesce ad entrare in Campo perché sembra che invece
di fare riferimento al Campo.ini che ha in locale fa riferimento al Campo.ini
sul server.
AO20056
Ho provato a fare un'installazione di una postazione con server di chiavi,
non appena arriva all'installazione del server di chiavi restituisce
il messaggio: "Errore fatale! .\Si è verificato un errore copiando e
decomprimendo il file \", quindi l'installazione va in errore.
ATTENZIONE: Eliminato ogni riferimento a Frontend.exe.
D'ora in poi usare il server Authoriz.exe
AO20057
Ho provato a fare un'installazione di una postazione con Master Server,
l'installazione prosegue normalmente (fatte eccezione per le segnalazioni
precedenti) ma non crea il file Lerch.exe sotto la cartella Servers di Campo,
quindi quando cerca di avviare il programma dall'esecuzione automatica non
trova il file.
git-svn-id: svn://10.65.10.50/trunk@11214 c028cbd2-c16b-5b4b-a496-9718f37d4682
2003-06-05 13:39:12 +00:00
}
1998-11-04 18:04:26 +00:00
int TInstaller_mask : : precheck_modules ( bool only_newer )
1998-01-22 11:56:14 +00:00
{
2010-02-22 12:19:38 +00:00
TString16 release , currrelease ;
2004-04-08 15:42:30 +00:00
TString4 cod_module ;
2010-02-22 12:19:38 +00:00
int patchlevel , modnumber , currpatch ;
2003-07-22 10:23:46 +00:00
2006-12-13 16:22:33 +00:00
bool check_enabled = true ;
2007-12-19 11:41:00 +00:00
_setup_run = false ; //inizializzazione del flag di controllo di lancio di setup.exe
2006-12-13 16:22:33 +00:00
2009-05-20 15:37:50 +00:00
TString_array & a = rows_array ( ) ;
FOR_EACH_ARRAY_ROW ( a , r , row )
1998-08-25 17:46:29 +00:00
{
2003-07-22 10:23:46 +00:00
TToken_string & rigar = * row ;
2004-04-08 15:42:30 +00:00
cod_module = rigar . get ( C_CODE ) ;
2003-03-14 14:54:28 +00:00
release = rigar . get ( C_RELEASE ) ;
patchlevel = rigar . get_int ( C_PATCH ) ;
currrelease = rigar . get ( C_CURRRELEASE ) ;
2003-07-22 10:23:46 +00:00
currpatch = rigar . get_int ( C_CURRPATCH ) ;
2004-04-08 15:42:30 +00:00
modnumber = get_module_number ( cod_module ) ;
2010-02-22 12:19:38 +00:00
if ( modnumber > = 0 & & should_precheck_module ( modnumber ) & & release . full ( ) & &
1998-11-04 18:04:26 +00:00
( ( release > currrelease ) | |
2007-12-19 11:41:00 +00:00
( release = = currrelease & & ( only_newer ? patchlevel > currpatch : patchlevel > = currpatch ) ) )
2004-03-05 08:59:03 +00:00
)
1998-08-25 17:46:29 +00:00
{
2008-12-03 11:12:51 +00:00
// spunta il modulo o la patch se ho installata la stessa versione
bool chk = rigar . get_char ( C_ISPATCH ) ! = ' X ' | | release = = currrelease ;
2009-04-21 15:26:43 +00:00
// non spunta automaticamente il modulo server su installazioni che non siano server
2010-02-22 12:19:38 +00:00
if ( cod_module = = " sr " & & test_station_type ( ) ! = 2 )
{
2008-12-03 11:12:51 +00:00
chk = false ;
2010-02-22 12:19:38 +00:00
disable_row ( r ) ;
}
2008-12-03 11:12:51 +00:00
2006-12-13 16:22:33 +00:00
if ( check_enabled )
check ( r , chk ) ;
2007-12-19 11:41:00 +00:00
2010-02-22 12:19:38 +00:00
if ( chk & & only_newer & & ( cod_module = = " sy " | | cod_module = = " sr " ) ) //se viene checkato il modulo sy (sistema) e/o sr (servers)deve togliere..
{ //..la possibilita' di installare altri moduli..
2009-05-20 15:37:50 +00:00
for ( int i = 0 ; i < a . items ( ) ; i + + )
2010-02-09 13:40:38 +00:00
{
2010-02-22 12:19:38 +00:00
if ( i ! = r )
uncheck ( i ) ; // puo' succedere che il modulo sy o sr non sia il primo
disable_row ( i ) ; // disabilita tutte le righe dello sheet (va fatto DOPO l'uncheck!!!)
2010-02-09 13:40:38 +00:00
}
2004-04-08 15:42:30 +00:00
disable ( DLG_USER ) ;
2006-12-13 16:22:33 +00:00
check_enabled = false ; //..ed uscire
2004-04-08 15:42:30 +00:00
}
2007-12-19 11:41:00 +00:00
} //if(modnumber>=0...
} //FOR_EACH_ARRAY_ROW...
force_update ( ) ; // Indispensabile per vedere le righe aggiornate sullo sheet
2003-07-22 10:23:46 +00:00
return items ( ) ;
1998-01-22 11:56:14 +00:00
}
1998-11-04 18:04:26 +00:00
2004-04-08 15:42:30 +00:00
int TInstaller_mask : : get_module_number ( const TString & module ) const
1998-11-04 18:04:26 +00:00
{
int aut = - 1 ;
2006-04-26 15:22:42 +00:00
bool ok = false ;
if ( module . full ( ) )
1998-11-04 18:04:26 +00:00
{
2004-04-08 15:42:30 +00:00
if ( module = = " ba " | | module = = " sy " ) //moduli base e sistema: deve ritornare 0;
return 0 ;
2006-12-13 16:22:33 +00:00
aut = dongle ( ) . module_name2code ( module ) ;
ok = aut < ENDAUT ;
1998-11-04 18:04:26 +00:00
}
return ok ? aut : - 1 ;
}
1997-10-30 15:13:59 +00:00
void TInstaller_mask : : update_version ( )
{
TInstall_ini ini ;
1998-08-25 17:46:29 +00:00
2008-10-22 08:18:26 +00:00
TString_array & a = rows_array ( ) ;
FOR_EACH_ARRAY_ROW_BACK ( a , m , row )
1998-08-25 17:46:29 +00:00
{
1998-02-18 13:46:52 +00:00
if ( * row - > get ( C_CODE ) ! = ' ' )
1998-02-09 12:06:44 +00:00
{
2009-02-23 11:40:41 +00:00
const TString4 module = row - > get ( C_CODE ) ;
1998-02-09 12:06:44 +00:00
ini . set_paragraph ( module ) ;
1998-08-25 17:46:29 +00:00
1998-02-18 13:46:52 +00:00
const TString16 newver = row - > get ( C_RELEASE ) ;
1998-02-09 12:06:44 +00:00
const TString16 oldver = ini . get ( " Versione " ) ;
2001-04-30 14:22:43 +00:00
const int numpatch = ini . get_int ( " Patch " ) ;
2009-02-23 11:40:41 +00:00
TString4 strpatch ;
if ( numpatch > 0 )
strpatch . format ( " %04d " , numpatch ) ;
1998-02-18 13:46:52 +00:00
row - > add ( oldver , C_CURRRELEASE ) ;
2001-04-30 14:22:43 +00:00
row - > add ( strpatch , C_CURRPATCH ) ;
1998-02-18 13:46:52 +00:00
row - > add ( ini . get ( " Data " ) , C_CURRDATAREL ) ;
1998-02-09 12:06:44 +00:00
}
1997-10-30 15:13:59 +00:00
}
1997-12-04 14:07:49 +00:00
force_update ( ) ;
1997-10-30 15:13:59 +00:00
}
// Cerca nel percorso specificato sulla maschera tutti i possibili files .ini
// utilizzabili per un'installazione e li inserisce nello spreadsheet
bool TInstaller_mask : : autoload ( )
1998-08-25 17:46:29 +00:00
{
1998-02-18 13:46:52 +00:00
TString_array & mask_rows = rows_array ( ) ;
1998-11-04 18:04:26 +00:00
1998-08-21 10:58:38 +00:00
TString http_server ;
2008-12-23 09:11:50 +00:00
TFilename http_path , path , ininame ;
1998-08-21 10:58:38 +00:00
2007-12-19 11:41:00 +00:00
//controla se si e' scelto un path di installazione internet o da disco
const bool internet = get_patches_path ( path ) ;
//se e' un aggiornamento via internet...
1998-08-21 10:58:38 +00:00
if ( internet )
{
2010-01-21 11:53:34 +00:00
if ( ! ( xvt_net_get_status ( ) & 0x4 ) ) //la connessione web funziona?...
return warning_box ( " Impossibile connettersi al sito con gli aggiornamenti \n Verificare che la connessione Internet sia attiva ! " ) ;
2007-12-19 11:41:00 +00:00
parse_internet_path ( http_server , http_path ) ; //controlla il path internet scritto nel campo sulla maschera
1998-11-04 18:04:26 +00:00
2008-12-23 09:11:50 +00:00
//se si ritrova dei vecchi file nella directory temporanea, la pulisce per evitare casini
ininame = path ; ininame . add ( " *.* " ) ;
TString_array list ;
2010-01-04 10:11:51 +00:00
const int cache_files = : : list_files ( ininame , list ) ;
if ( cache_files > 0 )
{
TProgind pi ( cache_files , TR ( " Azzeramento cache " ) , false , true ) ;
FOR_EACH_ARRAY_ROW ( list , i , row )
{
pi . addstatus ( 1 ) ;
xvt_fsys_remove_file ( * row ) ;
}
}
1998-08-21 10:58:38 +00:00
ininame = path ;
ininame . add ( TInstall_ini : : default_name ( ) ) ;
if ( ! ininame . exist ( ) )
{
TFilename remote_ini = http_path ;
2007-03-07 10:23:42 +00:00
remote_ini < < TInstall_ini : : default_name ( ) ;
2010-01-04 10:11:51 +00:00
if ( remote_ini . full ( ) ) // dummy test
1998-11-04 18:04:26 +00:00
{
2009-05-27 13:23:41 +00:00
TTimerind contacting ( 30 * 1000 , TR ( " Connessione al server HTTP... " ) , false , false ) ;
2007-12-19 11:41:00 +00:00
http_get ( http_server , remote_ini , ininame ) ;
2010-01-04 10:11:51 +00:00
// Cerca di prelevare anche dninst.zip
const char * const local_dninst = " setup/dninst.zip " ;
TFilename remote_dninst = http_path ;
remote_dninst < < local_dninst ;
if ( ! http_get ( http_server , remote_dninst , local_dninst ) )
{
// Se non aggiorno da release riprovo con l'indirizzo dell'OEM
remote_dninst = http_default_path ( ) ;
remote_dninst < < local_dninst ;
const int slash = remote_dninst . find ( ' / ' ) ;
if ( slash > 0 )
http_get ( remote_dninst . left ( slash ) , remote_dninst . mid ( slash ) , local_dninst ) ;
}
1998-11-04 18:04:26 +00:00
}
1998-08-21 10:58:38 +00:00
}
2007-12-19 11:41:00 +00:00
} //if(internet...
1998-11-04 18:04:26 +00:00
if ( path . exist ( ) )
1998-08-21 10:58:38 +00:00
{
ininame = path ;
ininame . add ( TInstall_ini : : default_name ( ) ) ;
}
else
2002-10-24 10:47:49 +00:00
return error_box ( TR ( " Specificare un percorso valido " ) ) ;
1997-10-30 15:13:59 +00:00
TWait_cursor hourglass ;
1997-12-04 14:07:49 +00:00
destroy ( ) ;
1998-08-25 17:46:29 +00:00
force_update ( ) ;
1997-10-30 15:13:59 +00:00
1998-08-25 17:46:29 +00:00
TString_array modules ;
2007-02-12 11:19:12 +00:00
//cerca sull'install.ini di origine se lo trova (ininame e' il path dell'install.ini remoto)
2001-06-25 10:41:20 +00:00
if ( ininame . exist ( ) )
1997-10-30 15:13:59 +00:00
{
2004-04-08 15:42:30 +00:00
// Presente il file ini generale "install.ini" (moduli;immagine cd)
1997-10-30 15:13:59 +00:00
TInstall_ini ini ( ininame ) ;
2004-04-08 15:42:30 +00:00
ini . list_paragraphs ( modules ) ; //riempie modules con la lista dei paragrafi sul .ini ***
2002-05-27 13:16:06 +00:00
1997-12-15 15:11:40 +00:00
FOR_EACH_ARRAY_ROW ( modules , i , row )
1997-10-30 15:13:59 +00:00
{
1997-11-06 15:05:42 +00:00
const TString & module = * row ;
1998-02-09 12:06:44 +00:00
if ( module [ 0 ] = = ' _ ' | | module . len ( ) = = 2 )
{
if ( module [ 0 ] = = ' _ ' )
2007-12-19 11:41:00 +00:00
add_header ( ini , module ) ;
1998-02-09 12:06:44 +00:00
else
2002-05-08 16:25:49 +00:00
{
TFilename mod_ini = ininame . path ( ) ;
mod_ini . add ( module ) ;
mod_ini < < " inst.ini " ;
2007-02-12 11:19:12 +00:00
//controlla se esiste il pacco zippato del modulo attraverso l'esistenza del file..
//..XXinst.ini
2002-05-08 16:25:49 +00:00
if ( mod_ini . exist ( ) )
{
TInstall_ini moduleini ( mod_ini ) ;
2006-08-01 13:41:55 +00:00
add_module ( moduleini , module , false ) ;
2002-05-08 16:25:49 +00:00
}
else
2006-08-01 13:41:55 +00:00
add_module ( ini , module , false ) ;
2002-05-08 16:25:49 +00:00
}
2007-12-19 11:41:00 +00:00
} //if(module[0]...
} //FOR_EACH_ARRAY_ROW(...
1997-10-30 15:13:59 +00:00
}
else
{
2004-04-08 15:42:30 +00:00
// Presenti i singoli file .ini dei moduli (pacchi ma non patches!)
1998-11-04 18:04:26 +00:00
ininame = path ;
1997-10-30 15:13:59 +00:00
ininame . add ( " ??inst.ini " ) ;
2004-04-08 15:42:30 +00:00
list_files ( ininame , modules ) ; //ritorna la lista dei files presenti nel .ini della patch ***
1997-12-15 15:11:40 +00:00
FOR_EACH_ARRAY_ROW ( modules , m , row )
1998-08-25 17:46:29 +00:00
{
1997-11-06 15:05:42 +00:00
TString & ininame = * row ;
1997-10-30 15:13:59 +00:00
ininame . lower ( ) ;
const int pos = ininame . find ( " inst.ini " ) ;
1998-01-22 11:56:14 +00:00
CHECKS ( pos > = 2 , " Invalid installation configuration: " , ( const char * ) ininame ) ;
2006-12-13 16:22:33 +00:00
const TString4 module = ininame . mid ( pos - 2 , 2 ) ;
1997-10-30 15:13:59 +00:00
TConfig ini ( ininame , module ) ;
2006-08-01 13:41:55 +00:00
add_module ( ini , module , false ) ;
1998-11-04 18:04:26 +00:00
}
1998-02-18 13:46:52 +00:00
}
1999-04-06 15:34:39 +00:00
1998-02-18 13:46:52 +00:00
modules . destroy ( ) ;
1998-11-04 18:04:26 +00:00
2004-04-08 15:42:30 +00:00
if ( internet ) //internet patches
1998-08-21 10:58:38 +00:00
{
2010-01-21 11:53:34 +00:00
TProgind pi ( 1 , TR ( " Controllo lista aggiornamenti " ) , false ) ; //progind NON bloccabile: causa errore impossibile!
2003-03-14 14:54:28 +00:00
http_dir ( http_server , http_path , modules ) ;
2010-01-21 11:53:34 +00:00
pi . setmax ( modules . items ( ) ) ;
pi . set_text ( TR ( " Download lista aggiornamenti " ) ) ;
2003-03-14 14:54:28 +00:00
for ( int i = modules . last ( ) ; i > = 0 ; i - - )
{
2010-01-21 11:53:34 +00:00
if ( ! pi . addstatus ( 1 ) )
break ;
2003-03-14 14:54:28 +00:00
TString & str = modules . row ( i ) ;
2010-01-21 11:53:34 +00:00
if ( str . match ( " ??????a.ini " , true ) )
2003-03-14 14:54:28 +00:00
{
TFilename remote = http_path ;
remote < < str ;
ininame = path ;
ininame . add ( str ) ;
if ( ! ininame . exist ( ) & & ! http_get ( http_server , remote , ininame ) )
{
error_box ( FR ( " Errore di trasferimento del file %s " ) , ( const char * ) remote ) ;
modules . destroy ( i ) ;
}
str = ininame ;
}
else
1998-11-04 18:04:26 +00:00
modules . destroy ( i ) ;
2003-03-14 14:54:28 +00:00
}
modules . pack ( ) ;
1998-08-21 10:58:38 +00:00
}
2004-04-08 15:42:30 +00:00
else //normal patches
1998-08-21 10:58:38 +00:00
{
1998-11-04 18:04:26 +00:00
ininame = path ;
2007-10-15 10:01:44 +00:00
ininame . add ( " ??????a.ini " ) ;
2004-04-08 15:42:30 +00:00
list_files ( ininame , modules ) ;
1998-08-21 10:58:38 +00:00
}
2004-04-08 15:42:30 +00:00
if ( modules . items ( ) > 0 ) //ordina i moduli come sull'install.ini locale (per avere SY come primo
{ //modulo e via via gli altri)
TInstall_ini installini ;
TString_array paragrafi ;
TFilename file ;
2007-02-12 11:19:12 +00:00
installini . list_paragraphs ( paragrafi ) ;
2009-01-12 16:52:14 +00:00
// rimozione del produttore sull'install.ini locale ora obsoleto..
installini . remove ( " Producer " ) ;
2007-09-17 15:33:04 +00:00
2004-04-08 15:42:30 +00:00
FOR_EACH_ARRAY_ROW ( modules , am , arow )
{
file = * arow ;
file = file . name ( ) ;
int pos = paragrafi . find ( file . left ( 2 ) ) ;
if ( pos < = 0 )
pos = 10000 + am ;
TString8 str ;
str . format ( " %05d " , pos ) ; //aggiunge un numero d'ordine sulla sinistra del nome del file..
arow - > insert ( str ) ;
}
modules . sort ( ) ; //..cosi' che la sort (che ordina alfabeticamente) sistemi la lista moduli
1998-08-21 10:58:38 +00:00
2004-04-08 15:42:30 +00:00
FOR_EACH_ARRAY_ROW ( modules , bm , brow ) //rimette i nomi dei moduli a posto (toglie il numero d'ordine)
brow - > ltrim ( 5 ) ;
}
//genera le righe dello sheet di installazione
1998-02-18 13:46:52 +00:00
FOR_EACH_ARRAY_ROW ( modules , am , arow )
1998-08-25 17:46:29 +00:00
{
1998-02-18 13:46:52 +00:00
TString & ininame = * arow ;
ininame . lower ( ) ;
const int pos = ininame . find ( " a.ini " ) ;
2004-05-04 11:44:23 +00:00
CHECKS ( pos > = 6 , TR ( " Configurazione di installazione non valida: " ) , ( const char * ) ininame ) ;
2009-02-23 11:40:41 +00:00
const TString4 module = ininame . mid ( pos - 6 , 2 ) ;
2004-05-04 11:44:23 +00:00
TConfig ini ( ininame , module ) ;
1998-08-25 17:46:29 +00:00
ini . write_protect ( ) ;
2006-12-29 14:16:28 +00:00
int r ;
2009-05-27 13:23:41 +00:00
for ( r = int ( items ( ) - 1 ) ; r > = 0 ; r - - )
{
2001-06-25 10:41:20 +00:00
if ( module = = row ( r ) . get ( C_CODE ) )
break ;
2009-05-27 13:23:41 +00:00
}
2001-06-25 10:41:20 +00:00
if ( r > = 0 )
1998-02-18 13:46:52 +00:00
{
2009-05-27 13:23:41 +00:00
if ( is_visible_patch ( ini ) )
{
const TString16 patchversion = ini . get ( " Versione " ) ;
const int patchlevel = ini . get_int ( " Patch " ) ;
TToken_string & row = mask_rows . row ( r ) ;
const TString16 release ( row . get ( C_RELEASE ) ) ;
if ( patchversion . mid ( 4 ) = = release . mid ( 4 ) // se le versioni corrispondono ...
& & patchlevel > row . get_int ( C_PATCH ) ) // ..e il patchlevel <20> superiore
{
TString4 patch ; patch . format ( " %04d " , patchlevel ) ; //aggiunge zeri per avere 3 cifre sempre
row . add ( patch , C_PATCH ) ; // aggiorna il patchlevel mostrato per il modulo
row . add ( ini . get ( " Data " ) , C_DATAREL ) ; // aggiorna data di rilascio
if ( row . get_char ( C_ISPATCH ) < = ' ' ) // se era un modulo ...
{
row . add ( " + " , C_ISPATCH ) ; // .....setta la presenza di patches
row . add ( row . get ( C_PATCH ) , C_BASEPATCH ) ; // memorizza patch del modulo
}
if ( release < patchversion )
row . add ( patchversion , C_RELEASE ) ;
2003-03-14 14:54:28 +00:00
}
1998-04-30 14:38:35 +00:00
}
2009-05-27 13:23:41 +00:00
else
destroy ( r ) ; // Elimina patch di altri OEM erroneamente inserite
2001-06-25 10:41:20 +00:00
}
else
2006-08-01 13:41:55 +00:00
add_module ( ini , module , true ) ;
1997-10-30 15:13:59 +00:00
}
1998-11-04 18:04:26 +00:00
update_version ( ) ;
const bool ok = precheck_modules ( ) > 0 ;
if ( ! ok )
2002-10-24 10:47:49 +00:00
error_box ( FR ( " Non e' stato trovato nessun modulo da installare \n in %s " ) , ( const char * ) path ) ;
1998-08-21 10:58:38 +00:00
1997-10-30 15:13:59 +00:00
return ok ;
}
1997-12-15 15:11:40 +00:00
bool TInstaller_mask : : do_process ( TToken_string & commands ) const
1998-08-25 17:46:29 +00:00
{
2006-08-01 13:41:55 +00:00
bool ok = true ;
1997-10-30 15:13:59 +00:00
TFilename cmd ;
for ( const char * c = commands . get ( 0 ) ; c & & ok ; c = commands . get ( ) )
{
cmd = c ;
2009-05-27 13:23:41 +00:00
if ( cmd . full ( ) )
1997-10-30 15:13:59 +00:00
{
TWait_cursor hourglass ;
TExternal_app app ( cmd ) ;
2006-08-01 13:41:55 +00:00
ok = app . run ( false , 3 , true ) = = 0 ;
1997-10-30 15:13:59 +00:00
}
}
return ok ;
}
bool TInstaller_mask : : pre_process ( TInstall_ini & ini , const char * module ) const
1998-08-25 17:46:29 +00:00
{
1997-12-17 13:40:59 +00:00
TAuto_token_string commands ( ini . get ( " PreProcess " , module ) ) ;
bool ok = do_process ( commands ) ;
1997-11-06 10:05:56 +00:00
return ok ;
1997-10-30 15:13:59 +00:00
}
bool TInstaller_mask : : post_process ( TInstall_ini & ini , const char * module ) const
{
TAuto_token_string commands ( ini . get ( " PostProcess " , module ) ) ;
return do_process ( commands ) ;
}
1997-12-15 15:11:40 +00:00
bool TInstaller_mask : : can_install ( const char * module , TInstall_ini & ini )
{
2009-05-27 13:23:41 +00:00
ini . set_paragraph ( module ) ;
if ( ! is_visible_patch ( ini ) )
return false ;
1997-12-15 15:11:40 +00:00
const TString & version = ini . version ( module ) ;
1997-12-17 13:40:59 +00:00
const word year = version2year ( version ) ;
2010-03-08 15:32:26 +00:00
if ( year < 2091 )
2002-10-24 10:47:49 +00:00
return error_box ( FR ( " Il modulo '%s' non ha una versione valida. " ) , module ) ;
1998-08-25 17:46:29 +00:00
2010-03-08 15:32:26 +00:00
if ( ! dongle ( ) . demo ( ) & & year > dongle ( ) . year_assist ( ) ) //devo aggiornare l'anno di assistenza?
2006-12-13 16:22:33 +00:00
{
2010-03-08 15:32:26 +00:00
if ( ! update_assistance_year ( ) ) //sono riuscito ad aggiornare l'anno di assistenza?
2006-12-13 16:22:33 +00:00
return false ;
}
1998-08-25 17:46:29 +00:00
1997-12-15 15:11:40 +00:00
TAuto_token_string altri ( ini . get ( " Moduli " , module ) ) ;
2007-04-10 09:19:15 +00:00
if ( xvt_str_compare_ignoring_case ( module , " sy " ) ! = 0 ) //SY e' indipendente dagli altri moduli
2004-05-07 10:32:02 +00:00
{
2007-04-10 09:19:15 +00:00
if ( xvt_str_compare_ignoring_case ( module , " ba " ) ! = 0 & & altri . get_pos ( " ba " ) < 0 )
2004-05-07 10:32:02 +00:00
altri . add ( " ba " ) ;
}
1998-08-25 17:46:29 +00:00
2006-08-01 13:41:55 +00:00
bool ok = true ;
1997-12-15 15:11:40 +00:00
TString submodule ;
2010-03-08 15:32:26 +00:00
TInstall_ini curini ;
1997-12-15 15:11:40 +00:00
for ( const char * mod = altri . get ( 0 ) ; mod & & ok ; mod = altri . get ( ) )
{
submodule = mod ;
if ( submodule . len ( ) = = 2 )
{
if ( curini . get ( " Versione " , submodule ) . empty ( ) )
1998-08-25 17:46:29 +00:00
{
1997-12-15 15:11:40 +00:00
TString msg ;
Patch level : 2.0 490
Files correlati : ba1.exe
Ricompilazione Demo : [ ]
Commento :
AO20049
Utilizzando una schedina EUTRON una volta aperto l'installer di Campo non
vengono riportati automaticamente i moduli attivati su tale schedina.
AO20050
Una volta installato Campo con una schedina EUTRON e finita la conversione
(anche uscendo da Campo e riavviando il PC), per i moduli installati non
vengono abilitate le rispettive voci nei sottomenù (quindi ad es.
Contabilità Generale, Documenti di Vendita, ecc
)
ATTENZIONE: Ovvia conseguenza del AO20049
AO20051
Utilizzando una schedina HARDLOCK se vado su Installazione Moduli va
automaticamente su Attivazione Moduli e restituisce il messaggio
"Il contratto 2001 è stato attivato automaticamente", una volta dato
l'OK ritorna su Installazione Moduli e presenta l'elenco corretto dei
moduli da installare, solo che una volta lanciata l'installazione per ogni
modulo restituisce un altro messaggio "Per installare la versione 20020200
del modulo 'xx' occorre il contratto di assistenza per l'anno 2002"
nonostante la schedina in questione è stata abilitata all'assistenza 2003
(infatti a seguito di questo riporta sulla schedina l'assistenza 2001).
Non si riesce pertanto ad installare i moduli, questo è dovuto al fatto
che nella cartella di Campo viene riportato anche il file dninst.zip
sul quale probabilmente c'era il numero di schedina che ho usato per
fare la prova (HARDLOCK 05714).
AO20052
Per provare a risolvere il problema della segnalazione precedente (AO20051)
si è provato a cancellare il file dninst.zip dalla cartella di Campo,
solo che una volta avviato Campo viene restituito il messaggio
"Impossibile trovare il file dninst.zip" seguito da un errore fatale su BA1;
in tutte le prove successive però si è notato che il file dninst.zip
veniva rigenerato ogni volta.
AO20054
Provato a fare un'installazione in rete utilizzando come server il PC usato
per l'installazione Standard con schedina EUTRON, come per l'installazione
standard prendendo dal server i programmi non ha riportato selezionati i
moduli attivi su questa seconda schedina, il problema è pertanto uguale a
quello della segnalazione AO20049 e AO20050.
ATTENZIONE: Segnalazione intrinsecamente superflua.
Quando la chiavetta non viene riconosciuta come valida,
e' MOLTO probabile che lo risulti su tutti i computer (server e non).
AO20055
Ho provato l'installazione in rete con programmi e dati sul server,
una volta finita non si riesce ad entrare in Campo perché sembra che invece
di fare riferimento al Campo.ini che ha in locale fa riferimento al Campo.ini
sul server.
AO20056
Ho provato a fare un'installazione di una postazione con server di chiavi,
non appena arriva all'installazione del server di chiavi restituisce
il messaggio: "Errore fatale! .\Si è verificato un errore copiando e
decomprimendo il file \", quindi l'installazione va in errore.
ATTENZIONE: Eliminato ogni riferimento a Frontend.exe.
D'ora in poi usare il server Authoriz.exe
AO20057
Ho provato a fare un'installazione di una postazione con Master Server,
l'installazione prosegue normalmente (fatte eccezione per le segnalazioni
precedenti) ma non crea il file Lerch.exe sotto la cartella Servers di Campo,
quindi quando cerca di avviare il programma dall'esecuzione automatica non
trova il file.
git-svn-id: svn://10.65.10.50/trunk@11214 c028cbd2-c16b-5b4b-a496-9718f37d4682
2003-06-05 13:39:12 +00:00
msg . format ( FR ( " L'installazione del modulo %s richiede la presenza del modulo %s. " ) ,
( const char * ) module , ( const char * ) submodule ) ;
msg < < ' \n ' < < TR ( " Si desidera procedere alla sua installazione? " ) ;
1998-08-25 17:46:29 +00:00
ok = yesno_box ( msg ) ;
1997-12-15 15:11:40 +00:00
if ( ok )
1998-01-22 11:56:14 +00:00
ok = install ( submodule , 0 ) ;
1997-12-15 15:11:40 +00:00
}
1998-08-25 17:46:29 +00:00
}
}
return ok ;
1997-12-15 15:11:40 +00:00
}
2003-05-29 07:57:20 +00:00
int TInstaller_mask : : needs_reboot ( const TFilename & file ) const
2003-05-26 13:00:26 +00:00
{
char fname [ _MAX_FNAME ] , ext [ _MAX_EXT ] ;
xvt_fsys_parse_pathname ( file , NULL , NULL , fname , ext , NULL ) ;
int underscore = NONE ;
2003-06-03 14:39:38 +00:00
if ( xvt_str_compare_ignoring_case ( ext , " exe " ) = = 0 )
2003-05-26 13:00:26 +00:00
{
if ( xvt_str_compare_ignoring_case ( fname , " ba0 " ) = = 0 )
underscore = NEW_MENUPRG ; else
if ( xvt_str_compare_ignoring_case ( fname , " ba1 " ) = = 0 )
underscore = NEW_INSTALLER ;
2003-05-29 07:57:20 +00:00
} else
2003-06-03 14:39:38 +00:00
if ( xvt_str_compare_ignoring_case ( ext , " dll " ) = = 0 )
2003-05-29 07:57:20 +00:00
underscore = NEW_DLL ; else
2003-06-03 14:39:38 +00:00
if ( xvt_str_compare_ignoring_case ( ext , " men " ) = = 0 )
2006-12-13 16:22:33 +00:00
underscore = NEW_MENU ; else
if ( xvt_str_compare_ignoring_case ( ext , " trr " ) = = 0 | | xvt_str_compare_ignoring_case ( ext , " dir " ) = = 0 )
underscore = NEW_TRR ;
2003-05-26 13:00:26 +00:00
return underscore ;
}
2007-10-04 15:20:11 +00:00
// Controlla se un file puo' essere scompattato.
// Attenzione: dninst.zip e' un falso zip
2003-10-03 08:12:08 +00:00
bool TInstaller_mask : : is_zip_file ( const TFilename & n ) const
{
2007-02-01 11:41:41 +00:00
bool yes = xvt_str_compare_ignoring_case ( n . ext ( ) , " zip " ) = = 0 & &
2009-05-22 09:34:50 +00:00
xvt_str_compare_ignoring_case ( n . name_only ( ) , " dninst " ) ! = 0 ;
2009-06-08 15:06:41 +00:00
return yes ;
2003-10-03 08:12:08 +00:00
}
2003-05-26 13:00:26 +00:00
2009-06-08 15:06:41 +00:00
bool TInstaller_mask : : copy_file ( const TFilename & src , const TFilename & dst ) const
2003-10-24 07:45:38 +00:00
{
2009-06-15 09:48:20 +00:00
// Crea la cartella di destinazione se necessario
const char * dstdir = dst . path ( ) ;
if ( * dstdir & & ! xvt_fsys_mkdir ( dstdir ) )
return error_box ( FR ( " Impossibile creare la cartella %s " ) , dst . path ( ) ) ;
// Copia veramente il file
return : : fcopy ( src , dst ) ;
2003-10-24 07:45:38 +00:00
}
1998-01-29 13:42:30 +00:00
// sposta il file dal direttorio temporaneo a quello passato come destinazione
2003-06-11 14:19:56 +00:00
bool TInstaller_mask : : move_file ( const TFilename & src , const TFilename & dst ) const
1997-12-15 15:11:40 +00:00
{
2003-06-11 14:19:56 +00:00
TFilename dest = dst ;
const int reboot = needs_reboot ( dest ) ;
2006-12-13 16:22:33 +00:00
if ( ( reboot & NEW_SYS ) ! = 0 & & dst . exist ( ) )
2003-06-11 14:19:56 +00:00
{
dest . rtrim ( 1 ) ;
dest < < ' _ ' ;
}
2003-10-03 08:12:08 +00:00
const bool is_zip = is_zip_file ( src ) ;
const long filesize = fsize ( src ) * ( is_zip ? 4 : 1 ) ;
2002-12-20 16:15:03 +00:00
2007-12-19 11:41:00 +00:00
if ( xvt_fsys_test_disk_free_space ( dest . path ( ) , filesize ) = = 0 )
return error_box ( TR ( " Lo spazio disponibile e' insufficiente! " ) ) ;
1997-12-15 15:11:40 +00:00
2009-06-08 15:06:41 +00:00
const bool write_ok = copy_file ( src , dest ) ;
2003-10-20 10:59:37 +00:00
if ( write_ok & & is_zip )
aga_unzip ( src , dest . path ( ) ) ;
2003-10-03 08:12:08 +00:00
if ( write_ok )
2009-05-05 13:13:30 +00:00
src . fremove ( ) ;
1998-08-25 17:46:29 +00:00
2003-05-26 13:00:26 +00:00
if ( write_ok )
{
2003-05-29 07:57:20 +00:00
( int & ) _reboot_program | = reboot ; // Skip const!
2003-05-26 13:00:26 +00:00
}
1997-12-15 15:11:40 +00:00
return write_ok ;
}
bool TInstaller_mask : : move_module ( const TString & module , TInstall_ini & ini , bool update ) const
1998-08-25 17:46:29 +00:00
{
2006-08-01 13:41:55 +00:00
bool ok = true ;
1998-08-25 17:46:29 +00:00
2003-10-03 08:12:08 +00:00
TFilename tempdir ; tempdir . tempdir ( ) ;
2003-06-11 14:19:56 +00:00
const TString & destdir = get ( F_CURPATH ) ;
1998-11-04 18:04:26 +00:00
1997-12-15 15:11:40 +00:00
TString_array list ;
ini . build_list ( module , list ) ;
FOR_EACH_ARRAY_ROW ( list , f , file )
{
2003-10-03 08:12:08 +00:00
TFilename src = tempdir ;
1997-12-15 15:11:40 +00:00
src . add ( file - > get ( 0 ) ) ;
if ( update )
{
2003-10-03 08:12:08 +00:00
TFilename dst = destdir ;
2003-06-11 14:19:56 +00:00
dst . add ( file - > get ( 0 ) ) ;
2003-05-26 13:00:26 +00:00
const bool move_ok = move_file ( src , dst ) ;
1997-12-15 15:11:40 +00:00
if ( ! move_ok )
2006-08-01 13:41:55 +00:00
ok = update = false ;
1997-12-15 15:11:40 +00:00
}
1998-08-25 17:46:29 +00:00
if ( ! update )
2009-05-27 13:23:41 +00:00
src . fremove ( ) ;
1997-12-15 15:11:40 +00:00
}
2002-12-20 16:15:03 +00:00
1997-12-15 15:11:40 +00:00
return ok ;
}
2007-10-04 15:20:11 +00:00
bool TInstaller_mask : : copy_tree ( const char * src_study , const char * dst_study ) const
{
xvt_fsys_save_dir ( ) ;
TFilename mask ( src_study ) ; mask . add ( " *. " ) ;
SLIST dlist = xvt_fsys_list_files ( DIR_TYPE , mask , TRUE ) ;
xvt_fsys_restore_dir ( ) ;
TProgind pd ( xvt_slist_count ( dlist ) , TR ( " Copia cartelle " ) , true , true ) ;
TString msg ; // Messaggio di progresso
bool go_on = true ;
for ( SLIST_ELT d = xvt_slist_get_first ( dlist ) ; d & & go_on ; d = xvt_slist_get_next ( dlist , d ) )
{
if ( ! pd . addstatus ( 1 ) )
{
go_on = false ;
break ;
}
const TFilename dir = xvt_slist_get ( dlist , d , NULL ) ;
TString name = dir . name ( ) ; name . lower ( ) ;
2009-05-22 09:34:50 +00:00
if ( name = = " cesp " ) // Ignora la vetusta cartella Cespiti in FoxPro
2007-10-04 15:20:11 +00:00
continue ;
msg . cut ( 0 ) < < TR ( " Copia di " ) < < name ;
pd . set_text ( msg ) ;
mask = dir ; mask . add ( " *.* " ) ;
TString_array files ; list_files ( mask , files ) ;
TProgind pi ( files . items ( ) , " Copia file " , true , true ) ;
TFilename dst ;
FOR_EACH_ARRAY_ROW ( files , i , f )
{
if ( ! pi . addstatus ( 1 ) )
{
go_on = false ;
break ;
}
TFilename src ( * f ) ;
TString16 ext ( src . ext ( ) ) ; ext . lower ( ) ;
if ( ext ! = " zip " & & ext ! = " rar " & & ext ! = " mdb " & & ext ! = " inf " )
{
msg . cut ( 0 ) < < TR ( " Copia di " ) < < src ;
pi . set_text ( msg ) ;
dst = dst_study ;
dst . add ( name ) ;
dst . add ( src . name ( ) ) ;
2009-06-08 15:06:41 +00:00
copy_file ( src , dst ) ;
2007-10-04 15:20:11 +00:00
}
}
}
xvt_slist_destroy ( dlist ) ;
return go_on ;
}
void TInstaller_mask : : backup ( ) const
{
TFilename src = firm2dir ( - 1 ) ;
if ( ! isalnum ( src . right ( 1 ) [ 0 ] ) )
src . rtrim ( 1 ) ;
TFilename dst ( src ) ;
dst < < ' ' < < TDate ( TODAY ) . date2ansi ( ) ; // Lo spazio rende inutilizzabile lo studio
TToken_string msg ( 256 , ' \n ' ) ;
msg . add ( TR ( " Si consiglia creare una copia dello studio " ) ) ; msg < < src . name ( ) ;
msg . add ( TR ( " nella cartella " ) ) ; msg < < dst ;
msg . add ( TR ( " L'operazione potrebbe richiedere alcuni minuti. " ) ) ;
msg . add ( " " ) ;
msg . add ( TR ( " Si desidera effetture la copia? " ) ) ;
if ( yesno_box ( msg ) )
copy_tree ( src , dst ) ;
}
1998-08-25 17:46:29 +00:00
KEY TInstaller_mask : : askdisk ( TString & path , TFilename & cmdline , int d , int dischi , const char * modulo )
{
2003-05-29 07:57:20 +00:00
TMask retry_mask ( TR ( " Inserimento disco " ) , 1 , 80 , 10 ) ;
1998-08-25 17:46:29 +00:00
retry_mask . add_static ( ( F_PATH = = 101 ? 102 : 101 ) , 0 ,
2007-10-04 15:20:11 +00:00
format ( FR ( " Inserire il disco %d di %d del modulo '%s' nell'unit<69> " ) , d , dischi , modulo )
1998-08-25 17:46:29 +00:00
, 2 , 2 ) ;
2002-10-24 10:47:49 +00:00
retry_mask . add_static ( F_PATH + 3 , 0 , TR ( " oppure indicare un percorso diverso " ) , 2 , 3 ) ;
1998-08-25 17:46:29 +00:00
retry_mask . add_string ( F_PATH , 0 , " " , 2 , 5 , 48 ) ;
2002-10-24 10:47:49 +00:00
retry_mask . add_button ( DLG_OK , 0 , TR ( " Riprova " ) , - 12 , 7 , 9 , 2 ) ;
1998-08-25 17:46:29 +00:00
retry_mask . add_button ( DLG_QUIT , 0 , " " , - 22 , 7 , 9 , 2 ) ;
retry_mask . set ( F_PATH , path ) ;
KEY k ;
do {
if ( ( k = retry_mask . run ( ) ) = = K_QUIT )
break ;
if ( ! retry_mask . get ( F_PATH ) . blank ( ) )
{
if ( fexist ( retry_mask . get ( F_PATH ) ) )
{
TString16 tmpname ( cmdline . name ( ) ) ;
cmdline = path = retry_mask . get ( F_PATH ) ;
cmdline . add ( tmpname ) ;
break ;
}
else
2002-10-24 10:47:49 +00:00
error_box ( TR ( " Il percorso indicato non e' valido " ) ) ;
1998-08-25 17:46:29 +00:00
}
2006-08-01 13:41:55 +00:00
} while ( true ) ;
1998-08-25 17:46:29 +00:00
return k ;
}
2009-02-20 14:02:37 +00:00
//rimozione da disco dei files da eliminare indicati nei paragrafi kill..
//..e successivo aggiornamento dell'install.ini in modo da non avere pi<70> tra i piedi i files killati
void TInstaller_mask : : kill_files ( )
{
//apre l'install.ini locale per effettuare l'aggiornamento
TInstall_ini ini ;
//giro su tutti i sottomoduli di tipo 99 con l'elenco dei files da uccidere
TString_array paragraph_names ;
ini . list_paragraphs ( paragraph_names ) ;
FOR_EACH_ARRAY_ROW ( paragraph_names , nriga , riga )
{
//interessano solo i paragrafi con le killer list
if ( riga - > ends_with ( " 99 " ) & & ini . set_paragraph ( * riga ) )
{
TString_array killed ;
TToken_string rigaini ;
TFilename filetokill ;
for ( int k = 0 ; ; k + + )
{
rigaini = ini . get ( " Kill " , NULL , k , " " ) ;
if ( rigaini . empty ( ) )
break ;
filetokill = rigaini . get ( 0 ) ;
if ( filetokill . find ( ' * ' ) > = 0 | | filetokill . find ( ' ? ' ) > = 0 )
{
TString_array filelist ;
list_files ( filetokill , filelist ) ;
FOR_EACH_ARRAY_ROW ( filelist , r , file )
{
2009-05-27 13:23:41 +00:00
filetokill = * file ;
if ( filetokill . exist ( ) )
filetokill . fremove ( ) ;
killed . add ( filetokill ) ;
2009-02-20 14:02:37 +00:00
}
}
else
{
2009-05-27 13:23:41 +00:00
if ( filetokill . exist ( ) )
filetokill . fremove ( ) ;
2009-02-20 14:02:37 +00:00
killed . add ( filetokill ) ;
}
} //for(int k=0...
for ( int s = 0 ; s < = 9 & & ! killed . empty ( ) ; s + + )
{
const TString4 mod = riga - > left ( 2 ) ;
const int cicli = mod = = " ba " ? 2 : 1 ;
for ( int c = 1 ; c < = cicli ; c + + )
{
TString4 module = c = = 1 ? mod : " sy " ;
module < < s ;
TAssoc_array & vars = ini . list_variables ( module ) ;
FOR_EACH_ASSOC_STRING ( vars , hobj , key , str )
{
const int idx = killed . find ( str ) ;
if ( idx > = 0 )
{
ini . remove ( key ) ;
killed . destroy ( idx , true ) ;
}
}
}
} //for (int s...
} //if (riga->ends_with...
} //FOR_EACH_ARRAY_ROW(...
}
1998-01-23 14:55:34 +00:00
bool TInstaller_mask : : install ( const TString & module , int patchlevel )
1998-11-04 18:04:26 +00:00
{
2007-12-19 11:41:00 +00:00
bool cancelled = false ;
2006-08-01 13:41:55 +00:00
bool ok = false ;
1998-11-04 18:04:26 +00:00
TString msg ; // stringa per i messaggi
1998-04-30 14:38:35 +00:00
TString16 lastrelease ; // release che sto installando
2009-02-20 14:02:37 +00:00
int lastpatch = patchlevel ; // patchlevel che sto installando
1998-04-30 14:38:35 +00:00
1998-11-04 18:04:26 +00:00
TFilename path ;
1998-08-21 10:58:38 +00:00
TString http_server ;
TFilename http_path ;
1998-11-04 18:04:26 +00:00
2007-12-19 11:41:00 +00:00
const bool internet = get_patches_path ( path ) ;
1998-08-21 10:58:38 +00:00
if ( internet )
1998-11-04 18:04:26 +00:00
parse_internet_path ( http_server , http_path ) ;
1998-08-21 10:58:38 +00:00
2007-12-19 11:41:00 +00:00
const bool is_a_patch = ( patchlevel > 0 ) ;
2009-02-20 14:02:37 +00:00
//file .ini con le info di installazione (es. bainst.ini o ba0883.ini)
TFilename remote_ininame = path ;
remote_ininame . add ( module ) ;
1998-08-25 17:46:29 +00:00
2009-02-20 14:02:37 +00:00
//completa il nome del file .ini controllando se <20> una patch (es. ba0883a.ini) o se <20> un pacco (es. bainst.ini)
1998-08-25 17:46:29 +00:00
if ( is_a_patch )
1998-01-22 11:56:14 +00:00
{
1998-08-25 17:46:29 +00:00
TString16 name ;
1998-01-23 14:55:34 +00:00
name . format ( " %04da.ini " , patchlevel ) ;
2009-02-20 14:02:37 +00:00
remote_ininame < < name ;
1998-01-22 11:56:14 +00:00
}
else
2009-02-20 14:02:37 +00:00
remote_ininame < < " inst.ini " ;
1998-08-21 10:58:38 +00:00
2009-02-20 14:02:37 +00:00
if ( internet & & ! remote_ininame . exist ( ) )
1998-08-21 10:58:38 +00:00
{
2009-02-20 14:02:37 +00:00
TFilename remote = remote_ininame . name ( ) ;
1998-08-21 10:58:38 +00:00
remote . insert ( http_path , 0 ) ;
2009-02-20 14:02:37 +00:00
http_get ( http_server , remote , remote_ininame ) ;
1998-08-21 10:58:38 +00:00
}
1998-11-04 18:04:26 +00:00
2009-02-20 14:02:37 +00:00
if ( remote_ininame . exist ( ) )
1997-10-30 15:13:59 +00:00
{
1998-11-04 18:04:26 +00:00
// esiste un particolare .ini con formato XXinst.ini (moduli) o con XX9999a.ini (patch)
2009-02-20 14:02:37 +00:00
//----------------------------------------------
// (INSTALLAZIONE DA DIRECTORY CON FILES .ZIP)
//----------------------------------------------
//remote_ini <20> il file .ini con le info di installazione (es. ba0883a.ini, bainst.ini)
TInstall_ini * remote_ini = new TInstall_ini ( remote_ininame ) ;
remote_ini - > write_protect ( ) ;
lastpatch = remote_ini - > get_int ( " Patch " , module ) ;
lastrelease = remote_ini - > get ( " Versione " , module ) ;
//se non pu<70> installare il modulo chiude il remote_ini
if ( ! can_install ( module , * remote_ini ) )
1998-08-25 17:46:29 +00:00
{
2009-02-20 14:02:37 +00:00
delete remote_ini ;
2006-08-01 13:41:55 +00:00
return false ;
1998-08-25 17:46:29 +00:00
}
2009-02-20 14:02:37 +00:00
//antico controllo del numero di dischetti (ora sempre = 1)
const int dischi = remote_ini - > get_int ( " Dischi " , module ) ;
1997-10-30 15:13:59 +00:00
ok = dischi > 0 ;
1997-11-06 10:05:56 +00:00
if ( ! ok )
2009-02-20 14:02:37 +00:00
return error_box ( FR ( " Impossibile determinare il numero dei dischetti in %s " ) , remote_ininame . name ( ) ) ;
1997-11-06 10:05:56 +00:00
else
{
2009-02-20 14:02:37 +00:00
if ( patchlevel = = 0 )
ok = pre_process ( * remote_ini , module ) ;
1998-08-25 17:46:29 +00:00
if ( ! ok )
{
2009-02-20 14:02:37 +00:00
delete remote_ini ;
2006-08-01 13:41:55 +00:00
return false ;
1998-08-25 17:46:29 +00:00
}
1997-11-06 10:05:56 +00:00
}
2009-02-20 14:02:37 +00:00
// DECOMPRESSIONE
// ----------------
// viene decompresso il file .zip collegato al file remote_ini (es. ba0883a1.zip, bainst.zip)
2009-04-21 14:55:13 +00:00
TProgind * pi = NULL ;
if ( dischi > 1 )
{
msg = TR ( " Decompressione " ) ;
if ( is_a_patch )
msg < < TR ( " della patch " ) < < patchlevel ;
msg < < TR ( " del modulo ' " ) < < module < < TR ( " ' in corso... " ) ;
pi = new TProgind ( dischi , msg , false , true ) ;
}
2009-02-20 14:02:37 +00:00
TFilename tempdir ;
tempdir . tempdir ( ) ;
2002-07-03 14:48:48 +00:00
// File tottale dei vari sotto-zip
2009-02-20 14:02:37 +00:00
TFilename totti = tempdir ;
totti . add ( module ) ;
totti . ext ( " zip " ) ;
2002-07-03 14:48:48 +00:00
2009-02-20 14:02:37 +00:00
//si costruisce il nome dello zip
1997-10-30 15:13:59 +00:00
for ( int d = 1 ; d < = dischi & & ok ; d + + )
{
2002-07-03 14:48:48 +00:00
TFilename chunk = path ;
chunk . add ( module ) ;
1998-01-23 14:55:34 +00:00
if ( patchlevel > 0 )
{
2009-02-23 11:40:41 +00:00
TString8 name ;
1998-01-23 14:55:34 +00:00
name . format ( " %04da " , patchlevel ) ;
2002-07-03 14:48:48 +00:00
chunk < < name ;
1998-01-23 14:55:34 +00:00
}
else
2002-07-03 14:48:48 +00:00
chunk < < " inst " ;
chunk < < d < < " .zip " ;
1998-08-21 10:58:38 +00:00
2002-07-03 14:48:48 +00:00
if ( internet & & ! chunk . exist ( ) )
1998-08-21 10:58:38 +00:00
{
2002-07-03 14:48:48 +00:00
TFilename remote = chunk . name ( ) ;
1998-08-21 10:58:38 +00:00
remote . insert ( http_path , 0 ) ;
2002-07-03 14:48:48 +00:00
if ( ! http_get ( http_server , remote , chunk ) )
2002-10-24 10:47:49 +00:00
error_box ( FR ( " Errore di trasferimento del file '%s' " ) , ( const char * ) remote ) ;
1998-08-21 10:58:38 +00:00
}
1998-08-25 17:46:29 +00:00
2009-02-20 14:02:37 +00:00
//antichi controlli in caso di multidischetto
2002-07-03 14:48:48 +00:00
ok = chunk . exist ( ) ;
if ( ! ok & & ! internet ) // Chiedi cambio disco (solo se non sta scaricando da internet)
1997-10-30 15:13:59 +00:00
{
2002-05-27 13:16:06 +00:00
while ( ! ok )
{
2009-02-20 14:02:37 +00:00
if ( askdisk ( path , chunk , d , dischi , ( const char * ) remote_ini - > get ( " Descrizione " ) ) = = K_QUIT )
2002-05-27 13:16:06 +00:00
break ;
2002-07-03 14:48:48 +00:00
ok = chunk . exist ( ) ;
2002-05-27 13:16:06 +00:00
if ( ! ok )
2009-02-20 14:02:37 +00:00
message_box ( FR ( " Impossibile trovare il file '%s' " ) , ( const char * ) chunk ) ;
2002-05-27 13:16:06 +00:00
}
1997-10-30 15:13:59 +00:00
}
1998-08-25 17:46:29 +00:00
1997-10-30 15:13:59 +00:00
if ( ok )
{
2009-02-20 14:02:37 +00:00
const long required = fsize ( chunk ) * ( dischi - d + 1 ) * 4 ;
2003-03-28 15:33:12 +00:00
if ( ! xvt_fsys_test_disk_free_space ( tempdir , required ) )
1997-10-30 15:13:59 +00:00
{
2002-10-24 10:47:49 +00:00
ok = yesno_box ( TR ( " Lo spazio su disco potrebbe essere insufficiente: \n Si desidera continuare ugualmente? " ) ) ;
1997-10-30 15:13:59 +00:00
}
}
1998-08-25 17:46:29 +00:00
1997-10-30 15:13:59 +00:00
if ( ok )
2003-06-11 14:19:56 +00:00
: : fcopy ( chunk , totti , d > 1 ) ; // Somma il chunk al totale
1998-08-25 17:46:29 +00:00
}
2009-04-21 14:55:13 +00:00
if ( pi ! = NULL )
{
delete pi ;
pi = NULL ;
}
2002-07-03 14:48:48 +00:00
2009-02-20 14:02:37 +00:00
//scompattamento vero e proprio dello zip
aga_unzip ( totti , tempdir ) ; // Scompatta il file totale zip
2009-05-05 13:13:30 +00:00
totti . fremove ( ) ; // Elimina il file totale zip
2009-02-20 14:02:37 +00:00
// TRASFERIMENTO
// -----------------
1997-10-30 15:13:59 +00:00
if ( ok )
1998-08-25 17:46:29 +00:00
{
// si assicura che sia leggibile il .ini del primo disco
2002-07-03 14:48:48 +00:00
do
{
TFilename cmdline = path ;
2009-02-20 14:02:37 +00:00
cmdline . add ( remote_ininame . name ( ) ) ;
2002-07-03 14:48:48 +00:00
ok = cmdline . exist ( ) ;
1998-08-25 17:46:29 +00:00
if ( ! ok )
{
2009-02-20 14:02:37 +00:00
if ( askdisk ( path , cmdline , 1 , dischi , ( const char * ) remote_ini - > get ( " Descrizione " ) ) = = K_QUIT )
1998-08-25 17:46:29 +00:00
break ;
ok = fexist ( cmdline ) ;
if ( ! ok )
2009-02-20 14:02:37 +00:00
message_box ( FR ( " Impossibile trovare %s \n " ) , ( const char * ) cmdline ) ;
1998-08-25 17:46:29 +00:00
else
{
2009-02-20 14:02:37 +00:00
delete remote_ini ;
remote_ini = new TInstall_ini ( cmdline ) ;
1998-08-25 17:46:29 +00:00
}
}
} while ( ! ok ) ;
2009-02-20 14:02:37 +00:00
1998-08-25 17:46:29 +00:00
if ( ok )
1997-12-15 15:11:40 +00:00
{
2009-04-21 14:55:13 +00:00
TWait_cursor hourglass ;
1998-08-25 17:46:29 +00:00
msg . cut ( 0 ) ;
2002-10-24 10:47:49 +00:00
msg < < TR ( " Aggiornamento del modulo ' " ) < < module < < TR ( " ' in corso... " ) ;
2009-04-21 14:55:13 +00:00
xvtil_statbar_set ( msg ) ;
2009-02-20 14:02:37 +00:00
ok = move_module ( module , * remote_ini , true ) ;
1998-08-25 17:46:29 +00:00
2002-05-27 13:16:06 +00:00
if ( ok )
1998-08-25 17:46:29 +00:00
{
2009-02-20 14:02:37 +00:00
TAuto_token_string altri ( remote_ini - > get ( " Moduli " , module ) ) ;
1998-11-04 18:04:26 +00:00
FOR_EACH_TOKEN ( altri , mod )
1997-12-15 15:11:40 +00:00
{
1998-11-04 18:04:26 +00:00
const TString16 submod = mod ;
if ( submod . len ( ) > 2 ) // sposta sottomoduli esterni
1998-08-25 17:46:29 +00:00
{
1998-11-04 18:04:26 +00:00
bool upd = ok ;
if ( ok )
{
2009-02-20 14:02:37 +00:00
TInstall_ini local_cur_ini ;
const TString16 curver = local_cur_ini . version ( submod ) ;
const int curpatch = local_cur_ini . patch ( submod ) ;
const TString16 reqver = remote_ini - > version ( submod ) ;
const int reqpatch = remote_ini - > patch ( submod ) ;
1998-11-04 18:04:26 +00:00
int distance = compare_version ( reqver , reqpatch , curver , curpatch ) ;
upd = distance > 0 ;
}
2009-02-20 14:02:37 +00:00
ok & = move_module ( submod , * remote_ini , upd ) ;
1998-11-04 18:04:26 +00:00
if ( upd & & ok ) // marca sull'install.ini di destinazione l'avvenuta installazione del sottomodulo "esterno"
2009-02-20 14:02:37 +00:00
remote_ini - > export_paragraph ( submod , TInstall_ini : : default_name ( ) , ! is_a_patch ) ;
2002-12-20 16:15:03 +00:00
}
}
}
2009-04-21 14:55:13 +00:00
xvtil_statbar_set ( " " ) ;
2009-02-20 14:02:37 +00:00
} //if(ok)..
} //if(ok)..
1998-08-25 17:46:29 +00:00
if ( ok ) // marca sull'install.ini di destinazione l'avvenuta installazione del modulo
2009-02-20 14:02:37 +00:00
remote_ini - > export_module_paragraphs ( module , TInstall_ini : : default_name ( ) , ! is_a_patch ) ;
1998-08-25 17:46:29 +00:00
} // installazione da directory con zip
1997-10-30 15:13:59 +00:00
else
1998-08-25 17:46:29 +00:00
if ( ! is_a_patch )
1997-10-30 15:13:59 +00:00
{
2009-02-20 14:02:37 +00:00
// non c'e' il .ini del modulo ma un unico "install.ini" (es. aggiornamento client)
//------------------------------------------------
// (INSTALLAZIONE DA DIRECTORY CON ESEGUIBILI)
//------------------------------------------------
remote_ininame = path ;
remote_ininame . add ( TInstall_ini : : default_name ( ) ) ;
ok = fexist ( remote_ininame ) ;
1998-08-25 17:46:29 +00:00
if ( ok )
1997-10-30 15:13:59 +00:00
{
2009-02-20 14:02:37 +00:00
TInstall_ini ini ( remote_ininame ) ;
1998-08-25 17:46:29 +00:00
ini . write_protect ( ) ;
2009-02-20 14:02:37 +00:00
lastpatch = ini . get_int ( " Patch " , module ) ;
lastrelease = ini . get ( " Versione " , module ) ;
1998-08-25 17:46:29 +00:00
if ( ! can_install ( module , ini ) )
2006-08-01 13:41:55 +00:00
return false ;
1998-08-25 17:46:29 +00:00
TString_array list ;
const int files = ini . build_complete_list ( module , list ) ;
if ( files > 0 )
1997-10-30 15:13:59 +00:00
{
2009-02-20 14:02:37 +00:00
if ( patchlevel = = 0 )
1998-08-25 17:46:29 +00:00
ok = pre_process ( ini , module ) ;
if ( ok )
1997-11-06 10:05:56 +00:00
{
2003-05-26 13:00:26 +00:00
msg . cut ( 0 ) < < TR ( " Copia del modulo " ) < < module ;
2006-08-01 13:41:55 +00:00
TProgind pi ( files , msg , true , true ) ;
1998-08-25 17:46:29 +00:00
TFilename src , dst ;
for ( int f = 0 ; f < files & & ok ; f + + )
{
pi . addstatus ( 1 ) ;
dst = list . row ( f ) . get ( 0 ) ;
1998-11-04 18:04:26 +00:00
dst . lower ( ) ;
1998-08-25 17:46:29 +00:00
src = path ;
src . add ( dst ) ;
2003-05-29 07:57:20 +00:00
const int reboot = needs_reboot ( dst ) ;
2009-10-27 10:50:29 +00:00
if ( ( reboot & NEW_SYS ) ! = 0 & & dst . exist ( ) )
2003-05-26 13:00:26 +00:00
{
dst . rtrim ( 1 ) ;
dst < < ' _ ' ;
}
2009-10-27 10:50:29 +00:00
//copia il file dalla dir sorgenti
2009-06-08 15:06:41 +00:00
ok = copy_file ( src , dst ) ;
2009-10-27 10:50:29 +00:00
if ( ok )
{
if ( ok & & is_zip_file ( src ) )
aga_unzip ( src , dst . path ( ) ) ;
2003-05-26 13:00:26 +00:00
2009-10-27 10:50:29 +00:00
if ( ok & & reboot ! = NONE )
_reboot_program | = reboot ;
}
else //se non riesce chiede se proseguire ugualmente
ok = yesno_box ( TR ( " Continuare ugualmente ? " ) ) ;
2003-05-26 13:00:26 +00:00
1999-07-16 14:59:11 +00:00
cancelled = pi . iscancelled ( ) ;
1998-08-25 17:46:29 +00:00
}
1999-07-16 14:59:11 +00:00
ok & = ! cancelled ;
1997-11-06 10:05:56 +00:00
}
1997-10-30 15:13:59 +00:00
1998-08-25 17:46:29 +00:00
if ( ok ) // marca sull'install.ini di destinazione l'avvenuta installazione del modulo
2009-02-20 14:02:37 +00:00
ini . export_module_paragraphs ( module , ini . default_name ( ) , true ) ;
1998-08-25 17:46:29 +00:00
} // controllo esistenza lista di file non vuota per questo modulo
} // controllo esistenza install.ini
} // fine installazione da directory con eseguibili
1997-10-30 15:13:59 +00:00
if ( ok )
1998-08-25 17:46:29 +00:00
{
{
1998-08-21 10:58:38 +00:00
TInstall_ini ini ;
ini . set ( " Data " , TDate ( TODAY ) , module ) ;
2009-02-20 14:02:37 +00:00
ini . update_prices ( remote_ininame ) ;
1998-04-30 14:38:35 +00:00
}
// Non togliere le parentesi graffe soprastanti per permettere l'aggiornamento fisico del .ini (CON LA CHIAMATA DEL DISTRUTTORE)
1998-08-25 17:46:29 +00:00
update_version ( ) ;
1997-10-30 15:13:59 +00:00
}
1998-04-30 14:38:35 +00:00
1998-08-25 17:46:29 +00:00
if ( ok & & patchlevel = = 0 ) // Se installo un modulo pricipale ...
1998-04-30 14:38:35 +00:00
{
// ... installo DOPO tutte le patches successive
install_patches ( module , lastrelease , lastpatch ) ;
1998-08-25 17:46:29 +00:00
TInstall_ini ini ;
ok & = post_process ( ini , module ) ;
1998-04-30 14:38:35 +00:00
}
1997-11-06 10:05:56 +00:00
1997-10-30 15:13:59 +00:00
return ok ;
}
2007-12-19 11:41:00 +00:00
bool TInstaller_mask : : get_patches_path ( TFilename & path ) const
1998-04-30 14:38:35 +00:00
{
2007-12-19 11:41:00 +00:00
const TEdit_field & www = efield ( F_WEB ) ;
2008-12-23 09:11:50 +00:00
path = www . get ( ) ;
2007-12-19 11:41:00 +00:00
if ( www . active ( ) & & path . full ( ) & & is_internet_path ( path ) )
1998-08-21 10:58:38 +00:00
{
2007-12-19 11:41:00 +00:00
path . tempdir ( ) ;
path . add ( " www " ) ;
2008-12-23 09:11:50 +00:00
make_dir ( path ) ; //crea la directory temporanaea di installazione dove depositare e scompattare gli zip
2006-08-01 13:41:55 +00:00
return true ;
1998-11-04 18:04:26 +00:00
}
2007-12-19 11:41:00 +00:00
else
2009-06-17 10:17:04 +00:00
{
2007-12-19 11:41:00 +00:00
path = get ( F_PATH ) ;
2009-06-17 10:17:04 +00:00
// Toglie l'eventual slash finale
const char last = path . right ( 1 ) [ 0 ] ;
if ( last = = ' / ' | | last = = ' \\ ' )
path . rtrim ( 1 ) ;
}
2006-08-01 13:41:55 +00:00
return false ;
1998-11-04 18:04:26 +00:00
}
2004-03-05 08:59:03 +00:00
void TInstaller_mask : : parse_internet_path ( TString & http_server , TFilename & http_path ) const
1998-11-04 18:04:26 +00:00
{
2007-12-19 11:41:00 +00:00
http_server = get ( F_WEB ) ;
if ( http_server . blank ( ) )
{
http_server = http_default_path ( ) ;
( ( TMask * ) this ) - > set ( F_WEB , http_server ) ;
}
2009-06-17 10:17:04 +00:00
if ( http_server . starts_with ( " http:// " ) )
1998-11-04 18:04:26 +00:00
http_server . ltrim ( 7 ) ;
2007-12-19 11:41:00 +00:00
const int slash = http_server . find ( ' / ' ) ;
1998-11-04 18:04:26 +00:00
if ( slash > 0 )
{
2001-04-30 14:22:43 +00:00
http_path = http_server . mid ( slash ) ;
http_server . cut ( slash ) ;
1998-08-21 10:58:38 +00:00
}
2007-12-19 11:41:00 +00:00
//aggiunge lo slash finale se l'utonto l'ha omesso
if ( ! http_path . ends_with ( " / " ) )
http_path < < ' / ' ;
//e' un server redirezionato?
http_isredirected_server ( http_server , http_path ) ;
1998-11-04 18:04:26 +00:00
}
bool TInstaller_mask : : install_patches ( const TString & module , const TString & lastrelease , int lastpatch , bool only_newer )
{
2006-08-01 13:41:55 +00:00
bool ok = true ;
1998-11-04 18:04:26 +00:00
TString_array modules ;
TFilename ininame ;
2007-12-19 11:41:00 +00:00
get_patches_path ( ininame ) ;
1998-08-21 10:58:38 +00:00
1998-04-30 14:38:35 +00:00
ininame . add ( module ) ;
2007-10-15 10:01:44 +00:00
ininame < < " ????a.ini " ;
1998-04-30 14:38:35 +00:00
modules . destroy ( ) ;
list_files ( ininame , modules ) ;
2004-04-08 15:42:30 +00:00
modules . sort ( ) ;
1998-04-30 14:38:35 +00:00
FOR_EACH_ARRAY_ROW ( modules , am , arow )
1998-08-25 17:46:29 +00:00
{
1998-04-30 14:38:35 +00:00
TString & ininame = * arow ;
ininame . lower ( ) ;
const int pos = ininame . find ( " a.ini " ) ;
CHECKS ( pos > = 6 , " Invalid installation configuration: " , ( const char * ) ininame ) ;
const TString16 patchmodule = ininame . mid ( pos - 6 , 2 ) ;
TConfig ini ( ininame , patchmodule ) ;
const int patchlevel = ini . get_int ( " Patch " ) ;
2007-03-07 10:23:42 +00:00
const TString16 patchversion = ini . get ( " Versione " ) ;
if ( ok & & lastrelease . mid ( 4 ) = = patchversion . mid ( 4 ) // installa solo le patch della stessa ver..
1998-11-04 18:04:26 +00:00
& & ( only_newer ? lastpatch < patchlevel : lastpatch < = patchlevel ) ) // ... e patch superiore o uguale (reinstalla l'ultima patch)
1998-04-30 14:38:35 +00:00
ok = install ( module , patchlevel ) ;
}
return ok ;
}
1998-08-25 17:46:29 +00:00
bool TInstaller_mask : : update_handler ( TMask_field & f , KEY k )
{
if ( k = = K_SPACE )
{
TInstaller_mask & m = ( TInstaller_mask & ) f . mask ( ) ;
m . autoload ( ) ;
}
2006-08-01 13:41:55 +00:00
return true ;
1998-08-25 17:46:29 +00:00
}
1997-10-30 15:13:59 +00:00
bool TInstaller_mask : : path_handler ( TMask_field & fld , KEY key )
1998-08-25 17:46:29 +00:00
{
2006-08-01 13:41:55 +00:00
bool ok = true ;
1997-10-30 15:13:59 +00:00
if ( key = = K_TAB & & fld . focusdirty ( ) )
{
1998-01-23 14:55:34 +00:00
TFilename path = fld . get ( ) ;
1998-08-21 10:58:38 +00:00
if ( path . not_empty ( ) )
1997-10-30 15:13:59 +00:00
{
1998-08-21 10:58:38 +00:00
if ( path . len ( ) = = 2 & & isalpha ( path [ 0 ] ) & & path [ 1 ] = = ' : ' )
{
path < < SLASH ;
fld . set ( path ) ;
1998-11-04 18:04:26 +00:00
}
1998-08-21 10:58:38 +00:00
if ( path . exist ( ) | | : : is_internet_path ( path ) )
_curr_mask - > autoload ( ) ;
else
2002-10-24 10:47:49 +00:00
ok = fld . error_box ( TR ( " Specificare un percorso valido " ) ) ;
1998-08-21 10:58:38 +00:00
}
1998-11-04 18:04:26 +00:00
}
return ok ;
}
2007-12-19 11:41:00 +00:00
bool TInstaller_mask : : web_handler ( TMask_field & fld , KEY key )
{
bool ok = true ;
if ( key = = K_TAB & & fld . focusdirty ( ) )
{
TFilename path = fld . get ( ) ;
if ( path . not_empty ( ) )
{
if ( ! path . ends_with ( " / " ) )
{
path < < ' / ' ;
fld . set ( path ) ;
}
ok = : : is_internet_path ( path ) ;
if ( ! ok )
ok = fld . error_box ( TR ( " Specificare un indirizzo valido " ) ) ;
}
}
return ok ;
}
1997-10-30 15:13:59 +00:00
2009-02-20 14:02:37 +00:00
// Aggiorna l'install.ini con eventuali modifiche dell'utente su dispath e/o webpath
2008-10-22 08:18:26 +00:00
// Decisivo in caso di cambio path d'installazione
2009-02-20 14:02:37 +00:00
// Serve a setup (deve essere chiamata in caso di esecuzioni passive di setup, tipo -uw, -uw)
void TInstaller_mask : : update_disk_and_web_path ( )
2008-10-22 08:18:26 +00:00
{
TInstall_ini ini ;
ini . set ( " DiskPath " , get ( F_PATH ) ) ;
ini . set ( " WebPath " , get ( F_WEB ) ) ;
}
1997-12-04 14:07:49 +00:00
void TInstaller_mask : : install_selection ( )
{
TString_array & arr = rows_array ( ) ;
2004-04-08 15:42:30 +00:00
2006-04-26 15:22:42 +00:00
int nModules = 0 ;
{
FOR_EACH_ARRAY_ROW ( arr , r , row )
{
if ( checked ( r ) )
nModules + + ;
}
}
TProgind pi ( nModules , " Installazione " , true , true ) ;
1997-12-04 14:07:49 +00:00
FOR_EACH_ARRAY_ROW ( arr , r , row ) if ( checked ( r ) )
{
2006-04-26 15:22:42 +00:00
if ( ! pi . addstatus ( 1 ) )
break ;
1999-04-06 15:34:39 +00:00
1998-02-18 13:46:52 +00:00
const TString newver = row - > get ( C_RELEASE ) ;
1998-02-09 12:06:44 +00:00
if ( newver . blank ( ) )
{
2006-08-01 13:41:55 +00:00
check ( r , false ) ;
1998-02-09 12:06:44 +00:00
continue ;
}
2006-04-26 15:22:42 +00:00
const TString4 modulo = row - > get ( C_CODE ) ;
2009-02-23 11:40:41 +00:00
const TString modesc = dongle ( ) . module_name2desc ( modulo ) ;
1998-02-18 13:46:52 +00:00
const int newpatch = row - > get_int ( C_PATCH ) ;
const TString oldver = row - > get ( C_CURRRELEASE ) ;
const int oldpatch = row - > get_int ( C_CURRPATCH ) ;
1998-08-25 17:46:29 +00:00
2009-02-23 11:40:41 +00:00
pi . set_text ( format ( FR ( " Installazione modulo '%s' " ) , ( const char * ) modesc ) ) ;
2010-01-04 14:01:36 +00:00
if ( version2year ( newver ) < 2009 )
1997-12-15 15:11:40 +00:00
{
2009-02-23 11:40:41 +00:00
error_box ( FR ( " Il modulo '%s' non ha una versione valida. " ) , ( const char * ) modesc ) ;
1997-12-15 15:11:40 +00:00
continue ;
}
1998-08-25 17:46:29 +00:00
2006-08-01 13:41:55 +00:00
bool ok = true ;
1998-11-04 18:04:26 +00:00
bool is_patch = row - > get_char ( C_ISPATCH ) = = ' X ' ;
bool has_patch = row - > get_char ( C_ISPATCH ) = = ' + ' ;
1998-01-22 11:56:14 +00:00
const int cmp = compare_version ( oldver , oldpatch , newver , newpatch ) ;
2007-03-07 10:23:42 +00:00
//versione e patch coincidono
1997-10-30 15:13:59 +00:00
if ( cmp = = 0 )
2009-02-23 11:40:41 +00:00
ok = noyes_box ( FR ( " Si desidera reinstallare la versione %s.%d del modulo '%s' ? " ) , ( const char * ) newver , newpatch , ( const char * ) modesc ) ;
2007-03-07 10:23:42 +00:00
//ci sono ANCHE i pacchi
if ( ! is_patch & & cmp > 0 )
1998-01-29 13:42:30 +00:00
{
TString256 msg ;
2009-02-23 11:40:41 +00:00
msg . format ( FR ( " Si desidera ritornare alla versione %s.%d del modulo '%s' ? \n Attenzione: non e' garantito il corretto \n funzionamento di tutti i programmi! " ) , ( const char * ) newver , newpatch , ( const char * ) modesc ) ;
1998-01-29 13:42:30 +00:00
ok = noyes_box ( msg ) ;
}
2007-03-07 10:23:42 +00:00
//ci sono SOLO patch da installare
1999-04-06 15:34:39 +00:00
if ( ok & & is_patch )
1998-02-18 13:46:52 +00:00
{
// installo le patch solo se esiste gi<67> un modulo installato della stessa versione
if ( ! oldver . blank ( ) )
1999-04-06 15:34:39 +00:00
{
2007-03-07 10:23:42 +00:00
if ( compare_version ( oldver , 0 , newver , 0 ) ) //controlla SOLO la versione indipendentemente dall'anno!
2002-10-24 10:47:49 +00:00
ok = error_box ( FR ( " Il modulo '%s' installato ha versione %s: \n impossibile installare le patch della versione %s " ) , ( const char * ) modulo , ( const char * ) oldver , ( const char * ) newver ) ;
1998-08-25 17:46:29 +00:00
} else
2007-03-07 10:23:42 +00:00
if ( newpatch < oldpatch )
{
TString256 msg ;
2009-02-23 11:40:41 +00:00
msg . format ( FR ( " Si desidera ritornare alla patch %s.%d del modulo '%s' ? \n Attenzione: non e' garantito il corretto \n funzionamento di tutti i programmi! " ) , ( const char * ) newver , newpatch , ( const char * ) modesc ) ;
2007-03-07 10:23:42 +00:00
ok = noyes_box ( msg ) ;
2007-12-19 11:41:00 +00:00
}
} //if(ok&&is_patch...
2007-03-07 10:23:42 +00:00
1997-10-30 15:13:59 +00:00
if ( ok )
1998-08-25 17:46:29 +00:00
{
1998-11-04 18:04:26 +00:00
if ( has_patch )
1998-08-21 10:58:38 +00:00
{
2003-03-14 14:54:28 +00:00
if ( newver = = oldver & & newpatch > = oldpatch )
1998-08-21 10:58:38 +00:00
{
2003-03-14 14:54:28 +00:00
const int basepatch = row - > get_int ( C_BASEPATCH ) ;
if ( oldpatch > = basepatch )
is_patch = ! noyes_box ( FR ( " Si desidera reinstallare l'intero modulo '%s'? "
" \n Rispondendo NO verranno installate le sole patch " ) ,
2009-02-23 11:40:41 +00:00
( const char * ) modesc ) ;
2003-03-14 14:54:28 +00:00
else
2006-08-01 13:41:55 +00:00
is_patch = false ; // Quando la versione installata precede la patch base devo reinstallare il modulo!
1998-08-25 17:46:29 +00:00
}
1998-08-21 10:58:38 +00:00
}
2007-12-19 11:41:00 +00:00
TFilename path ;
const bool internet = get_patches_path ( path ) ;
2008-01-07 11:29:29 +00:00
//richiesto aggiornamento da disco del modulo SY o del modulo SR da manutenzione/installazione moduli!
if ( modulo = = " sy " | | modulo = = " sr " )
2007-12-19 11:41:00 +00:00
{
if ( ! internet )
{
bool file_copied = false ;
//trova il path della directory setup che e' nell'area con gli zip del cd
TFilename disk_path = path ;
disk_path . add ( " setup/ " ) ;
TString_array ar ;
2008-05-09 15:48:22 +00:00
const int items = disk_path . exist ( ) ? list_files ( disk_path , ar ) : 0 ;
2007-12-19 11:41:00 +00:00
if ( items > 0 )
{
//copia la dir setup dal disco sovrascrivendo eventuali files gia' presenti
make_dir ( " setup " ) ;
TFilename local_file , remote_file ;
2009-12-02 12:13:00 +00:00
//preserva l'OEM contenuto in oem.ini della directory setup
const int old_oem = ini_get_int ( " setup/oem.ini " , " MAIN " , " OEM " ) ;
2007-12-19 11:41:00 +00:00
FOR_EACH_ARRAY_ROW ( ar , r , row )
{
local_file = row - > mid ( path . len ( ) + 1 ) ;
remote_file = * row ;
file_copied = fcopy ( remote_file , local_file ) ; //occhio alle maiuscole!!!!
}
2009-12-02 12:13:00 +00:00
//riscrive il vecchio valore di oem in oem.ini
ini_set_int ( " setup/oem.ini " , " MAIN " , " OEM " , old_oem ) ;
2007-12-19 11:41:00 +00:00
}
2009-02-20 14:02:37 +00:00
update_disk_and_web_path ( ) ; //aggiorna l'install.ini
2007-12-19 11:41:00 +00:00
//lancia setup in modalita' aggiornamento da disco
2009-06-17 10:44:31 +00:00
if ( test_station_type ( ) = = 3 )
_setup_run = xvt_sys_execute ( " setup \\ setup.exe -uc " , false , false ) ! = 0 ;
else
_setup_run = xvt_sys_execute ( " setup \\ setup.exe -ud " , false , false ) ! = 0 ;
2007-12-19 11:41:00 +00:00
}
//richiesto aggiornamento via web del modulo SY da manutenzione/installazione moduli!
else
{
bool file_copied = false ;
//trova l'indirizzo web completo
TString http_server ;
TFilename http_path ;
parse_internet_path ( http_server , http_path ) ;
//copia la dir setup dalla remote dir sovrascrivendo eventuali files gia' presenti
http_path . add ( " setup/ " ) ;
TString_array ar ;
http_dir ( http_server , http_path , ar ) ;
if ( ar . items ( ) > 0 )
{
make_dir ( " setup " ) ;
TFilename local_file , remote_file ;
FOR_EACH_ARRAY_ROW ( ar , r , row )
{
local_file = " setup " ;
local_file . add ( * row ) ;
remote_file = http_path ;
remote_file . add ( * row ) ;
2009-01-20 16:47:54 +00:00
//via web NON deve copiare oem.ini perch<63> NON deve poter cambiare il reseller (solo via disco sar<61> ..
//..possibile)
const bool is_oem_ini = xvt_str_compare_ignoring_case ( remote_file . name ( ) , " oem.ini " ) = = 0 ;
if ( is_oem_ini )
{
const int old_oem = xvt_sys_get_profile_int ( local_file , " MAIN " , " OEM " , - 1 ) ;
file_copied = http_get ( http_server , remote_file , local_file ) ; //occhio alle maiuscole!!!!
const int new_oem = xvt_sys_get_profile_int ( local_file , " MAIN " , " OEM " , - 1 ) ;
if ( new_oem ! = old_oem )
{
TString4 str_oem ; str_oem < < ' ' < < old_oem ;
xvt_sys_set_profile_string ( local_file , " MAIN " , " OEM " , str_oem ) ;
}
}
else
file_copied = http_get ( http_server , remote_file , local_file ) ; //occhio alle maiuscole!!!!
2007-12-19 11:41:00 +00:00
}
}
2009-02-20 14:02:37 +00:00
update_disk_and_web_path ( ) ; //aggiorna l'install.ini
2008-06-19 10:00:05 +00:00
//lancia setup in modalita' aggiornamento web
_setup_run = xvt_sys_execute ( " setup \\ setup.exe -uw " , false , false ) ! = 0 ;
2007-12-19 11:41:00 +00:00
}
if ( _setup_run ) //se riesce a lanciare setup.exe...
{
//si suicida...Banzai!
uncheck ( r ) ;
send_key ( K_SPACE , DLG_QUIT ) ;
return ;
}
}
//installa solo le patch del modulo...
1998-04-30 14:38:35 +00:00
if ( is_patch )
1998-01-23 14:55:34 +00:00
{
2006-08-01 13:41:55 +00:00
ok = install_patches ( modulo , oldver , oldpatch , false ) ; // installa l'ultima patch
1998-08-25 17:46:29 +00:00
if ( ! ok )
2009-02-23 11:40:41 +00:00
message_box ( TR ( " Impossibile installare le patch del modulo '%s' " ) , ( const char * ) modesc ) ;
1998-01-23 14:55:34 +00:00
}
2007-12-19 11:41:00 +00:00
else //..installa anche il pacco del modulo
2004-04-08 15:42:30 +00:00
{
1998-04-30 14:38:35 +00:00
ok = install ( modulo , 0 ) ; // installa il modulo
2004-04-08 15:42:30 +00:00
}
1998-04-30 14:38:35 +00:00
if ( ok )
2004-04-08 15:42:30 +00:00
{
2004-07-23 13:04:28 +00:00
_installed = true ; // Setta il flag di almeno un modulo installato
2004-04-08 15:42:30 +00:00
uncheck ( r ) ; //finalmente unchecka i moduli installati
}
2007-12-19 11:41:00 +00:00
} //if(ok)...
1998-11-04 18:04:26 +00:00
else
2004-04-08 15:42:30 +00:00
uncheck ( r ) ; // se non ci sono patch o moduli -> uncheck
2007-12-19 11:41:00 +00:00
} //FOR_EACH_ARRAY_ROW(arr...
2009-02-20 14:02:37 +00:00
//aggiorna definitivamente i path su install.ini
update_disk_and_web_path ( ) ;
//accoppa i files nelle kill lists e aggiorna install.ini
kill_files ( ) ;
//serve per togliere il check al modulo 'sy' quando viene installato
force_update ( ) ;
1997-12-04 14:07:49 +00:00
}
bool TInstaller_mask : : install_handler ( TMask_field & fld , KEY key )
1998-08-25 17:46:29 +00:00
{
1997-12-04 14:07:49 +00:00
if ( key = = K_SPACE )
1998-08-25 17:46:29 +00:00
{
1997-12-17 13:40:59 +00:00
if ( _curr_mask - > items ( ) = = 1 )
_curr_mask - > check ( 0 ) ;
1999-07-16 14:59:11 +00:00
const bool check_on = _curr_mask - > check_enabled ( ) ;
2006-08-01 13:41:55 +00:00
_curr_mask - > enable_check ( true ) ;
1999-07-16 14:59:11 +00:00
const bool some = _curr_mask - > one_checked ( ) ;
_curr_mask - > enable_check ( check_on ) ;
if ( some )
1997-12-04 14:07:49 +00:00
_curr_mask - > install_selection ( ) ;
else
2002-10-24 10:47:49 +00:00
error_box ( TR ( " Selezionare uno o piu' moduli da installare. " ) ) ;
1997-12-04 14:07:49 +00:00
}
2006-08-01 13:41:55 +00:00
return true ;
1997-12-04 14:07:49 +00:00
}
1998-11-04 18:04:26 +00:00
bool TInstaller_mask : : tutti_handler ( TMask_field & f , KEY k )
1998-08-21 10:58:38 +00:00
{
if ( k = = K_SPACE )
{
1998-11-04 18:04:26 +00:00
TInstaller_mask & m = ( TInstaller_mask & ) f . mask ( ) ;
if ( m . check_enabled ( ) )
{
if ( m . one_checked ( ) )
m . uncheck ( - 1 ) ;
else
2006-08-01 13:41:55 +00:00
m . precheck_modules ( false ) ;
1998-11-04 18:04:26 +00:00
}
1998-08-21 10:58:38 +00:00
}
2006-08-01 13:41:55 +00:00
return true ;
1998-08-21 10:58:38 +00:00
}
1997-12-04 14:07:49 +00:00
bool TInstaller_mask : : on_key ( KEY key )
1998-08-25 17:46:29 +00:00
{
2006-08-01 13:41:55 +00:00
bool ok = true ;
1998-08-25 17:46:29 +00:00
switch ( key )
1998-08-21 10:58:38 +00:00
{
1998-08-25 17:46:29 +00:00
case K_F7 : autoload ( ) ; break ;
case K_F8 : field ( DLG_USER ) . on_hit ( ) ; break ;
default : ok = TArray_sheet : : on_key ( key ) ; break ;
1998-08-21 10:58:38 +00:00
}
1998-08-25 17:46:29 +00:00
return ok ;
1997-10-30 15:13:59 +00:00
}
2009-02-26 11:01:21 +00:00
//metodo per controllare se la directory indicata contiene una installazione buona di campo
bool TInstaller_mask : : is_program_dir ( const TFilename & path )
{
//controlla l'esistenza di alcuni files chiave di campo
2010-01-04 14:01:36 +00:00
const char * const essential [ ] = { " install.ini " , " campo.ini " , " campo.aut " , " ba0.exe " , " xvaga.dll " , NULL } ;
bool ok = true ;
for ( int i = 0 ; ok & & essential [ i ] ; i + + )
2009-02-26 11:01:21 +00:00
{
2010-01-04 14:01:36 +00:00
TFilename work_path = path ;
work_path . add ( essential [ i ] ) ;
ok = work_path . exist ( ) ;
2009-02-26 11:01:21 +00:00
}
return ok ;
}
1997-10-30 15:13:59 +00:00
TInstaller_mask : : TInstaller_mask ( )
2002-10-24 10:47:49 +00:00
: TArray_sheet ( 0 , 0 , 0 , 0 , TR ( " Installazione " ) ,
2005-02-17 18:13:12 +00:00
HR ( " @1|Modulo@32|Cod.@3|Versione da \n installare@11|Liv. \n Patch@6|Data \n Rilascio@10|Versione \n Installata@10|Liv. \n Patch@6|Data \n Installazione@13|Aggiornamento|Patch Base " ) ,
2007-12-19 11:41:00 +00:00
0x18 , 4 )
1998-08-25 17:46:29 +00:00
{
2008-10-07 09:06:37 +00:00
add_button ( F_INSTALL , TR ( " Installa " ) , ' \0 ' , TOOL_ELABORA ) ; // NON mettere 'I'
add_button ( F_UPDATE , TR ( " Rileggi " ) , ' \0 ' , TOOL_CONVERT ) ;
2008-12-17 14:23:18 +00:00
add_button ( DLG_NULL , " " , ' \0 ' ) ;
2009-02-23 11:40:41 +00:00
add_button ( DLG_INFO , TR ( " Info " ) , K_F2 , TOOL_INFO ) ;
2008-10-07 09:06:37 +00:00
add_button ( DLG_HELP , TR ( " Help " ) , K_F1 , TOOL_HELP ) ;
2008-05-15 15:01:55 +00:00
xvt_toolbar_set_last_tool ( toolbar ( ) , DLG_QUIT ) ;
2007-12-19 11:41:00 +00:00
_station_type = test_station_type ( ) ;
1997-12-04 14:07:49 +00:00
_curr_mask = this ;
2006-08-01 13:41:55 +00:00
_installed = false ;
1998-11-04 18:04:26 +00:00
_reboot_program = NONE ;
1998-08-25 17:46:29 +00:00
2007-12-19 11:41:00 +00:00
//in base al tipo di installazione che rileva decide se puo' effettuare aggiornamenti via web (un client..
//..non puo' fare aggiornamenti da web!!!)
2008-05-15 15:01:55 +00:00
TToken_string installada ;
2010-01-04 14:01:36 +00:00
installada . add ( PR ( " Installa da disco " ) ) ;
installada . add ( PR ( " Installa da web " ) ) ;
TRadio_field & rf = add_radio ( F_TYPE , 0 , " " , 0 , 0 , 23 , " 0|1 " , installada ) ;
2007-12-19 11:41:00 +00:00
* rf . message ( 0 , true ) = " DISABLE,207|ENABLE,201 " ;
* rf . message ( 1 , true ) = " DISABLE,201|ENABLE,207 " ;
2009-02-23 11:40:41 +00:00
add_string ( F_PATH , 0 , " " , 23 , 1 , 256 , " B " , 56 ) . set_selector ( ' D ' , EMPTY_STRING ) ;
add_string ( F_WEB , 0 , " " , 23 , 2 , 256 , " " , 56 ) ;
2007-12-19 11:41:00 +00:00
set ( F_TYPE , " 0 " , 0x1 ) ;
2009-02-26 11:01:21 +00:00
//deve conoscere i path adesso per poter testare se sono ok
TInstall_ini ini ;
TFilename path = ini . get ( " DiskPath " ) ;
TFilename webpath = ini . get ( " WebPath " ) ;
2010-01-04 14:01:36 +00:00
//un client non puo' scegliere a caso da dove aggiornarsi! Solo dal suo server!
2007-12-19 11:41:00 +00:00
if ( _station_type = = 3 )
2009-02-26 11:01:21 +00:00
{
rf . disable ( ) ;
bool ko = ! is_program_dir ( path ) ;
if ( ko )
warning_box ( TR ( " La cartella origine dei programmi NON <20> valida! \n Selezionarne una valida e premere 'Invio'. " ) ) ;
enable ( F_PATH , ko ) ;
}
2007-12-19 11:41:00 +00:00
2009-05-27 13:23:41 +00:00
add_string ( F_CURPATH , 0 , PR ( " Installa in " ) , 1 , 3 , 80 , " D " , 56 ) ;
1998-11-04 18:04:26 +00:00
1997-10-30 15:13:59 +00:00
set_handler ( F_PATH , path_handler ) ;
2007-12-19 11:41:00 +00:00
set_handler ( F_WEB , web_handler ) ;
1997-12-04 14:07:49 +00:00
set_handler ( F_INSTALL , install_handler ) ;
1998-08-21 10:58:38 +00:00
set_handler ( F_UPDATE , update_handler ) ;
1998-08-25 17:46:29 +00:00
set_handler ( DLG_USER , tutti_handler ) ;
2009-01-13 11:47:33 +00:00
//se il webpath <20> vuoto o di test, propone quello in oem.ini; non ammette che possa essere proposto un path..
//..di tipo test per impedire all'utonto di aggiornarsi da test prima di essere passato da release
if ( webpath . empty ( ) | | webpath . find ( " test " ) )
2010-01-04 14:01:36 +00:00
webpath = http_default_path ( ) ;
2009-01-13 11:47:33 +00:00
1997-10-30 15:13:59 +00:00
set ( F_PATH , path ) ;
2007-12-19 11:41:00 +00:00
set ( F_WEB , webpath ) ;
//..fine costruzione maschera di installazione
1998-08-25 17:46:29 +00:00
2007-12-19 11:41:00 +00:00
//decide quale e' il percorso di installazione
//ha un cd o un disco di rete -> si aggiorna da questo...
if ( path . exist ( ) )
1997-10-30 15:13:59 +00:00
autoload ( ) ;
2007-12-19 11:41:00 +00:00
else //senno' cerca su internet se trova un path internet completo e la connessione funzionante
{
2010-01-21 11:53:34 +00:00
if ( _station_type ! = 3 & & webpath . find ( " aga.it " ) > 0 )
2007-12-19 11:41:00 +00:00
{
set ( F_TYPE , " 1 " , 0x1 ) ;
2010-01-21 11:53:34 +00:00
autoload ( ) ;
2007-12-19 11:41:00 +00:00
}
}
1998-08-25 17:46:29 +00:00
DIRECTORY dir ;
1997-10-30 15:13:59 +00:00
xvt_fsys_get_dir ( & dir ) ;
xvt_fsys_convert_dir_to_str ( & dir , path . get_buffer ( ) , path . size ( ) ) ;
set ( F_CURPATH , path ) ;
}
1997-12-04 14:07:49 +00:00
TInstaller_mask : : ~ TInstaller_mask ( )
{
_curr_mask = NULL ;
}
1997-10-30 15:13:59 +00:00
///////////////////////////////////////////////////////////
// Programma principale
///////////////////////////////////////////////////////////
class TInstaller : public TSkeleton_application
1998-08-25 17:46:29 +00:00
{
1997-10-30 15:13:59 +00:00
protected :
2006-08-01 13:41:55 +00:00
TInstaller_mask * _m ;
1999-07-16 14:59:11 +00:00
protected :
virtual bool create ( ) ;
2006-08-01 13:41:55 +00:00
virtual bool use_files ( ) const { return false ; }
2001-06-25 10:41:20 +00:00
virtual bool test_assistance_year ( ) const ;
1997-10-30 15:13:59 +00:00
virtual void main_loop ( ) ;
2006-08-01 13:41:55 +00:00
void convert_archives ( ) ;
1997-10-30 15:13:59 +00:00
} ;
2007-10-04 15:20:11 +00:00
2001-06-25 10:41:20 +00:00
bool TInstaller : : test_assistance_year ( ) const
{
// Per il momento lascia continuare: ci pensa poi la create
2006-08-01 13:41:55 +00:00
return true ;
2001-06-25 10:41:20 +00:00
}
1999-07-16 14:59:11 +00:00
bool TInstaller : : create ( )
{
2001-06-25 10:41:20 +00:00
if ( ! TApplication : : test_assistance_year ( ) )
{
TExternal_app attivazione ( " ba1 -4 " ) ;
attivazione . run ( ) ;
dongle ( ) . login ( ) ; // Rilegge anno assistenza
}
2002-05-27 13:16:06 +00:00
else
2006-08-01 13:41:55 +00:00
update_dninst ( false ) ; // Aggiorna se necessario
2001-06-25 10:41:20 +00:00
2007-10-08 09:34:54 +00:00
//crea la maschera di installazione
_m = new TInstaller_mask ( ) ;
//se e' un client
2007-10-08 10:58:53 +00:00
if ( _m - > station_type ( ) = = 3 )
2007-10-08 09:34:54 +00:00
{
1999-07-16 14:59:11 +00:00
_m - > disable_check ( ) ;
_m - > disable ( F_UPDATE ) ;
2007-10-08 09:34:54 +00:00
_m - > disable ( DLG_USER ) ;
2001-06-25 10:41:20 +00:00
}
2007-10-08 09:34:54 +00:00
else //se e' standalone o server...
{
if ( user ( ) ! = : : dongle ( ) . administrator ( ) )
return error_box ( TR ( " Solo l'utente amministratore puo' aggiornare questa postazione! " ) ) ;
}
2001-06-25 10:41:20 +00:00
2007-10-08 09:34:54 +00:00
return TSkeleton_application : : create ( ) ;
1999-07-16 14:59:11 +00:00
}
2006-08-01 13:41:55 +00:00
void TInstaller : : convert_archives ( )
1999-07-16 14:59:11 +00:00
{
2006-08-01 13:41:55 +00:00
bool conv = true ;
if ( is_power_station ( ) )
conv = yesno_box ( TR ( " Si desidera convertire gli archivi ora? " ) ) ;
if ( conv )
1999-07-16 14:59:11 +00:00
{
2007-10-04 15:20:11 +00:00
_m - > backup ( ) ;
2004-05-07 10:32:02 +00:00
// Lancia conversione: ba1 -0 -C -uADMIN
1999-07-16 14:59:11 +00:00
TExternal_app conversion ( " ba1 -0 -C " ) ;
conversion . run ( ) ;
}
2006-08-01 13:41:55 +00:00
}
void TInstaller : : main_loop ( )
{
_m - > run ( ) ;
2007-10-08 10:58:53 +00:00
if ( _m - > run_conversion ( ) & & _m - > station_type ( ) < 3 ) // Almeno un trr installato e non e' client->conversione ammessa
2006-08-01 13:41:55 +00:00
{
convert_archives ( ) ;
}
1999-07-16 14:59:11 +00:00
2007-12-19 11:41:00 +00:00
//controlla se ha lanciato setup.exe prima di chiudersi; se non lo ha fatto -> e' a fine installazione..
//..normale (moduli non SY) e quindi lancia ba0.exe
const bool setup_launched = _m - > setup_run ( ) ;
2003-06-11 11:02:13 +00:00
delete _m ; _m = NULL ;
2007-12-19 11:41:00 +00:00
if ( ! setup_launched )
2004-05-04 11:44:23 +00:00
{
2007-12-19 11:41:00 +00:00
TExternal_app ba0 ( " ba0.exe " ) ;
ba0 . run ( true , true , false ) ; // run asynchronous and not iconized!
2004-05-04 11:44:23 +00:00
}
1997-10-30 15:13:59 +00:00
}
int ba1700 ( int argc , char * argv [ ] )
1998-08-25 17:46:29 +00:00
{
2007-10-08 09:34:54 +00:00
TInstaller app ;
app . run ( argc , argv , TR ( " Installazione moduli " ) ) ;
1997-10-30 15:13:59 +00:00
return 0 ;
2007-03-07 10:23:42 +00:00
}