Patch level :2.0 nopatch

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :aggiunta directory per sorgenti installazione


git-svn-id: svn://10.65.10.50/trunk@11398 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca 2003-09-05 15:05:16 +00:00
parent 629f578ece
commit 2d974ea278
11 changed files with 2654 additions and 0 deletions

BIN
windows/install/_setup.dll Executable file

Binary file not shown.

BIN
windows/install/_setup.lib Executable file

Binary file not shown.

168
windows/install/declare.rul Executable file
View File

@ -0,0 +1,168 @@
// File di include con le dichiarazioni per DECLARE.RUL
declare
#define TITLE_FONTSIZE_USE 64
// Dichiarazione di variabili
NUMBER nInstallBA;
NUMBER nFileSpaceBA;
BOOL bInstPresente, bNuovaInst, bDatiPresenti;
BOOL bIsNet;
BOOL bProgrammiServer;
BOOL bInstNTEutron, bInstNTHardlock;
BOOL bCannotExecute;
NUMBER nSystemFileModified;
STRING szAppPath[ _MAX_LENGTH ]; // szAppPath e' la directory dove la applicazione verra' installata
STRING szAppRefPath[ _MAX_LENGTH ]; // szAppRefPath e' la directory dei programmi di una installazione di rete
// che fa da riferimento per la sincronizzazione di tutte le postazioni di rete con installazione dei prg in locale
STRING szConfigPath[ _MAX_LENGTH ]; // szConfigPath e' la directory dei files di configurazione per la postazione di lavoro in rete con installazione
// dei prg su disco di rete (e' dove risiede il campo.ini utilizzato)
STRING szDataPath[ _MAX_LENGTH ]; // szDataPath e' la directory dove risiederanno i dati
STRING szDongleServerName[ _MAX_LENGTH ]; // nome della macchina server delle chiavi
STRING szAutoRunFolder[ _MAX_LENGTH ];
STRING szDisk [_MAX_LENGTH];
STRING szBitmapFile [_MAX_LENGTH];
STRING szTmp[_MAX_LENGTH];
STRING szTmp2[_MAX_LENGTH];
STRING szRunProgram[_MAX_LENGTH];
NUMBER nTmp;
NUMBER nInstallDiskSpace;
NUMBER nDataDiskSpace;
// szGroupName e' il nome del gruppo
STRING szGroupName[ _MAX_LENGTH];
STRING szOSName;
BOOL bSCREENSAVER;
BOOL bIsWin95;
#define STR_ERR_DLG "Errore di sistema. Impossibile visualizzare una finestra di dialogo."
#define STR_ERR_STRING "Errore di sistema. Impossibile ultimare l'installazione.\n\nRimuovere la causa dell'errore e ripetere l'installazione."
#define STR_INVALID_PATH "Il percorso indicato non e' valido.\nIndicare un altro percorso.\n"
#define STR_TEXT1 "I programmi di CAMPO verranno installati nella directory :"
#define STR_TEXTSER1 "I programmi di CAMPO sono installati nella directory :"
#define STR_DATATEXT1 "I dati verranno installati nella directory :"
#define STR_ENT_DISK "Inserire il disco "
#define STR_TAGDISK1 "BA"
#define STR_DIR_READONLY "Impossibile scrivere nella directory scelta per i programmi."
#define STR_DIR_NOTCREATED "Impossibile creare la directory specificata per i programmi."
#define STR_NOTENUFROOM "Lo spazio su disco e' insufficiente per l'installazione dei programmi."
#define STR_DATA_DIR_READONLY "Impossibile scrivere nella directory scelta per i dati."
#define STR_DATA_DIR_NOTCREATED "Impossibile creare la directory specificata per i dati."
#define STR_DATA_NOTENUFROOM "Lo spazio su disco e' insufficiente per l'installazione dei dati."
#define STR_ERR_DECOMPRESS "E' stato riscontrato un errore cercando di decomprimere "
#define STR_INSERTDISK "Inserire il disco etichettato :\n"
#define STR_NOTENUFEXMEM "Memoria estesa insufficiente.\nNon e' possibile installare l'applicazione su macchine con meno di 32 Mb di memoria.\n"
#define STR_NOTHINGTOINSTALL "Non e' stato selezionato alcun modulo."
#define STR_NOTFIRST1 "Esiste una versione precedente nella directory %s. Confermando l'installazione nella directory indicata, la versione precedente sara' aggiornata. "
#define STR_NOTFIRST2 "Si desidera cambiare directory e mantenere inalterata tale versione ?"
#define STR_UPDATESPACE "Lo spazio potrebbe non essere sufficiente per effettuare l'aggiornamento del programma. Continuare ?"
#define STR_DATA_UPDATESPACE "Lo spazio potrebbe non essere sufficiente per effettuare l'aggiornamento dei dati. Continuare ?"
#define STR_NET "Si desidera utilizzare il programma in rete ?"
#define STR_FILE_MODIFIED "Il file di sistema CONFIG.SYS e' stato modificato. Copia di backup di tale file e' stata creata nella directory %s e chiamata CONFIG.PRA"
#define STR_FILE_NOTMODIFIED "Il file CONFIG.PRA e' stato creato nella directory %s."
#define STR_SHARE "SHARE /F:5100 /L:500"
#define STR_TEMP "SET TEMP=C:\\TMP"
#define STR_MODSYSFILES "Il file CONFIG.SYS deve essere modificato."
#define STR_MODIFY "Modifica automatica"
#define STR_NOTMODIFY "Modifica manuale. Seguire l'esempio del file CONFIG.PRA"
#define STR_INFOMODIFY "Visualizzazione delle modifiche."
#define NUM_FILES_IN_CONFIG 200
#define INST_ENVIRONMENT "DITTA"
#define INST_DEMO "DEMO"
#define INST_AUTOFORM "AUTOFORM"
#define INST_WORKPLACE "WORKPLACE"
#define ZIP_DIRECTORY "ZIP"
#define ZIPDEMO_DIRECTORY "ZIP"
#define DEFAULT_LOCALPATH "C:\\campo"
#define DEFAULT_NETPATH "F:\\campo"
#define SELECTFOLDER_DIALOG 12008
// Prototipo delle funzioni
// main
prototype _ProgramPrologue( );
prototype _ProgramEpilogue( );
prototype _Benvenuto( );
prototype _FindExistingInst(BYREF STRING);// controlla la presenza dell'applicazione
prototype _CheckExistingInst(STRING);// controlla la presenza dell'applicazione
prototype _CheckExistingData(STRING);// controlla la presenza dell'applicazione
prototype _SelectSetupType(BYREF NUMBER);
prototype _SelectSetupMode(BYREF NUMBER);
prototype _SelectProgramDestination(BYREF NUMBER);
prototype _SelectWhatToInstall(BYREF NUMBER);
prototype _SelectNetConfig(BYREF NUMBER );
prototype _SelectDataDestination(BYREF NUMBER);
prototype _SelectDataType( BYREF NUMBER);
prototype _SelectDongleServer(BYREF NUMBER);
prototype _SelectDongleXP(BYREF NUMBER);
prototype _FindAutoStartFolder(BYREF NUMBER);
prototype _SelectDongleServerDestination(BYREF NUMBER);
prototype _AddOrOverwrite(BYREF NUMBER);
prototype _ConfirmInstallation(BYREF NUMBER );
prototype _InstallData(BYREF NUMBER);
prototype _InstallInitialFiles(BYREF NUMBER);
prototype _InstallServerAutoStart(BYREF NUMBER);
prototype _ResetDongleServer(BYREF STRING);
prototype _RestoreDongleServer(STRING);
prototype _InstallDongleXP(BYREF NUMBER);
prototype _NewNetWorkPlace(BYREF NUMBER);
// first level
prototype _ExitOnConfirm( );
prototype _PerformSet(STRING);
prototype _DeleteFilesMinima();
prototype _InstallFilesMinima();
prototype _UpdateStartMenu( );
prototype _ChooseReinstall(BYREF NUMBER);
prototype _IsNetworkDrive(STRING, BYREF BOOL);
// 2nd level
prototype _CanOverwrite( );
prototype _FilesDiSistema( );
prototype _CambiaDirectory( );
prototype _CreateDLG( STRING, INT, LONG );
prototype _FineInstallazione( );
prototype _UpdateSysFiles( );
prototype _SetCampoIni();
prototype _CopiaADMININI( );
prototype _CopiaINSTALLINI( );
// **************
// utility
prototype _ShowExitDialog( NUMBER );
prototype _ForceAttrib4Dll( );
prototype _PreviewBatch( );
prototype _CercaFileOvunque( STRING ,BYREF STRING );
// **************
// utility
prototype _Verifica( STRING );
prototype _Errore( STRING );
prototype _Attenzione( STRING );
prototype _Informazione( STRING );
prototype _DeSlash( STRING, BYREF STRING );
prototype _TCPIPPresent( );
prototype _GetOSName( );
prototype _GetTmpDir(BYREF STRING );
prototype _DisattivaScreenSaver( );
prototype _RiattivaScreenSaver( );
prototype _Cambia_Attributi(STRING);
prototype _Check_Disk(STRING, STRING);
prototype _MostraModelessDialog( );
prototype _SettaModelessDialog( STRING );
prototype _NascondiModelessDialog( );
prototype _RichiediMemoria( NUMBER );
prototype _NToStringKB( NUMBER, BYREF STRING );

33
windows/install/licenza.txt Executable file
View File

@ -0,0 +1,33 @@
ACCORDO DI LICENZA SUL SOFTWARE
Ai termini ed alle condizioni che seguono, P@RTNERS S.p.A., in forza dei diritti di sfruttamento commerciale, si obbliga e concede in licenza d'uso al Cliente il prodotto di software corredato dalla documentazione d'uso. Pertanto P@RTNERS S.p.A. (di seguito indicata come Concedente), non vende alcun diritto per il proprio software, e mantiene ogni diritto su tutto il software distribuito.
Il Concedente da una parte ed il Cliente dall'altra, concordano quindi tra loro quanto segue:
L'installazione dei programmi contenuti in questo CD-ROM implica l'accettazione e l'osservanza dei termini specificati in questo accordo di licenza, tranne che per quanto concerne l'applicazione dell'art. 1341 C.C.
1. CONCESSIONE DI LICENZA. A fronte del pagamento del corrispettivo della licenza, compreso nel prezzo di acquisto di questo prodotto, e dell'accordo di osservanza dei termini e delle condizioni di questa licenza, il Concedente, cede all'Acquirente, il Licenziatario, un diritto non esclusivo all'utilizzo ed alla dimostrazione di questa copia di programma software (di seguito chiamato Software) su di un unico computer (dotato cioè di una sola unità centrale) ed in un'unica locazione per tutto il periodo di osservanza dei termini di questo accordo di licenza. Se il computer sul quale viene utilizzato il Software è un sistema multiutente, la licenza è valida per tutti gli utenti di quell'unico computer, senza esborso per ulteriori licenze. Il Concedente si riserva tutti i diritti non espressamente ceduti al Licenziatario.
2. PROPRIETA' DEL SOFTWARE. Come Licenziatario, l'acquirente è proprietario del supporto magnetico o fisico sul quale il Software è stato originariamente registrato, ma, in base al presente accordo, il Concedente mantiene la proprietà del Software registrato sulla copia (o copie) del CD-ROM originale e di tutte le copie di Software successive, indipendentemente dalla forma o dal supporto in cui vengono fornite le copie originali e quelle successive. La presente licenza non implica la vendita del Software originale o di qualsiasi eventuale copia successiva.
3. COPIE DI BACKUP. E' espressamente proibito effettuare copie non autorizzate del Software, ivi compreso Software modificato, combinato con altri, o allegato ad altro Software, o della documentazione. Il licenziatario è responsabile a tutti i fini legali per qualunque infrazione causata o incoraggiata dalla non osservanza dei termini di questa licenza.
Sulla base di quanto sopra, e posto che il Software non sia protetto contro la copia, è consentito effettuare una (1) copia del Software a soli scopi di backup.
4. UTILIZZO DEL SOFTWARE. In qualità di Licenziatario l'acquirente è autorizzato a trasferire fisicamente il Software da un computer all'altro a condizione che il suo utilizzo sia limitato ad un computer per volta. Non è consentito il trasferimento elettronico del Software da un computer all'altro tramite rete di comunicazione dati. È altresì vietata la distribuzione a terzi di copie del Software e della relativa documentazione. Il licenziatario non e' inoltre autorizzato alla modifica, traduzione, adattazione, reingegnerizzazione, decompilazione, disassemblaggio o alla creazione di applicazioni derivate basate sul Software. È altresì' vietato modificare, tradurre, adattare e creare applicazioni derivate basate sulla documentazione senza previo consenso scritto da parte del Concedente.
5. CESSIONE DEL SOFTWARE. Il Software viene ceduto in licenza unicamente al Licenziatario e non può essere ceduto a terzi senza previo consenso scritto da parte del Concedente. L'utente autorizzato all'utilizzo del Software è tenuto all'osservanza dei termini e delle condizioni espressi in questa licenza e nella garanzia limitata. In nessun caso è consentito cedere, assegnare, offrire in leasing, vendere o disporre in altro modo del Software su base permanente o provvisoria se non nei termini qui espressamente specificati.
6. DURATA. Il presente contratto resterà in vigore per un periodo di cinque (5) anni dalla data di acquisto riportata sulla ricevuta di acquisto. Alla fine di tale periodo, tale accordo sarà risolto. Questo contratto può anche essere risolto dal Concedente sulla base dell'art. 11 (clausola risolutiva espressa). Alla fine del rapporto, quale che ne sia la causa, tutto il materiale deve essere riconsegnato al Concedente oppure distrutto da parte del Licenziatario.
7. AGGIORNAMENTI. Il Concedente può produrre, di volta in volta, versioni aggiornate del Software che, a discrezione del Concedente, verranno messe a disposizione del Licenziatario e degli utenti autorizzati.
8. LEGGE APPLICABILE. La presente licenza e' soggetta alla legge italiana e verrà messa in vigore a beneficio del Concedente, dei suoi assegnatari e successori.
9. ATTESTAZIONE. Il Licenziatario attesta di aver scelto il Software corrispondente alle proprie necessità, di aver preso visione della relativa documentazione e del presente accordo. Egli riconosce che il presente accordo costituisce la totalità delle intese intercorse.
10. GARANZIA LIMITATA, MANUTENZIONE, RESPONSABILITA' ED ASSISTENZA. Il Concedente garantisce al Licenziatario originario che il CD-ROM sul quale e' registrato il Software è esente da difetti di materiale e di lavorazione nell'uso e nelle prestazioni normali per un periodo di novanta (90) giorni dalla data di consegna documentata da una copia della ricevuta.
Il Concedente non garantisce che il pacchetto Software funzioni correttamente in tutte le possibili combinazioni hardware/software. E' possibile che il programma non funzioni correttamente con versioni modificate del sistema operativo, con taluni programmi di "spooling" delle stampe o di utilità, o con stampanti fornite da Costruttori indipendenti.
Sebbene il Concedente abbia collaudato il Software e controllato la documentazione, non garantisce espressamente o implicitamente, per quel che riguarda questo Software o la sua documentazione, la loro qualità, le caratteristiche, la commerciabilità e l'utilizzo in particolari applicazioni.
Quindi questo Software e documentazione sono dati in licenza "come tali", e il licenziatario si assume tutti i rischi circa la loro qualità ed esecuzione.
In nessun caso il Concedente sarà responsabile per danni diretti, indiretti, particolari, incidentali o susseguenti, scaturiti dall'uso o dalla non capacita' d'uso del Software o della documentazione, anche se avvertita della possibilità di tali danni. In particolare il Concedente non avrà responsabilità per programmi e dati memorizzati, o utilizzati con suo Software, compresi i costi per il recupero di tali programmi o dati.
11. CLAUSOLA RISOLUTIVA ESPRESSA. Nel caso di inadempimento da parte del Licenziatario degli obblighi di cui all'art. 3 (divieto di effettuare copie), art. 4 (modi di utilizzo del Software, distribuzione a terzi di copie, traduzione, modifica, reingegnerizzazione, adattazione, decompilazione, disassemblaggio, creazione di applicazioni basate sul Software o sulla documentazione), art. 5 (cessione a terzi, leasing o locazione a terzi, atti di disposizione), il Concedente potrà ritenere automaticamente risolto il presente contratto senza avviso al Licenziatario.

BIN
windows/install/psetup.dll Executable file

Binary file not shown.

BIN
windows/install/setup.pkg Executable file

Binary file not shown.

232
windows/install/setup.rul Executable file
View File

@ -0,0 +1,232 @@
// File principale della installazione CAMPO
declare
// Windows API
#include "sddialog.h"
#include "WINSUB.H"
// Dichiarazioni di costanti per questo script
#include "DECLARE.RUL"
// File di include con gli ID dei dialog usati in questo script
#include "PRADIAGS.H"
NUMBER nHandle, nResult, nReinstall, nNewInstall;
STRING szText, szModifiedPath, szDongle, szInstType,szReinstallPath,szCampoIni;
BOOL bSetupStandard, bInstallModules, bInstallEnv, bInstallFirm, bInstallDemo, bInstallDemoData, bInstallNetWrk, bInstallNetWrkChk;
BOOL bInstallData, bInstallPrg, bUseDongleServer, bInstallServer, bXPServicesInstalled;
// Function declarations.
prototype _SetupScreen();
prototype _CheckRequirements();
//----------------------------------
NUMBER nDirection;
program
Step_start:
//---------------------------------- defaults
bSetupStandard = TRUE;
nReinstall = 0;
nNewInstall = 0;
bInstallPrg = TRUE;
bInstallData = FALSE;
bInstNTEutron = FALSE;
bInstNTHardlock = FALSE;
bCannotExecute = FALSE;
bXPServicesInstalled = FALSE;
_ProgramPrologue();
#define SPACE_REQUIRED 120000 // Disk space in bytes.
#ifdef __DEMO__
#define APP_NAME "CAMPO Demo"
#define PROGRAM_FOLDER_NAME "CAMPO Demo"
#else
#define APP_NAME "CAMPO"
#define PROGRAM_FOLDER_NAME "CAMPO"
#endif
#define APPBASE_PATH "\\"
#define COMPANY_NAME "A.G.A. Informatica srl"
#define PRODUCT_NAME "Campo"
#define PRODUCT_VERSION "2.0 "
#define DEINSTALL_KEY "SampleDeinstKey"
#define PRODUCT_KEY "ba0.exe"
#define DATATYPE_FILE "datatype."
Disable( BACKGROUND );
// Set installation info., which is required for registry entries.
InstallationInfo( COMPANY_NAME, PRODUCT_NAME, PRODUCT_VERSION, PRODUCT_KEY );
_SetupScreen();
Enable( DIALOGCACHE );
_CheckRequirements();
Step_welcome:
nDirection=0;
Disable( BACKBUTTON );
Welcome( "", 0 );
Enable( BACKBUTTON );
Step_setuptype:
_SelectSetupType(nDirection);
if (nDirection=BACK) then
goto Step_welcome;
endif ;
Step_license:
#ifndef __DEMO__
szText=SRCDIR ^ "licenza.txt";
nDirection=SdLicense( "","","",szText);
#endif
if nDirection=BACK then
goto Step_setuptype;
endif;
Step_chooseinst:
_SelectSetupMode(nDirection);
if (nDirection=BACK) then
goto Step_license;
endif ;
Step_choosewhere:
_SelectProgramDestination(nDirection);
if (nDirection=BACK) then
goto Step_chooseinst;
endif ;
Step_choosecomp:
_SelectWhatToInstall(nDirection);
if nDirection=BACK then
goto Step_choosewhere;
endif;
Step_netprg:
_SelectNetConfig(nDirection);
if (nDirection =BACK) then
goto Step_choosecomp;
endif;
Step_choosewhereD:
_SelectDataDestination(nDirection);
if nDirection=BACK then
goto Step_netprg;
endif;
Step_choosedata:
_SelectDataType(nDirection);
if nDirection=BACK then
goto Step_choosewhereD;
endif;
Step_chooseDongleServer:
_SelectDongleServer(nDirection);
if nDirection=BACK then
goto Step_choosedata;
endif;
Step_chooseNTDongle:
_SelectDongleXP(nDirection);
if nDirection=BACK then
goto Step_chooseDongleServer;
endif;
Step_whereDongleServer:
_FindAutoStartFolder(nDirection);
_SelectDongleServerDestination(nDirection);
if nDirection=BACK then
goto Step_chooseNTDongle;
endif;
if nDirection=NEXT then
if bInstallNetWrk then
goto Step_installnet;
endif;
endif;
// ***********************************
// * local installation
Step_newORupdate:
_AddOrOverwrite(nDirection);
if nDirection=BACK then
goto Step_whereDongleServer;
endif;
Step_confirm1:
_ConfirmInstallation(nDirection);
if nDirection=BACK then
goto Step_newORupdate;
endif;
Step_installData:
_InstallData(nDirection);
if (nDirection=BACK) then
goto Step_newORupdate;
endif;
Step_installPrg:
_InstallInitialFiles(nDirection);
if (nDirection=BACK) then
goto Step_newORupdate;
endif;
Step_installServerAutoStart:
_InstallServerAutoStart(nDirection);
if (nDirection=BACK) then
goto Step_newORupdate;
endif;
Step_LaunchBa1:
if bInstallModules then
ChangeDirectory(szAppPath);
_ResetDongleServer(szDongle);
LaunchAppAndWait("ba1.exe","-6 -uADMIN",WAIT);
_RestoreDongleServer(szDongle);
endif;
Step_LaunchServer:
if bInstallServer then
ChangeDirectory(szAppPath ^ "\\servers");
LaunchApp("Lerch.exe", "");
endif;
_ProgramEpilogue();
exit;
// ***********************************
// * network installation (CAMPO WST)
Step_installnet:
_ConfirmInstallation(nDirection);
if nDirection=BACK then
goto Step_whereDongleServer;
endif;
Step_installKeyServices:
_InstallDongleXP(nDirection);
if nDirection=BACK then
goto Step_whereDongleServer;
endif;
nStep_installData:
_InstallData(nDirection);
if (nDirection=BACK) then
goto Step_whereDongleServer;
endif;
Step_installwrkst:
_NewNetWorkPlace(nDirection);
if (nDirection=BACK) then
goto Step_whereDongleServer;
endif;
_ProgramEpilogue();
exit;
#include "setup1.rul"
#include "setup2.rul"
#include "setup3.rul"
#include "setup4.rul"
#include "winsub.rul"
#include "sddialog.rul"

1060
windows/install/setup1.rul Executable file

File diff suppressed because it is too large Load Diff

645
windows/install/setup2.rul Executable file
View File

@ -0,0 +1,645 @@
//________________________________________________________________________________________________________________________
// *** Compila il file Campo.ini
function _SetCampoIni( )
STRING szTmpPath[_MAX_LENGTH], szPrgPath[_MAX_LENGTH], szTestData, szTestProg;
NUMBER nPos;
begin
StrToLower (szTmpPath, szCampoIni);
nPos = StrFind(szTmpPath,"campo.ini");
StrSub (szPrgPath, szTmpPath, 0, nPos);
if ( CreateDir( szPrgPath ) < 0 ) then
_Errore( STR_DIR_NOTCREATED );
endif;
ChangeDirectory( szPrgPath);
// scrive le stesse cose nel file unico campo.ini , se esiste
szTmpPath=szPrgPath ^ "CAMPO.INI";
//non scrive nulla in caso di aggiornamento di una vecchia installazione
if (nReinstall <= 0) then
WriteProfString(szTmpPath, "Main", "MailTo","");
WriteProfString(szTmpPath, "Main", "MaxHandles","32");
WriteProfString(szTmpPath, "Main", "Program",szAppRefPath);
WriteProfString(szTmpPath, "Main", "Study",szDataPath);
WriteProfString(szTmpPath, "Main", "Firm","COM");
szTestData = "";
szTestProg = "";
//SOLO se e' una installazione locale puo' fare il test del database (con conversione!)
if (( ! bInstallNetWrkChk) && ( ! bInstallNetWrk )) then
szTestData = "X";
szTestProg = "N";
endif;
//se ho i programmi in locale ed idati in remoto posso fare l'aggiornamento dei programmi (NON dei dati)
if (bInstallNetWrkChk) then
szTestData = "N";
szTestProg = "X";
endif;
//in caso di campo wst (tutto in remoto) NON testi un tubo!
WriteProfString(szTmpPath, "Main", "TestDatabase",szTestData );
WriteProfString(szTmpPath, "Main", "TestPrograms",szTestProg );
endif;
if (bInstallPrg) then
if ((bUseDongleServer) && (!_TCPIPPresent())) then
szDongleServerName="";
_Attenzione("Impossibile utilizzare il server di rete delle autorizzazioni: \nprotocollo TCP-IP non rilevato");
endif;
WriteProfString(szTmpPath, "Server", "Dongle" , szDongleServerName);
endif;
szTmpPath=szPrgPath ^ "INSTALL.INI";
if (bInstallNetWrkChk) then
WriteProfString(szTmpPath, "Main", "DiskPath",szAppRefPath);
endif;
end;
//________________________________________________________________________________________________________________________
// **** Funzione per aggiornare i files di sistema in windows 95/98 (non + utilizzata dalla 2.0!)
function _UpdateSysFiles( )
NUMBER nNotModify, nGoOut, nRet, nInfo, nCurFiles, nLen, nNr;
STRING szTemp[_MAX_LENGTH], szWin_Ini[_MAX_LENGTH];
begin
if (!bNuovaInst) && (!bInstallNetWrk) then
return;
endif;
//serve solo per windows 95/98 e roba simile...
if (szOSName = "Windows NT") then
return;
endif;
nSystemFileModified = TRUE;
nNotModify = FALSE;
nInfo = FALSE;
nGoOut = FALSE;
SetDialogTitle(DLG_ASK_OPTIONS, "Modifica i files di sistema" );
Disable( BACKBUTTON );
SetDialogTitle(DLG_CANCEL, "Uscita" );
SetDialogTitle(DLG_OK, "Conferma" );
while (! nGoOut)
if (!bNuovaInst) then
nSystemFileModified=FALSE;
nNotModify=TRUE;
endif;
nRet = AskOptions(EXCLUSIVE, STR_MODSYSFILES, STR_MODIFY, nSystemFileModified, STR_NOTMODIFY, nNotModify, STR_INFOMODIFY, nInfo );
if nInfo then
// Mostra le informazioni
if _PreviewBatch( ) then
nSystemFileModified = TRUE;
else
nSystemFileModified = FALSE;
endif;
endif;
nGoOut = TRUE;
endwhile;
//se il numero di files e' insufficiente in config.sys -> propone di incrementarlo
VarSave(SRCTARGETDIR);
SRCDIR = "C:\\";
CopyFile( "CONFIG.SYS", "CONFIG.PRA" );
VarRestore(SRCTARGETDIR);
if (nSystemFileModified) then
ConfigSetFileName( "C:\\CONFIG.SYS" );
else
szTemp = TARGETDIR ^ "CONFIG.PRA";
ConfigSetFileName( szTemp );
endif;
EzConfigGetValue( "FILES", nCurFiles );
if nCurFiles < NUM_FILES_IN_CONFIG then
EzConfigSetValue( "FILES", NUM_FILES_IN_CONFIG );
endif;
if nSystemFileModified then
SprintfBox( WARNING, "Attenzione", STR_FILE_MODIFIED, TARGETDIR );
else
SprintfBox( WARNING, "Attenzione", STR_FILE_NOTMODIFIED, TARGETDIR );
endif;
end;
//________________________________________________________________________________________________________________________
// *** Funzione per cancellare i files minimi per il fascicolatore
function _DeleteFilesMinima( )
NUMBER pDataList, pProgramList, nFile, nFlag, nLen;
STRING szPath [ _MAX_LENGTH ], szFileName [ _MAX_LENGTH ], szFC [ 2 ], szLine [ _MAX_LENGTH ];
begin
if (!bNuovaInst) then
szPath=szAppPath ^ "install.ini";
GetProfString(szPath,"Main","Demo",szFC);
if szFC = "X" then
// cancella tutti gli eseguibili per evitare sovrapposizioni tra versione demo e normale
szPath=szAppPath;
nLen=FindAllFiles(szAppPath, "*.EXE", szFileName, RESET);
while (nLen=0 )
DeleteFile(szFileName);
nLen=FindAllFiles(szAppPath, "*.EXE", szFileName, CONTINUE);
endwhile;
endif;
endif;
end;
//________________________________________________________________________________________________________________________
// *** esegue effettivamente l'installazione dei files minimi di sistema (*.dll,*.vxd, parte della base necessaria a
// *** lanciare poi l'installatore c++)
function _InstallFilesMinima( )
NUMBER nRet, ntDisk, nHandle;
BOOL bRightDisk;
STRING szTemp [_MAX_LENGTH];
STRING szStatusText [_MAX_LENGTH];
begin
// Backup TARGETDIR to local variable
// Define fileset items
// --------------------- //
SetColor(STATUSBAR,BLUE);
Enable(FEEDBACK_OPERATION);
Enable(STATUS);
FileSetBeginDefine ( "WIN");
if (szOSName != "Windows NT") then
TARGETDIR = WINDIR ^ "SYSTEM";
if ( CompressGet( "WINSYS.Z", "*.*", INCLUDE_SUBDIR ) < 0) then
szText = STR_ERR_DECOMPRESS + " la libreria WINSYS.";
_Errore( szText );
endif;
endif;
FileSetEndDefine ( "WIN");
FileSetBeginDefine ( "BA");
TARGETDIR = szAppPath;
if ( CreateDir( TARGETDIR ) < 0 ) then
_Errore( STR_DIR_NOTCREATED );
else
if ( CompressGet( "SYS.Z", "*.*", INCLUDE_SUBDIR ) < 0) then
szText = STR_ERR_DECOMPRESS + " la libreria SYS.";
_Errore( szText );
endif;
szText = "BA.Z";
if ( CompressGet( szText, "*.*", INCLUDE_SUBDIR ) < 0) then
szText = STR_ERR_DECOMPRESS + " il programma installatore";
_Errore( szText );
endif;
if ( CompressGet( "RES.Z", "*.*", INCLUDE_SUBDIR ) < 0) then
szText = STR_ERR_DECOMPRESS + " il programma installatore";
_Errore( szText );
endif;
endif;
FileSetEndDefine ( "BA");
StrToUpper( szAppPath, szAppPath );
szStatusText = "Installazione su " + szAppPath;
StatusUpdate( ON, 50 );
SetStatusWindow( 0, "Installazione librerie ..." );
_PerformSet ( "WIN");
StatusUpdate( ON, 100 );
SetStatusWindow( 50, "Installazione programmi di ambiente .." );
_PerformSet ( "BA");
szTemp = szAppPath ^ "RecDesc";
CreateDir(szTemp);
szTemp = szAppPath ^ "Servers";
CreateDir(szTemp);
Disable(STATUS);
end;
//------------------------------------------------------------------------------------------------
function _PerformSet ( sFileset)
NUMBER nDisk;
BOOL bDone;
NUMBER nRet, ntDisk, nHandle;
BOOL bRightDisk;
STRING szTemp [_MAX_LENGTH];
STRING szTmp [_MAX_LENGTH];
STRING szFileName [_MAX_LENGTH];
STRING szExt [_MAX_LENGTH];
STRING szText [_MAX_LENGTH];
STRING szEntDisk [_MAX_LENGTH];
STRING szMsg [_MAX_LENGTH];
begin
bDone = FALSE;
nDisk = 1;
while ( !bDone )
nRet = FileSetPerformEz ( sFileset, 1);
switch ( nRet )
case FS_TONEXTDISK:
// non usato da FileSetPerformEz
if nDisk > 0 then
NumToStr( szExt, nDisk );
szEntDisk = STR_INSERTDISK + STR_TAGDISK1 + szExt;
szTemp = "diskid" ^ szExt;
SetDialogTitle ( DLG_ENTER_DISK, "Cambio disco" );
SetDialogTitle ( DLG_CANCEL, "Uscita" );
Suppress( ENTERDISK_ERRMSG, DISABLE );
bRightDisk = FALSE;
while( !bRightDisk )
nRet = EnterDisk( szEntDisk, szTemp );
switch( nRet )
case DISKID:
_Attenzione( "L'unita' indicata non e' valida." );
case BADPATH:
_Attenzione( "Il percorso indicato non e' valido." );
case DRIVEOPEN:
_Attenzione( "Inserire il disco nell'unita' indicata!" );
case BADTAGFILE:
_Attenzione( "Il disco inserito non e' corretto. Inserire il disco richiesto." );
case CANCEL:
_ExitOnConfirm( );
case OK:
bRightDisk = TRUE;
endswitch;
endwhile;
endif;
case FS_OPERROR:
Sprintf( szMsg, "E' stato rilevato un errore copiando il file %s. Il file non e' stato copiato.\n\nErrore FS_OPERROR.", ERRORFILENAME );
_Errore( szMsg );
case FS_GENERROR:
Sprintf( szMsg, "E' stato rilevato un errore copiando il file %s. Il file non e' stato copiato.\n\nErrore FS_GENERROR.", ERRORFILENAME );
_Errore( szMsg );
case FS_TARGETREADONLY:
szMsg="Impossibile scrivere nella directory di destinazione.";
_Errore( szMsg );
case FS_INCORRECTDISK:
_Attenzione( "Disco non valido.\n\nInserire il disco corretto." );
case FS_DISKONEREQUIRED:
szEntDisk = STR_INSERTDISK + STR_TAGDISK1;
_Attenzione( szEntDisk );
case FS_RESETREQUIRED:
_Errore( "Impossibile copiare il file a causa di un errore interno." );
case FS_OUTOFSPACE:
szMsg= "Lo spazio su disco non e' stato sufficiente per completare la copia dei files.\n\nErrore FS_OUTOFSPACE.";
_Errore( szMsg );
case FS_DONE:
bDone = TRUE;
default :
if ( nRet < 0 ) then
szMsg = "Si e' verificato un errore copiando e decomprimendo il file " ^ ERRORFILENAME;
_Errore( szMsg );
endif;
endswitch;
endwhile;
FileSetEndPerform ( sFileset);
end;
//_______________________________________________________________________________________________________________________
// *** aggiorna il menu dei programmi di windows, aggiungendovi la directory del programma ed il link a ba0.exe
function _UpdateStartMenu( )
STRING szItemName [_MAX_LENGTH],
szFolder [_MAX_LENGTH],
szCmdLine [_MAX_LENGTH],
szIconPath [_MAX_LENGTH],
szWorkingDir[_MAX_LENGTH];
begin
Enable( HOURGLASS );
// Mostra Program Manager
AppCommand( PROGMAN, CMD_RESTORE );
// Aggiunge il gruppo di programmi ed i programmi
szFolder="CAMPO";
ShowGroup (szFolder , SW_NORMAL );
if ( TRUE) then
// Aggiunge CAMPO Program Manager
if bInstallDemo then
szItemName = "CAMPO Demo";
elseif bInstallNetWrk then
szItemName = "CAMPO WST";
else
szItemName = "CAMPO";
endif;
szCmdLine = szAppPath ^ "\\BA0.EXE";
szIconPath = szCmdLine;
AddFolderIcon( szFolder, szItemName, szCmdLine, "", szIconPath, 0, "", REPLACE );
//AddProgItemEx ( szFolder, szItemName, szCmdLine, "", szIconPath, 0, "", REPLACE );
endif;
AppCommand( PROGMAN, CMD_MINIMIZE );
Disable( HOURGLASS );
end;
//-----------------------------------------------------------------------------
function _CambiaDirectory( )
STRING szText[ _MAX_LENGTH ];
STRING szModifiedPath[ _MAX_LENGTH ];
STRING szUserSelectedDrive[ _MAX_LENGTH ];
STRING szIncorrectPath[ _MAX_LENGTH ];
begin
szText = STR_TEXT1;
SetDialogTitle( DLG_ASK_PATH, "Directory per installare i programmi" );
if ( AskPath( szText , szAppPath, szModifiedPath ) = OK ) then
StrToUpper( szModifiedPath, szModifiedPath );
GetDisk( szModifiedPath, szUserSelectedDrive );
if ( Is ( VALID_PATH, szModifiedPath ) = 1 ) then
if szAppPath != szModifiedPath then
szAppPath = szModifiedPath;
szDataPath = szAppPath ^ "DATI\\";
endif;
szText = STR_DATATEXT1;
SetDialogTitle( DLG_ASK_PATH, "Directory per installare i dati" );
if ( AskPath( szText , szDataPath, szModifiedPath ) = OK ) then
StrToUpper( szModifiedPath, szModifiedPath );
GetDisk( szModifiedPath, szUserSelectedDrive );
if ( Is ( VALID_PATH, szModifiedPath ) = 1 ) then
szDataPath = szModifiedPath;
else
szIncorrectPath = STR_INVALID_PATH + "\n" + szModifiedPath;
_Attenzione( szIncorrectPath );
endif;
endif;
endif;
endif;
end;
//________________________________________________________________________________________________________________________
// *** copia il file ADMIN.INI nella directory config che sta sotto la directory dati
function _CopiaADMININI( )
STRING szPath[_MAX_LENGTH], szFileName[_MAX_LENGTH], szLine[ _MAX_LENGTH], szFC[ 2 ], szTmp[ _MAX_LENGTH];
NUMBER nFlag, nFileIn, nFileOut, nLoop;
begin
szPath = szDataPath ^ "CONFIG";
szTmp = szPath ^ "ADMIN.INI";
if ( ! Is( FILE_EXISTS, szTmp ) ) then
if ExistsDir( szPath ) = NOTEXISTS then
if ( CreateDir( szPath ) < 0 ) then
_Errore( "Impossibile creare la directory CONFIG sotto i dati!" );
endif;
endif;
szFileName = "ADMIN.INI";
OpenFileMode( FILE_MODE_APPEND );
CreateFile( nFileOut, szPath, szFileName );
OpenFileMode( FILE_MODE_NORMAL );
szPath = szAppPath;
OpenFile( nFileIn, szPath, szFileName );
nFlag = GetLine( nFileIn, szLine );
while( nFlag = 0 )
if szLine = "[Colors]" then
nLoop = 0;
while( nLoop = 0 )
WriteLine( nFileOut, szLine );
nFlag = GetLine( nFileIn, szLine );
nLoop = nFlag;
if ( nLoop = 0 ) then
StrSub( szFC, szLine, 0, 1 );
if ( szFC != "[" ) then
nFlag = GetLine( nFileIn, szLine );
else
nLoop = 1;
endif;
endif;
endwhile;
else
if szLine = "[Font]" then
nLoop = 0;
while( nLoop = 0 )
WriteLine( nFileOut, szLine );
nFlag = GetLine( nFileIn, szLine );
nLoop = nFlag;
if ( nLoop = 0 ) then
StrSub( szFC, szLine, 0, 1 );
if ( szFC != "[" ) then
nFlag = GetLine( nFileIn, szLine );
else
nLoop = 1;
endif;
endif;
endwhile;
else
nFlag = GetLine( nFileIn, szLine );
endif;
endif;
endwhile;
CloseFile( nFileIn );
CloseFile( nFileOut );
endif;
end;
//________________________________________________________________________________________________________________________
// *** copia il file "install.ini"
function _CopiaINSTALLINI( )
STRING szPath[_MAX_LENGTH], szFileName[_MAX_LENGTH], szLine[ _MAX_LENGTH], szFC[ 2 ], szTmp[ _MAX_LENGTH];
STRING szSrcPath[_MAX_LENGTH];
NUMBER nFlag, nFileOut, nLoop;
begin
// corregge il path dei dati in base all'installazione da dischetto o CD (o installazione di rete)
szSrcPath = SRCDIR ;
ParsePath(szPath,szSrcPath,DIRECTORY);
//controlla la lunghezza della stringa del path (szPath): se >= 7 ->installazione da CD o rete
//con immagini dei dischetti su DISK1, DISK2 ,...; se su CD/rete ->trimma la stringa del path in
//modo che resti solo \DISK1
if (StrLength(szPath) >= 7) then
StrSub(szTmp , szPath, (StrLength(szPath) - 7) ,6 );
nFileOut=StrFind(szTmp, "DISK");
if nFileOut>=0 then
StrSub(szPath, szSrcPath ,0, StrLength(szSrcPath)- 7 + nFileOut);
szSrcPath = szPath;
endif;
endif;
//dopo aver completato la scrittura del path dei sorgenti di installazione (szSrcPath) gli aggiunge
//la directory dei files compressi (zip se installazione normale, zipdemo se demo)
if bInstallDemo then
szSrcPath= szSrcPath ^ ZIPDEMO_DIRECTORY;
else
szSrcPath= szSrcPath ^ ZIP_DIRECTORY;
endif;
//quindi crea il nome completo di path dell'install.ini che si trova nella directory dei files compressi
//che si vogliono scompattare..
szFileName = szSrcPath ^ "INSTALL.INI";
//..e trasforma szPath in .\install.ini (attualmente szAppPath é ignota)
szPath= szAppPath ^ "INSTALL.INI";
//scrive delle "profile strings" nell'install.ini
//scrive nel paragrafo [Main] il "DiskPath"=szSrcPath, il Producer, il DiskSize, la Versione
//ACHTUNG! questo é l'install.ini che finisce nel root, con Versione=0; infatti szPath vale .\install.ini
WriteProfString(szPath,"Main","DiskPath",szSrcPath);
GetProfString(szFileName,"Main","Producer",szTmp);
WriteProfString(szPath,"Main","Producer",szTmp);
if bInstallDemo then
szTmp = "X";
else
szTmp = " ";
endif;
szPath=szAppPath ^ "install.ini";
if WriteProfString(szPath,"Main","Demo",szTmp) < 0 then
_Attenzione("Impossibile scrivere il tipo della versione su install.ini");
endif;
end;
//________________________________________________________________________________________________________________________
// *** Crea un lista delle precedenti installazioni memorizzate nel file Campo.stp e genera
//una option box con la lista,per lasciare scegliere all'utente quale installazione aggiornare
function _ChooseReinstall(nRetv)
LIST list;
NUMBER nPar,i;
STRING szInst,szIni,szPar,szComponents;
begin
list = ListCreate(STRINGLIST);
szPar = "1";
nPar = 1;
while (GetProfString("C:\\Campo.stp", szPar, "Program", szInst) = 0)
//controlla se la precedente installazione e' di tipo campo wst
if (GetProfString("C:\\Campo.stp", szPar, "CampoIni", szIni) = 0) then
i = StrFind(szIni,"\\campo.ini");
StrSub(szInst, szIni, 0, i);
if (!Is( FILE_EXISTS, szIni)) then
szInst = szInst ^ " (RIMOSSA)";
endif;
else
if (!Is( FILE_EXISTS, szInst ^ "\\campo.aut")) then
szInst = szInst ^ " (RIMOSSA)";
endif;
endif;
ListAddString(list, szInst, AFTER);
nPar = nPar + 1;
NumToStr(szPar, nPar);
endwhile;
szComponents = "Installazioni precedenti";
//crea la lista delle installazioni precedenti
i = ListGetFirstString(list,szInst);
while (i = 0)
ComponentAddItem(szComponents, szInst, 0, szPar="1");
i = ListGetNextString(list,szInst);
endwhile;
nRetv = SdAskOptions("Installazioni precedenti", "Selezionare l'installazione da aggiornare", "",
"", szComponents, EXCLUSIVE);
nReinstall = 0;
if (nRetv = NEXT) then
nPar = 1;
i = ListGetFirstString(list,szInst);
while (i = 0)
if (ComponentIsItemSelected(szComponents, szInst)) then
if (StrFind(szInst, "(RIMOSSA)") < 0) then
szReinstallPath = szInst;
nReinstall = nPar;
endif;
endif;
nPar = nPar+1;
i = ListGetNextString(list,szInst);
endwhile;
endif;
end;
//________________________________________________________________________________________________________________________
// *** crea una lista con le unita' disco del computer, scegliendo poi quelle di rete (remote_drive)
function _IsNetworkDrive(szPath, bRetval)
STRING szDisk;
NUMBER list, nCheck;
begin
bRetval = FALSE;
if (GetDisk(szPath, szTmp) < 0) then
return;
endif;
StrSub(szDisk,szTmp,0,1);
list = ListCreate(STRINGLIST);
if (GetValidDrivesList(list, REMOTE_DRIVE, -1) < 0) then
ListDestroy(list);
return;
endif;
nCheck = ListGetFirstString(list, szTmp);
while (nCheck = 0 && ! bRetval)
if (szTmp = szDisk) then
bRetval = TRUE;
endif;
nCheck = ListGetNextString(list, szTmp);
endwhile;
ListDestroy(list);
end;
//________________________________________________________________________________________________________________________
// *** inizializza l'installazione
function _ProgramPrologue()
begin
_GetOSName( ); // Reperisce il nome del sistema operativo in szOSName
SetDialogTitle (DLG_ASK_OPTIONS, "Seleziona i componenti");
SetDialogTitle (DLG_ASK_TEXT, "");
SetDialogTitle (DLG_ASK_YESNO, "Domanda");
SetDialogTitle (DLG_ENTER_DISK, "Setup ha bisogno del prossimo disco");
SetDialogTitle (DLG_MSG_INFORMATION, "Messaggio");
SetDialogTitle (DLG_MSG_SEVERE, "Errore fatale");
SetDialogTitle (DLG_MSG_WARNING, "Attenzione");
SetDialogTitle( DLG_ASK_PATH, "Scelta direttorio" );
_DisattivaScreenSaver( ); // Disabilita lo screen-saver
end;
//________________________________________________________________________________________________________________________
// *** termina l'installazione
function _ProgramEpilogue()
begin
_FineInstallazione( );
_RiattivaScreenSaver( );
end;

278
windows/install/setup3.rul Executable file
View File

@ -0,0 +1,278 @@
//---------------------------------------------------------------------------------------
function _CheckRequirements()
number nvDx, nvDy;
number nvVersion;
STRING szResult;
begin
// Check screen resolution.
GetExtents( nvDx, nvDy );
if (nvDy < 480) then
MessageBox( "Questo programma richiede un video VGA o superiore.", WARNING );
exit;
endif;
end;
//-----------------------------------------------------------------------------
function _SetupScreen()
number nDx, nDy;
begin
GetExtents( nDx, nDy );
Enable( FULLWINDOWMODE );
Enable( INDVFILESTATUS );
Enable( BITMAP256COLORS );
Enable( DIALOGCACHE );
SetTitle( "Installazione di " + APP_NAME, 24, WHITE );
SetColor( BACKGROUND, BK_BLUE ); // Dark blue.
SetColor( STATUSBAR, BLUE ); // Bright blue.
SetTitle( "Setup", 0, BACKGROUNDCAPTION ); // Caption bar text.
Enable( BACKGROUND );
Delay( 1 );
end;
//-----------------------------------------------------------------------------
function _ShowExitDialog( nDLGID )
NUMBER nGoOut, nRet, nHwnd;
begin
_CreateDLG ( "DLG_TMP", nDLGID, HWND_INSTALL );
nGoOut = FALSE;
while nGoOut = FALSE
nRet = WaitOnDialog( "DLG_TMP");
if ( nRet = DLG_ERR ) then
_Attenzione( STR_ERR_DLG );
nGoOut = TRUE;
endif;
switch( nRet )
case IDD_CONTINUE:
nGoOut = TRUE;
case DLG_CLOSE:
nGoOut = TRUE;
endswitch;
endwhile;
EndDialog( "DLG_TMP" );
ReleaseDialog( "DLG_TMP" );
end;
//__________________________________________________________________________________________________
function _FindExistingInst(szPrevPath )
begin
if (! bInstallNetWrk) then //modifica del 04-06-2003;tolta la ricerca local inst in caso di campo wst
_CercaFileOvunque( "CAMPO.AUT",szPrevPath);
endif;
if (szPrevPath!="") then
ParsePath(szPrevPath,szPrevPath,PATH);
return TRUE;
else
return FALSE;
endif;
end;
//__________________________________________________________________________________________________
function _CheckExistingInst(szPrevPath )
begin
szPrevPath = szPrevPath ^ "campo.ini";
return Is( FILE_EXISTS, szPrevPath );
end;
//__________________________________________________________________________________________________
function _CheckExistingData(szDataPath )
begin
szDataPath = szDataPath ^ "COM\\";
return Is( PATH_EXISTS, szDataPath );
end;
//________________________________________________________________________________________________________________________
// *** propone i cambiamenti al file config.sys (files = ...) in caso di win 95/98
function _PreviewBatch( )
NUMBER nFile, nGoOut, nRet, pList, nFlag, nCurFiles, nNr;
STRING szConf, szTemp, szTemp1;
begin
_CreateDLG( "DLG_BATCH", 110, HWND_INSTALL );;
szConf = "";
EzConfigGetValue( "FILES", nCurFiles );
if nCurFiles < NUM_FILES_IN_CONFIG then
szConf = szConf + "FILES=";
NumToStr( szTemp, NUM_FILES_IN_CONFIG );
szConf = szConf + szTemp;
szConf = szConf + "\n";
endif;
if szConf = "" then
szConf = "Nessuna modifica.";
endif;
nGoOut = FALSE;
while nGoOut = FALSE
nRet = WaitOnDialog( "DLG_BATCH");
if ( nRet = DLG_ERR ) then
_Attenzione( STR_ERR_DLG );
nGoOut = TRUE;
endif;
switch( nRet )
case DLG_INIT:
CtrlSetText( "DLG_BATCH", 20, szConf );
case IDD_CONTINUE:
nRet = TRUE;
nGoOut = TRUE;
case 2:
nRet = FALSE;
nGoOut = TRUE;
case DLG_CLOSE:
nGoOut = TRUE;
endswitch;
endwhile;
EndDialog( "DLG_BATCH" );
ReleaseDialog( "DLG_BATCH" );
return nRet;
end;
//-----------------------------------------------------------------------------
// Funzione che mostra un dialog box di benvenuto
function _Benvenuto( )
NUMBER nGoOut, nRet, nHwnd;
begin
_CreateDLG( "DLG_WELCOME", DLG_WELCOME, HWND_INSTALL );
nGoOut = FALSE;
while nGoOut = FALSE
nRet = WaitOnDialog( "DLG_WELCOME");
if ( nRet = DLG_ERR ) then
_Attenzione( STR_ERR_DLG );
nGoOut = TRUE;
endif;
switch( nRet )
case IDD_EXIT:
_ExitOnConfirm( );
case IDD_CONTINUE:
nGoOut = TRUE;
case DLG_CLOSE:
nGoOut = TRUE;
endswitch;
endwhile;
EndDialog( "DLG_WELCOME" );
ReleaseDialog( "DLG_WELCOME" );
end;
//________________________________________________________________________________________________________________________
// *** // Forza gli attributi delle DLL per evitare che siano di sola lettura
function _ForceAttrib4Dll( )
begin
szTmp = szAppPath ^ "cb6.dll";
_Cambia_Attributi(szTmp);
szTmp = szAppPath ^ "gfm.dll";
_Cambia_Attributi(szTmp);
szTmp = szAppPath ^ "xidll.dll";
_Cambia_Attributi(szTmp);
szTmp = szAppPath ^ "xvaga.dll";
_Cambia_Attributi(szTmp);
szTmp = szAppPath ^ "wxmsw240.dll";
_Cambia_Attributi(szTmp);
end;
//-----------------------------------------------------------------------------
// chiede conferma per l'uscita ed esce
function _ExitOnConfirm( )
begin
if ! _Verifica( "Desideri veramente terminare la installazione ?" ) then
return;
endif;
_ShowExitDialog( DLG_EXITQUIT );
exit;
end;
//-----------------------------------------------------------------------------
function _FineInstallazione( )
STRING szRunProgram[ _MAX_LENGTH ];
LONG lGoOut, lRet, lHwnd, lFlag;
begin
_CreateDLG( "DLG098", ID_DLG098, HWND_INSTALL );
lGoOut = FALSE;
while lGoOut = FALSE
lRet = WaitOnDialog("DLG098");
if ( lRet = DLG_ERR ) then
_Attenzione( STR_ERR_DLG );
lGoOut = TRUE;
endif;
switch( lRet )
case DLG_INIT:
lHwnd = CmdGetHwndDlg( "DLG098" );
if nSystemFileModified then
CtrlSetText( "DLG098", ID_DLG098_RUN, "Riavvia il computer" );
CtrlSetText( "DLG098", 1004, "I files di sistema sono cambiati.\nOccorrera' riavviare il computer perche' le modifiche siano attive." );
endif;
case ID_DLG098_RUN:
lFlag = FALSE;
lGoOut = TRUE;
case ID_DLG098_EXIT:
lFlag = TRUE;
lGoOut = TRUE;
case DLG_CLOSE:
lGoOut = TRUE;
endswitch;
endwhile;
EndDialog( "DLG098" );
ReleaseDialog( "DLG098" );
if ( lFlag = FALSE ) then
if nSystemFileModified then
System( SYS_BOOTMACHINE );
else
// ChangeDirectory(szAppPath);
// szRunProgram = szAppPath ^ "\\BA1.EXE -0 C";
// LaunchApp( szRunProgram , "" );
endif;
return TRUE;
else
return FALSE;
endif;
end;
//------------------------------------------------------------------------------------------------------------------------
function _CanOverwrite( )
BOOL bRetv;
NUMBER nTemp;
STRING szPath[256],szTemp[80],szJunk[80];
begin
bRetv=FALSE;
szPath=szDataPath ^ "\\CONFIG";
szTemp=szPath ^ DATATYPE_FILE;
if ( Is( FILE_EXISTS, szTemp ) ) then
OpenFileMode( FILE_MODE_NORMAL );
OpenFile( nTmp, szPath, DATATYPE_FILE);
if GetLine( nTmp, szTemp ) = 0 then
if szTemp = INST_DEMO then
bRetv=_Verifica("Il direttorio indicato contiene dati \ndi una precedente installazione demo.\n\nConfermi la sovrascrittura");
elseif szTemp = INST_AUTOFORM then
if szInstType = INST_ENVIRONMENT || szInstType = INST_AUTOFORM then
bRetv=_Verifica("Il direttorio indicato contiene i dati \ndi una precedente installazione di autoformazione.\n\nConfermi la sovrascrittura");
else
MessageBox("Impossibile scrivere i dati nel direttorio indicato.\nIl direttorio contiene gia' i dati di una precedente installazione \ndi autoformazione.",SEVERE);
endif;
else
MessageBox("Impossibile scrivere i dati nel direttorio indicato.\nIl direttorio contiene gia' i dati di una precedente installazione.",SEVERE);
endif;
else
MessageBox( "Il direttorio indicato contiene dati \ndi una precedente installazione.",SEVERE);
endif;
CloseFile( nTmp );
else
MessageBox( "Impossibile installare. Il direttorio indicato contiene dati \ndi una precedente installazione.",SEVERE);
endif;
return bRetv;
end;

238
windows/install/setup4.rul Executable file
View File

@ -0,0 +1,238 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// UTILITY VARIE
//-----------------------------------------------------------------------------
function _Errore( szErrorString )
begin
SetDialogTitle( DLG_MSG_SEVERE, "Errore fatale!" );
MessageBox( szErrorString, SEVERE );
_ShowExitDialog( DLG_EXITFAILURE );
exit;
end;
//-----------------------------------------------------------------------------
function _Attenzione( szWarningString )
begin
SetDialogTitle( DLG_MSG_WARNING, "Attenzione!" );
MessageBox( szWarningString, WARNING );
end;
//-----------------------------------------------------------------------------
function _Informazione( szWarningString )
begin
SetDialogTitle( DLG_MSG_WARNING, "Attenzione!" );
MessageBox( szWarningString, INFORMATION);
end;
//-----------------------------------------------------------------------------
function _Verifica( szQuestion )
NUMBER nRet;
begin
SetDialogTitle( DLG_ASK_YESNO, "Verifica" );
nRet = AskYesNo( szQuestion, NO );
return nRet;
end;
//-----------------------------------------------------------------------------
function _MostraModelessDialog( )
NUMBER nHwnd, nRet, nMess;
begin
_CreateDLG ( "DLG_PLEASEWAIT", DLG_PLEASEWAIT, HWND_INSTALL );
nMess = WaitOnDialog( "DLG_PLEASEWAIT" );
if ( nMess = DLG_ERR ) then
_Attenzione( STR_ERR_DLG );
endif;
nHwnd = CmdGetHwndDlg( "DLG_PLEASEWAIT" );
nRet = ShowWindow ( nHwnd, 1 );
if ( nRet = -1 ) then
_Attenzione( "Errore in ShowWindow" );
endif;
end;
//-----------------------------------------------------------------------------
function _SettaModelessDialog( szText )
begin
CtrlSetText( "DLG_PLEASEWAIT", IDD_MLTEXT, szText );
end;
//-----------------------------------------------------------------------------
function _NascondiModelessDialog( )
begin
EndDialog( "DLG_PLEASEWAIT" );
ReleaseDialog( "DLG_PLEASEWAIT" );
end;
//-----------------------------------------------------------------------------
// Funzione che termina se la quantità di memoria è minore di quella richiesta
function _RichiediMemoria( nReq )
NUMBER nExMem;
STRING szExMem[_MAX_LENGTH];
begin
GetSystemInfo( EXTENDEDMEMORY, nExMem, szExMem );
if nReq >= nExMem then
_Errore( STR_NOTENUFEXMEM );
endif;
end;
//-----------------------------------------------------------------------------
function _NToStringKB( nKB, szValue )
begin
NumToStr( szValue, nKB );
szValue = szValue + " Kb";
end;
//-----------------------------------------------------------------------------
function _DeSlash( szSource, szDest )
NUMBER nLen;
STRING szTemp;
begin
nLen = StrLength( szSource );
StrSub( szTemp, szSource, nLen - 1, 1 );
if szTemp = "\\" then
StrSub( szDest, szSource, 0, nLen - 1 );
else
szDest = szSource;
endif;
end;
//-----------------------------------------------------------------------------
function _CercaFileOvunque( szNomeFile, szRet )
NUMBER nRet1, nRet2, listDirs, listDrive;
STRING szDir[_MAX_LENGTH], szMLText[_MAX_LENGTH], szDrive[_MAX_LENGTH];
begin
_MostraModelessDialog( );
listDrive = ListCreate( STRINGLIST );
if ( listDrive = LIST_NULL ) then
_Errore( "Errore fatale in ListCreate(listDrive)" );
_NascondiModelessDialog( );
endif;
if ( GetValidDrivesList( listDrive, FIXED_DRIVE, 0 ) < 0 ) then
_Errore( "Errore fatale in GetValidDriveList" );
_NascondiModelessDialog( );
endif;
nRet1 = ListGetFirstString( listDrive, szDrive );
while ( nRet1 != END_OF_LIST )
szMLText = "Verifica di una precedente installazione sul drive " + szDrive + ": ...";
// szMLText = szMLText;
_SettaModelessDialog( szMLText );
szDrive = szDrive + ":\\";
if ( FindAllFiles( szDrive, szNomeFile, szRet, RESET ) = 0 ) then
_NascondiModelessDialog( );
return;
endif;
nRet1 = ListGetNextString( listDrive, szDrive );
endwhile;
ListDestroy( listDrive );
_NascondiModelessDialog( );
szRet = "";
return;
end;
//-----------------------------------------------------------------------------
function _DisattivaScreenSaver( )
begin
bSCREENSAVER = _WinSubCheckScreenSaver( );
_WinSubScreenSaver( FALSE );
end;
//-----------------------------------------------------------------------------
function _RiattivaScreenSaver( )
begin
if bSCREENSAVER then
_WinSubScreenSaver( TRUE );
endif;
end;
//________________________________________________________________________________________________________________________
// *** Reperisce il nome del sistema operativo
function _GetOSName( )
NUMBER nResult;
STRING szResult;
STRING szCheckDir[255];
begin
VarSave(SRCTARGETDIR);
TARGETDIR = WINSYSDIR;
GetSystemInfo(WINMAJOR,nResult,szResult);
bIsWin95 = FALSE;
if(GetSystemInfo(OS,nResult,szOSName) < 0) then
MessageBox("Couldn't get Operating System info",WARNING);
else
// attenzione: con la nascita di win2000 é sorto un pó di casino: infatti non é previsto da installshield3; inoltre, pur
// essendo una evoluzione di WinNT non sempre presenta la cartella C:\winnt (27/06/2000); quindi si é resa necessaria la
// ricerca della directory che contiene il sistema operativo (Windows2000, ovviamente) e, all'interno di essa, la directory
// pwls che contiene i files degli utenti del sistema win2000 (tale directory non é infatti presente in altre versioni di
// Windows (per ora...)) (05/12/2000)
// Nuova puntata! Adesso c'é pure il terribile Win2000 server che, ovviamente, non ha la directory pwls sotto la sua
// directory principale! Quindi, se non viene trovata la pwls si cerca la directory windirectory\system32\ras, che é tipica
// dei sistemi windowsNT/2000 (c'é quindi sia sul client che sul server); per ora funziona, ma in futuro...? (20/02/2001)
if (nResult=IS_WINDOWS95) then
szCheckDir = WINDIR ^ "pwls";
if (Is(PATH_EXISTS, szCheckDir)=TRUE) then
nResult=IS_WINDOWSNT;
else
szCheckDir = WINSYSDIR ^ "../system32/ras";
if (Is(PATH_EXISTS, szCheckDir)=TRUE) then
nResult=IS_WINDOWSNT;
endif;
endif;
endif;
switch(nResult)
case IS_WINDOWSNT:
szOSName="Windows NT";
case IS_WINDOWS95:
szOSName="Windows 95";
bIsWin95 = TRUE;
endswitch;
endif;
VarRestore(SRCTARGETDIR);
end;
//-----------------------------------------------------------------------------
// Reperisce il nome del sistema operativo
function _GetTmpDir(szResult )
STRING szTemp;
begin
szTemp=SUPPORTDIR;
szResult =szTemp;
end;
//-----------------------------------------------------------------------------
function _CreateDLG( szDLG, iDLG_ID, lHwnd )
STRING szSupportDLL [ _MAX_LENGTH ];
begin
szSupportDLL = SUPPORTDIR ^ "\\PSETUP.DLL";
if ( DefineDialog( szDLG, 0 , szSupportDLL, iDLG_ID, "", HWND_DESKTOP, lHwnd, DLG_MSG_STANDARD | DLG_CENTERED ) ) then
_Errore( "Errore interno. Impossibile creare una finestra di dialogo.\nInstallazione terminata." );
endif;
end;
//---------------------------------------------------------------------------------------------------------------------
function _Cambia_Attributi(szS0)
STRING szS1[_MAX_LENGTH];
begin
if ( Is( FILE_EXISTS, szS0 ) ) then
if (SetFileInfo(szS0,FILE_ATTRIBUTE,FILE_ATTR_NORMAL|FILE_ATTR_ARCHIVED,"") < 0) then
szS1 = "Impossibile cambiare i permessi ad " ^ szS0;
MessageBox(szS1,WARNING);
endif;
endif;
end;
//----------------------------------------------------------------------------------------------------------------------
function _TCPIPPresent()
NUMBER nvResult;
begin
if (UseDLL("winsock.dll")=0) then
UnUseDLL("winsock.dll");
nvResult =TRUE;
else
nvResult =FALSE;
endif;
return nvResult;
end;