diff --git a/windows/install/_setup.dll b/windows/install/_setup.dll new file mode 100755 index 000000000..b143b8f18 Binary files /dev/null and b/windows/install/_setup.dll differ diff --git a/windows/install/_setup.lib b/windows/install/_setup.lib new file mode 100755 index 000000000..9bc8b3578 Binary files /dev/null and b/windows/install/_setup.lib differ diff --git a/windows/install/declare.rul b/windows/install/declare.rul new file mode 100755 index 000000000..306846ce3 --- /dev/null +++ b/windows/install/declare.rul @@ -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 ); + diff --git a/windows/install/licenza.txt b/windows/install/licenza.txt new file mode 100755 index 000000000..d3746e2c9 --- /dev/null +++ b/windows/install/licenza.txt @@ -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. diff --git a/windows/install/psetup.dll b/windows/install/psetup.dll new file mode 100755 index 000000000..f7fc40071 Binary files /dev/null and b/windows/install/psetup.dll differ diff --git a/windows/install/setup.pkg b/windows/install/setup.pkg new file mode 100755 index 000000000..209f0d915 Binary files /dev/null and b/windows/install/setup.pkg differ diff --git a/windows/install/setup.rul b/windows/install/setup.rul new file mode 100755 index 000000000..cf94314c5 --- /dev/null +++ b/windows/install/setup.rul @@ -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" + diff --git a/windows/install/setup1.rul b/windows/install/setup1.rul new file mode 100755 index 000000000..050400b6a --- /dev/null +++ b/windows/install/setup1.rul @@ -0,0 +1,1060 @@ +//________________________________________________________________________________________________________________________ +// **** Selezione del tipo di installazione (1st level) +// **** Aggiornamento,installazione standard,installazione avanzata + +function _SelectSetupType(nRetv ) + + STRING szMsg[512]; + BOOL bJunk,bReinstall; +begin + +#ifdef __DEMO__ + bSetupStandard=TRUE; +#else + bJunk = !bSetupStandard; + +//cerca il file con eventuali precedenti installazioni (campo.stp) + if (Is( FILE_EXISTS, "C:\\Campo.stp" )) then + bSetupStandard = FALSE; + bReinstall = TRUE; + nRetv = AskOptions(EXCLUSIVE,"Si desidera effettuare:", + "Aggiornamento di una precedente installazione",bReinstall, + "Installazione &STANDARD (scelta consigliata)",bSetupStandard, + "Installazione &personalizzata e/o di rete",bJunk); + if (nRetv != BACK && bReinstall) then + _ChooseReinstall(nRetv); + endif; + + else + nRetv = AskOptions(EXCLUSIVE,"Si desidera effettuare:", + "Installazione &STANDARD (scelta consigliata)",bSetupStandard, + "Installazione &personalizzata e/o di rete",bJunk); + endif; + +#endif +end; + +//________________________________________________________________________________________________________________________ +// **** Selezione del tipo di installazione (2nd level) +// **** (programmi o postazione di rete) + +function _SelectSetupMode(nRetv ) + + STRING szMsg[512]; + BOOL zInstallDemo,zInstallNetWrk,zInstallNetWrkChk; +begin + + zInstallDemo = bInstallDemo; + zInstallNetWrk = bInstallNetWrk; + zInstallNetWrkChk = bInstallNetWrkChk; +#ifdef __DEMO__ + + bInstallDemo=TRUE; + +#else +//caso della reinstallazione su precedente versione: tutto quanto segue e' inutile quindi esce + if (nReinstall > 0) then + return; + endif; +//caso di installazione nuova... + if bInstallNetWrkChk then + bInstallEnv=FALSE; + endif; + if bSetupStandard then + bInstallEnv=TRUE; + else + szMsg = "Campo puo' essere installato in "; + szMsg=szMsg + "modalita' postazione singola, postazione di rete su disco locale, "; + szMsg=szMsg + "postazione di rete su disco di rete. Si desidera installare:"; + nRetv = AskOptions(EXCLUSIVE,szMsg, + "&CAMPO postazione singola (o server)", + bInstallEnv, + "CAMPO in rete (con &programmi su disco &locale)", + bInstallNetWrkChk, + "CAMPO in rete (con programmi su disco di &rete)", + bInstallNetWrk + ); + endif; + if bInstallNetWrkChk then + bInstallEnv=TRUE; + endif; +#endif + + if (( zInstallDemo!=bInstallDemo) || (zInstallNetWrk!=bInstallNetWrk)|| (zInstallNetWrkChk!=bInstallNetWrkChk) ) then + if bInstallDemo then + bInstallPrg = TRUE; + bInstallData=TRUE; + bInstallDemoData=TRUE; + elseif bInstallNetWrk then + bInstallPrg = FALSE; + bInstallData= FALSE; + bInstallDemoData=FALSE; + else + bInstallPrg = TRUE; + endif; + endif; +end; + +//________________________________________________________________________________________________________________________ +// *** Chiede la directory ove installare i programmi; + +function _SelectProgramDestination(nRetv) + + BOOL bReenterPath, bConfirmdatapath, bFoundInst, bRemoteExe, bRemoteData,bOk; + STRING szPar, szInst; + NUMBER nPar, nNextFree; + +begin + // ricontrolla la presenza di una installazione + // e determina la posizione della directory "DATI" + +//aggiornamento di una precedente installazione + if (nReinstall > 0 ) then + szConfigPath = szReinstallPath; + bNuovaInst = FALSE; + bInstallData = FALSE; + endif; + +//se non esiste una precedente installazione->nuova installazione;necessiterá di un path di default per l'installazione + if (szConfigPath = "") then + bNuovaInst = ! _FindExistingInst(szConfigPath); + if bNuovaInst then + bInstallData=TRUE; + szConfigPath= DEFAULT_LOCALPATH; + endif; + endif; + + nRetv=AskDestPath( "", "", szConfigPath, 0 ); + if (nRetv=BACK) then + return ; + endif; + bNuovaInst = ! _CheckExistingInst(szConfigPath); + if (bNuovaInst && (! ExistsDir(szConfigPath))) then + CreateDir(szConfigPath); + endif; + +//per una nuova installazione:aggiunge un paragrafo relativo nel campo.stp + nNextFree = 0; + nPar = 1; + szPar = "1"; + bFoundInst = FALSE; + while (GetProfString("C:\\Campo.stp", szPar, "Program", szInst) = 0 && ! bFoundInst) + if (_CheckExistingInst(szInst)) then + bOk = szInst = szConfigPath; + if (! bOk) then + GetProfString("C:\\Campo.stp", szPar, "CampoIni", szInst); + bOk = szInst = szConfigPath ^ "\\campo.ini"; + endif; + if (bOk) then + bFoundInst = TRUE; + nReinstall = nPar; + bSetupStandard = FALSE; //non puo' essere una installazione standard, sta sovrascrivendo una precedente installazione + endif; + + else + + if (nNextFree = 0) then + nNextFree = nPar; + endif; + + endif; + + nPar = nPar + 1; + NumToStr(szPar, nPar); + + endwhile; + + if (! bFoundInst) then + if (nNextFree > 0) then + nPar = nNextFree; + endif; + NumToStr(szPar, nPar); + WriteProfString("C:\\Campo.stp", szPar, "Program", szConfigPath); + nNewInstall = nPar; + endif; + + if (nReinstall > 0) then + NumToStr(szPar, nReinstall); + GetProfString("C:\\Campo.stp", szPar, "CampoIni", szCampoIni); + GetProfString("C:\\Campo.stp", szPar, "Program", szAppPath); + endif; + + if ( (szCampoIni = "") || (! Is (FILE_EXISTS, szCampoIni))) then + szCampoIni = szConfigPath ^ "campo.ini"; + endif; + +//esiste campo.ini -> e' una reinstallazione + if ( Is (FILE_EXISTS, szCampoIni ) ) then + + GetProfString(szCampoIni, "Main", "Program",szAppRefPath ); + GetProfString(szCampoIni, "Main", "Study",szDataPath ); + + _IsNetworkDrive(szAppPath, bRemoteExe); + _IsNetworkDrive(szDataPath, bRemoteData); + + bInstallNetWrkChk = FALSE; + bInstallNetWrk = FALSE; + bInstallEnv = ! bRemoteExe; + +//distingue tra dati in remoto e campo wst + if (bRemoteData) then + bInstallNetWrk = bRemoteExe; + bInstallNetWrkChk = !bRemoteExe; + endif; + + else +//path dei dati in caso di installazione non WST + if (!bInstallNetWrk) then + szDataPath = szConfigPath ^ "DATI\\"; + endif; + + endif; + + if ( nReinstall > 0 ) then + NumToStr(szPar, nReinstall); + else + NumToStr(szPar, nNewInstall); + endif; + +//se e' una installazione di rete scrivo su campo.stp l'indirizzo del campo.ini utilizzato + if (bInstallNetWrk) then + WriteProfString("C:\\Campo.stp", szPar, "CampoIni", szCampoIni); + else +//in caso non sia una installazione di rete non devo scrivere nulla sul campo.stp... + WriteProfString("C:\\Campo.stp", szPar, "CampoIni", ""); +//..e l'application path e' lo stesso del campo.ini (ovvio,ba0.exe e' assieme a campo.ini) + szAppPath = szConfigPath; + endif; + + return; +end; + + +//________________________________________________________________________________________________________________________ +// *** Selezione dei componenti da installare (area dati, server chiave e master server) + +function _SelectWhatToInstall(nRetv) + + BOOL bJunk; + STRING szMsg[512], szPar; + NUMBER nServers; +begin + + bInstallPrg=TRUE; + bInstallData = (szDataPath != '')&&(! _CheckExistingData(szDataPath)); + bInstallServer = FALSE; + + if (nReinstall > 0) then + bInstallData = FALSE; + NumToStr(szPar, nReinstall); + GetProfInt("C:\\Campo.stp", szPar, "Servers", nServers); + bInstallServer = nServers != 0; + endif; + +//installazione standard per utente basico; finisce qui + if bSetupStandard then + return; + endif; + +//installazione avanzata + repeat + +// Windows 95/98/ME or NT/2000/XP platforms + if (bInstallNetWrk || bInstallNetWrkChk) then + szMsg= "Setup installera' la postazione di lavoro in rete.\nE' possibile installare anche l'area dati, il server di rete per le chiavi di protezione."; + nRetv = AskOptions(NONEXCLUSIVE,szMsg, + "Installa l'area dati", bInstallData , + "Installa i Server", bInstallServer + ); + else + szMsg= "E' possibile installare i programmi (ambiente e moduli), l'area dati, il server di rete per le chiavi di protezione. "; + szMsg=szMsg + "\nSelezionare almeno una delle componenti"; + nRetv = AskOptions(NONEXCLUSIVE,szMsg, + "Installa i programmi", bInstallPrg, + "Installa l'area dati", bInstallData , + "Installa i Server", bInstallServer + ); + endif; + + until nRetv!=NEXT || bInstallData || bInstallPrg || bInstallNetWrk || bInstallServer; + +//viene aggiornato il file campo.stp con i valori relativi all'installazione del master server e del server di chiavi + if (nReinstall > 0) then + NumToStr(szPar, nReinstall); + else + NumToStr(szPar, nNewInstall); + endif; + + nServers = 0; + if (bInstallServer) then + nServers = 1; + endif; + + NumToStr(szTmp, nServers); + WriteProfString("C:\\Campo.stp", szPar, "Servers", szTmp); + + return ; +end; + + +//________________________________________________________________________________________________________________________ +// *** In caso venga selezionata una installazione di rete, richiede i parametri necessari + +function _SelectNetConfig(nDirection ) + + STRING szText[ _MAX_LENGTH ], szModifiedPath[ _MAX_LENGTH ], szTemp[ _MAX_LENGTH ]; + STRING szNetAppPath[ _MAX_LENGTH ], szPar[ _MAX_LENGTH ]; + NUMBER nHandle; + BOOL ok; +begin + if ((!bInstallNetWrk) && !(bInstallNetWrkChk && bInstallPrg)) then + return; + endif; + if (bInstallNetWrk) then + szNetAppPath=szAppPath; + else + if (szAppRefPath = "") then + GetProfString(szCampoIni, "Main", "Program", szAppRefPath); + endif; + szNetAppPath=szAppRefPath; + endif; + if (bInstallNetWrk) then + szText = szText + "Inserire il percorso completo del direttorio di rete che contiene i programmi di CAMPO. "; + szText = szText + "Se tali programmi mancano, installarli secondo la modalita' 'postazione singola'. "; + szText = szText + "Le installazioni sulle altre macchine della rete andranno effettuate secondo la modalita' 'postazione di rete'."; + else + szText = szText + "Inserire il percorso completo del direttorio di rete che contiene i programmi di CAMPO. "; + szText = szText + "Se tali programmi mancano, installarli secondo la modalita' 'postazione singola'. "; + szText = szText + "Ogni postazione di rete verifichera' eventuali aggiornamenti di questa installazione "; + szText = szText + "aggiornandosi automaticamente."; + endif; + + if (szNetAppPath = "") then + szNetAppPath = DEFAULT_NETPATH; + endif; + ok=FALSE; + while (!ok) + nDirection = AskPath( szText , szNetAppPath, szModifiedPath ); + if ( nDirection = NEXT ) then + if ( _CheckExistingInst(szModifiedPath) ) then + szNetAppPath = szModifiedPath; + StrToUpper( szNetAppPath, szNetAppPath ); + if szDataPath = "" then + StrToUpper(szDataPath ,szModifiedPath); + endif; + bProgrammiServer = TRUE; + ok = TRUE; + else + _Attenzione( "Impossibile trovare i programmi di CAMPO in " + szModifiedPath ); + endif; + else + ok = TRUE; + endif; + endwhile; + if (bInstallNetWrk) then + szAppPath = szNetAppPath; + if (nReinstall > 0) then + NumToStr(szPar, nReinstall); + else + NumToStr(szPar, nNewInstall); + endif; + WriteProfString("C:\\Campo.stp", szPar, "Program", szAppPath); + else + szAppRefPath =szNetAppPath; + StrRemoveLastSlash(szAppRefPath); + endif; +end; + +//________________________________________________________________________________________________________________________ +// *** Chiede dove sono i dati da utilizzare; se esistono gia' o vanno creati + +function _SelectDataDestination(nRetv) + + BOOL bConfirmdatapath; + STRING szChangedPath[256] + STRING sMsg[256] +begin +// ricontrolla la presenza di una installazione +// e determina la posizione della directory "DATI" + if bInstallData || bInstallPrg || bInstallNetWrk then + if bInstallData then + sMsg = "Setup installerà l'area dati nel seguente direttorio."; + else + sMsg = "Verrà utilizzata l'area dati che si trova nel seguente direttorio."; + endif; + sMsg = sMsg + "\nE' possibile cambiare il direttorio digitando il nuovo nome o scegliendo il pulsante "; + repeat + bConfirmdatapath=TRUE; + nRetv=AskPath(sMsg ,szDataPath, szChangedPath); + if (nRetv=BACK) then + return ; + endif; + szDataPath=szChangedPath; + bDatiPresenti = _CheckExistingData(szDataPath); + if (bDatiPresenti && bInstallData) then + bConfirmdatapath=_CanOverwrite(); + endif; + if ((! bDatiPresenti) && (! bInstallData)) then + if (bSetupStandard) then + bInstallData=TRUE; + else + MessageBox( "La cartella indicata non contiene dati. \nSe si desidera davvero utilizzare questa cartella, \nabilitare l'installazione dell'area dati" ,SEVERE); + bConfirmdatapath=FALSE; + endif; + endif; + until (bConfirmdatapath); + endif; + return ; +end; + +//________________________________________________________________________________________________________________________ +// **** Selezione del tipo di installazione dati + +function _SelectDataType( nRetv) + + BOOL bJunk; + STRING szMsg[512]; +begin + if ( (!bInstallData) || (nReinstall > 0) ) then + return; + endif; +#ifdef __DEMO__ + bInstallDemoData=TRUE; +#else + szMsg= "Verranno installati nuovi archivi nell'area dati. \n"; + szMsg= szMsg + "Si desidera precaricarli con dati dimostrativi ?"; + repeat + nRetv = AskOptions(NONEXCLUSIVE,szMsg, "carica i dati dimostrativi", bInstallDemoData); + if nRetv=BACK then + return ; + endif; + + if bInstallDemoData then + szInstType = INST_DEMO; + else + szInstType = INST_ENVIRONMENT; + bInstallFirm = TRUE; + endif; + until nRetv=NEXT; +#endif + return ; +end; + + +//________________________________________________________________________________________________________________________ +// *** sceglie la locazione della chiave (locale o server) + +function _SelectDongleServer(nRetv) + + STRING msg; + BOOL bJunk; +begin + + if (bInstallDemo || bSetupStandard) then + bUseDongleServer=FALSE; + + else + + msg = "I programmi sono protetti da una chiave hardware.\n"; + +//se installi il server (quindi chiave in locale) lo usi + if (bInstallServer) then + bUseDongleServer=TRUE; + msg = msg + "Su questa macchina sta per essere installato un server di autorizzazioni:"; + nRetv = AskOptions(EXCLUSIVE,msg, + "utilizza il server per il controllo delle autorizzazioni",bJunk); + else + if (_TCPIPPresent()) then + // e' installato il TCP/IP o verra' installato; posso fare uso delle chiavi di rete + msg = msg + "Il controllo delle autorizzazioni va effettuato:"; + if (nReinstall > 0 ) then + GetProfString(szCampoIni, "Server", "Dongle", szTmp); + bJunk = (szTmp = ""); + bUseDongleServer = ! bJunk; + endif; + nRetv = AskOptions(EXCLUSIVE,msg, + "tramite chiave locale", bJunk, + "tramite un server di chiavi", bUseDongleServer + ); + else + bUseDongleServer=FALSE; + nRetv = AskOptions(EXCLUSIVE, msg, "effettuare il controllo tramite chiave locale", bJunk); + endif; + endif; + endif; + + return nRetv; +end; + + +//________________________________________________________________________________________________________________________ +// *** Chiede se si desidera installare i servizi (Win NT/2000/XP) + +function _SelectDongleXP(nDirection) + + STRING szTempore,szCmdline,szCmdDir; + NUMBER nRetv; + BOOL bInstServices,go_on,bJunk; + +begin + #ifndef __DEMO__ + if ( szOSName="Windows NT" && (! bUseDongleServer) ) then //se ho win NT/2000/XP ed ho una chiave locale... + bJunk = nReinstall > 0; + go_on=FALSE; + while (!go_on) + nDirection = AskOptions(EXCLUSIVE,"Si sta installando Campo su una macchina Windows NT/2000/XP che utilizza il controllo delle autorizzazioni tramite chiave locale. E' necessaria l'installazione dei servizi per le chiavi", + "Installa ora i servizi", + bInstServices, + "Installa i servizi in seguito", + bCannotExecute, + "Servizi gia' installati", + bJunk + ); + go_on = nDirection=NEXT; + if !go_on then + return; + endif; + if bInstServices then + nDirection = AskOptions(EXCLUSIVE,"Per installare questi servizi e' necessario avere effettuato il login come utente 'Amministratore'. Se si e' effettuato il login con un altro utente uscire da Windows e rientrare come 'Amministratore'.", + "il login e' stato effettuato come amministratore", + bInstServices, + "il login non e' stato effettuato come amministratore", + bCannotExecute + ); + go_on = nDirection=NEXT; + if go_on && bInstServices then + nDirection = AskOptions(EXCLUSIVE,"Controllare il produttore dell'hardware delle chiavi di protezione. Si tratta di una chiave", + "&Eutron", + bInstNTEutron, + "&HardLock", + bInstNTHardlock + ); + go_on = nDirection=NEXT; + endif; + endif; + endwhile; + if bCannotExecute then + _Attenzione("Assicurarsi che i servizi NT/2000/XP siano attivi prima di lanciare CAMPO"); + endif; + endif; + #endif +end; + + +//________________________________________________________________________________________________________________________ +// *** Mette in Avvio Automatico il collegamento al server della chiave + +function _FindAutoStartFolder(nDirection) + + NUMBER nItems; + NUMBER lResult; + NUMBER listID; + NUMBER nRetv; + STRING szTempore,szStartFolder; + BOOL bJunk; + +begin + if (!bInstallServer) then + return; + endif; + RegDBSetDefaultRoot(HKEY_CURRENT_USER); + + if RegDBGetKeyValueEx("\\.Default\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders","Startup",lResult,szAutoRunFolder,nItems) < 0 then + // Registry access failed (16 bit DLL?) + szAutoRunFolder=""; + // try to determine the folder by names... + listID = ListCreate(STRINGLIST); + if (GetGroupNameList(listID)<0) then + MessageBox("Impossibile leggere la lista delle cartelle dei programmi",SEVERE); + endif; + lResult= ListGetFirstString(listID,szTempore); + while (lResult != END_OF_LIST) + lResult = ListGetNextString(listID,szTempore); + if szTempore = "Esecuzione Automatica" then + szAutoRunFolder=szTempore; + endif; + if szTempore = "Startup" then + szAutoRunFolder=szTempore; + endif; + endwhile; + + if szAutoRunFolder="" then + _Attenzione("Non riesco a determinare la cartella di Esecuzione Automatica di Windows"); + repeat + szStartFolder=""; + nDirection=SelectFolder("Cartella di Esecuzione Automatica",szAutoRunFolder,szAutoRunFolder); + if nDirection = BACK then + return; + endif; + if QueryProgGroup(szAutoRunFolder,szStartFolder,nItems) then + _Attenzione("La cartella indicata non fa parte delle cartelle programmi di Windows"); + nDirection=BACK; + endif; + until nDirection=NEXT; + endif; + + endif; + return ; +end; + +//________________________________________________________________________________________________________________________ +//*** setta il nome del server di autorizzazioni + +function _SelectDongleServerDestination(nDirection) + + NUMBER lResult; + NUMBER listID; + NUMBER nRetv; + STRING szTempore[_MAX_LENGTH]; + BOOL bJunk; +begin + if !bUseDongleServer then + return; + endif; + if (nReinstall > 0 ) then + GetProfString(szCampoIni, "Server", "Dongle", szDongleServerName); + endif; + +// propone il nome dell'ultimo server di autorizzazioni (in caso si sia ritornati indietro nel corso +// dell'installazione + szTempore = szDongleServerName; +// se l'installazione e' del tipo avanzata/installazione locale server e si vuole installare il server +// di autorizzazioni, propone di default localhost, in quanto il server autorizzazioni e' in locale + if ((!bInstallNetWrkChk) && (!bInstallNetWrk) && (nReinstall <= 0) ) then + szTempore = "localhost"; + endif; + + SetDialogTitle(DLG_ASK_TEXT,"Server di autorizzazioni"); + nDirection = AskText("L'installazione attuale farà riferimento ad un server di autorizzazioni. Inserire il nome del computer (NON preceduto da '\\\\') su cui é stato installato il server delle chiavi di protezione.",szTempore,szDongleServerName); + if nDirection=BACK then + szDongleServerName=szTempore; + endif; + return ; +end; + +//________________________________________________________________________________________________________________________ +// *** Installa o aggiunge moduli? + +function _AddOrOverwrite(nRet) + + STRING szMsg[512]; + BOOL bJunk; +begin + if !bInstallPrg then + return; + endif; + +#ifdef __DEMO__ + bInstallModules=TRUE; +#else + if bCannotExecute then + bInstallModules=FALSE; + return; + endif; + bInstallModules=TRUE; +#endif + return ; +end; + +//________________________________________________________________________________________________________________________ +// *** Mostra le opzioni scelte per l'installazione + +function _ConfirmInstallation(nDirection) + + STRING Msg,szInfo; + NUMBER listInfo; + +begin + +//crea la lista delle informazioni + listInfo = ListCreate(STRINGLIST); + + Msg = "Si e' scelto di installare "; + if bInstallNetWrk then + Msg =Msg +"una postazione di rete"; + elseif bInstallPrg then + if bInstallDemo then + Msg =Msg +"CAMPO versione demo"; + else + Msg =Msg +"CAMPO"; + endif; + else + Msg =Msg +"l'area dati"; + endif; + Msg = Msg + " con le opzioni seguenti. \nPremendo Setup procedera' con l'installazione di Campo."; + + +// directory dei programmi (locale o di rete) + if bInstallNetWrk then + szInfo="Direttorio della postazione di rete: "; + ListAddString(listInfo, szInfo, AFTER); + szInfo=" " + szConfigPath; + ListAddString(listInfo, szInfo, AFTER); + szInfo="Direttorio dei programmi in rete: "; + else + if (bInstallNetWrkChk) then + szInfo="Installazione di rete di riferimento:"; + ListAddString(listInfo, szInfo, AFTER); + szInfo=" " + szAppRefPath; + ListAddString(listInfo, szInfo, AFTER); + szInfo="Direttorio dei programmi locali: "; + else + szInfo="Direttorio dei programmi: "; + endif; + endif; + ListAddString(listInfo, szInfo, AFTER); + szInfo=" " + szAppPath; + ListAddString(listInfo, szInfo, AFTER); + + + +// directory dei dati (esistente o da creare) + szInfo="Area dati "; + if !bInstallData then + szInfo=szInfo + "pre-esistente"; + else + if bInstallDemoData then + szInfo=szInfo + "da installare (precaricata con archivi dimostrativi)"; + else + szInfo=szInfo + "da installare"; + endif; + endif; + szInfo=szInfo + " in: "; + ListAddString(listInfo, szInfo, AFTER); + szInfo=" " + szDataPath; + ListAddString(listInfo, szInfo, AFTER); + + +// chiave di protezione (locale o con dongle server) +#ifndef __DEMO__ + szInfo="Controllo protezione: "; + ListAddString(listInfo, szInfo, AFTER); + if bUseDongleServer then + szInfo=" attraverso il server '" + szDongleServerName +"'"; + else + szInfo=" attraverso chiave locale"; + endif; + ListAddString(listInfo, szInfo, AFTER); +#endif + + +// Mostra a video la lista + nDirection = SdShowInfoList( "Conferma installazione", Msg, listInfo ); + +end; + + +//________________________________________________________________________________________________________________________ +// *** Installazione dell'area dati + +function _InstallData(nDirection) + + BOOL bReenterPath, bConfirmdatapath; + STRING szTitle[_MAX_LENGTH]; + STRING szPath[_MAX_LENGTH]; + STRING szTemp[_MAX_LENGTH]; + NUMBER nTmp; + +begin + + if (!bInstallData) then + return; + endif; + nDirection=BACK; + TARGETDIR = szDataPath; // i .z hanno gia' il sottodirettorio nel nome di file + if ( CreateDir( TARGETDIR ) < 0 ) then + _Attenzione( STR_DATA_DIR_NOTCREATED ); + return; + endif; + // **************** + // copia dati comuni, std e com770 , + // demo o autoformazione ? + + SetColor(STATUSBAR,BLUE); + Enable(FEEDBACK_OPERATION); + Enable(STATUS); + // ******** installa dati DEMO ? + if bInstallDemoData then + szTitle = "Installazione dati dimostrativi su " + szDataPath; + FileSetBeginDefine ( "DDEMO"); + if ( CompressGet( "DATIDEMO.Z", "*.*", INCLUDE_SUBDIR ) < 0) then + szText = STR_ERR_DECOMPRESS + " il modulo Dati dimostrativi."; + _Attenzione( szText ); + endif; + FileSetEndDefine ( "DDEMO"); + StatusUpdate( ON, 100 ); + SetStatusWindow( 0, szTitle ); + _PerformSet ( "DDEMO"); + + // ******** installa dati iniziali ditte + elseif bInstallFirm then + szTitle = "Installazione dati comuni e standard su " + szDataPath; + FileSetBeginDefine ( "DATI"); + if ( CompressGet( "DATIDITT.Z", "*.*", INCLUDE_SUBDIR ) < 0) then + szText = STR_ERR_DECOMPRESS + " il modulo Dati ditta."; + _Attenzione( szText ); + endif; + + FileSetEndDefine ( "DATI"); + SetStatusWindow( 0, szTitle ); + StatusUpdate( ON, 100 ); + _PerformSet ( "DATI"); + + endif; + + + Disable(STATUS); + + // **************** + _CopiaADMININI( ); + _SetCampoIni(); + // **************** + + // marca l'installazione dati con il tipo giusto + szPath=szDataPath ^ "\\CONFIG"; + szTemp=szPath ^ DATATYPE_FILE; + if ( Is( FILE_EXISTS, szTemp ) ) then + DeleteFile(szTemp); + endif; + OpenFileMode( FILE_MODE_APPEND ); + CreateFile( nTmp, szPath, DATATYPE_FILE); + WriteLine(nTmp,szInstType); + CloseFile( nTmp ); + nDirection=NEXT; +end; + +//________________________________________________________________________________________________________________________ +// *** Installa le dll, i programmi, aggiorna i registry ed i files di sistema; si sposta poi nella directory di +// *** destinazione dell'installazione,copia l'install.ini + +function _InstallInitialFiles(nRetv) + + BOOL bReenterPath, bConfirmdatapath; + STRING sTmp[32],sPath[64]; + NUMBER direction; + +begin + + if (bInstallPrg) then + _InstallDongleXP(direction); + + if (bInstallEnv || bInstallDemo) then + _ForceAttrib4Dll( ); + // Effettua la vera e propria installazione di: dll,vxd,parte base necessaria installazione c++ + _DeleteFilesMinima( ); + _InstallFilesMinima( ); + + Disable( FEEDBACK_FULL ); + Disable( STATUS ); + + VarRestore( SRCTARGETDIR ); // Ripristina il valore di TARGETDIR + + _UpdateStartMenu( ); // aggiorna il menu di avvio di windows +// _UpdateSysFiles( ); // aggiorna,se necessario,config.sys + + ChangeDirectory( szAppPath); + + _CopiaINSTALLINI( ); + + _SetCampoIni(); + + nRetv=NEXT; + endif; + + endif; +end; + + +//________________________________________________________________________________________________________________________ +// *** installazione postazione di rete + +function _NewNetWorkPlace(nDirection ) + + STRING szText[ _MAX_LENGTH ]; + NUMBER nGoOut, nRet, nResult, nDisk; + +begin + + SetColor(STATUSBAR,BLUE); + Enable(FEEDBACK_OPERATION); + Enable(STATUS); + + FileSetBeginDefine ( "SYS"); + SetColor(STATUSBAR,BLUE); + Enable(FEEDBACK_OPERATION); + Enable(STATUS); + SetStatusWindow( 0, "Scompattamento in corso..." ); + +//hardlock.vxd in winsys.z va solo su sistemi win95/98 + 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; + + StatusUpdate( ON, 100 ); + FileSetEndDefine ( "SYS"); + + ChangeDirectory( szAppPath); + repeat + nRet=FileSetPerformEz ("SYS", nDisk ); + until nRet = FS_DONE; + Delay(1); + FileSetEndPerform ( "SYS" ); + + Disable( FEEDBACK_FULL ); + Disable(STATUS); + + _UpdateStartMenu( ); + _UpdateSysFiles(); + _SetCampoIni(); + ChangeDirectory( szAppPath); + + _Attenzione("E' stata installata una postazione di rete. \nE' necessario riavviare Windows prima di eseguire Campo."); + return ; +end; + + +//________________________________________________________________________________________________________________________ +// *** installa effettivamente i servizi su win NT/2000/XP + +function _InstallDongleXP(nDirection) + + STRING szTempore,szCmdline,szCmdDir; + NUMBER nRetv; + BOOL ok; + +begin + if ( bXPServicesInstalled ) then + return; + endif; + + if ((bInstNTHardlock) || (bInstNTEutron)) then + + _GetTmpDir(TARGETDIR); + szCmdDir = TARGETDIR; + FileSetBeginDefine ( "NTSUPPORT" ); + + if bInstNTHardlock then +// (modificato con nuova installazione servizi Hardlock il 07/05/2003) + ok = CompressGet( "SYSNT.Z", "hldrv32.exe", INCLUDE_SUBDIR ) >=0; + ok = ok && CompressGet( "SYSNT.Z", "hlinst.exe", INCLUDE_SUBDIR ) >=0; + ok = ok && CompressGet( "SYSNT.Z", "skeyrm.exe", INCLUDE_SUBDIR ) >=0; + if (!ok) then + szTempore = STR_ERR_DECOMPRESS + " il programma di installazione dei servizi Hardlock per NT/2000/XP."; + _Errore( szTempore ); + return; + endif; + endif; + + if bInstNTEutron then +// (modificato con nuova installazione servizi Eutron il 27/02/2002 per funzionare anche con win2000 server e windowsXP) + ok = CompressGet( "SYSNT.Z", "skeyadd.exe", INCLUDE_SUBDIR ) >=0; + ok = ok && CompressGet( "SYSNT.Z", "skeyrm.exe", INCLUDE_SUBDIR ) >=0; + ok = ok && CompressGet( "SYSNT.Z", "hlinst.exe", INCLUDE_SUBDIR ) >=0; + ok = ok && CompressGet( "SYSNT.Z", "keyp.sys", INCLUDE_SUBDIR ) >=0; + if (!ok) then + szTempore = STR_ERR_DECOMPRESS + " il programma di installazione dei servizi Eutron per NT/2000/XP."; + _Errore( szTempore ); + return; + endif; + endif; + + FileSetEndDefine ( "NTSUPPORT"); + _PerformSet ( "NTSUPPORT"); + + if (bInstNTHardlock) then + szTempore="Sto lanciando il programma di installazione dei servizi di rete Hardlock."; + szTempore=szTempore+"\nE' necessario chiudere tutte le applicazioni che fanno uso della protezione Hardlock."; + _Informazione(szTempore); + ChangeDirectory(szCmdDir); +// modifica per installazione servizi Hardlock ultimo tipo (07/05/2003) +// remove previous installations (Eutron & Hardlock) + szCmdline = szCmdDir ^ "skeyrm"; + LaunchAppAndWait(szCmdline,"-f",WAIT); + szCmdline = szCmdDir ^ "HLINST"; + LaunchAppAndWait(szCmdline,"-d",WAIT); + _Informazione("Precedenti installazioni dei servizi di protezione hardware sono stati de-installati"); +// launch hardlock services installer32 + szCmdline = szCmdDir ^ "hldrv32"; + LaunchAppAndWait(szCmdline,"",WAIT); + _Informazione("I servizi di rete Hardlock sono stati re-installati. Proseguo con l'installazione dei programmi di ambiente."); + endif; + + if (bInstNTEutron) then + szTempore="Sto lanciando il programma di installazione dei servizi di rete Eutron."; + szTempore=szTempore+"\nE' necessario chiudere tutte le applicazioni che fanno uso della protezione Eutron."; + _Informazione(szTempore); + ChangeDirectory(szCmdDir); +// remove previous installations (Hardlock & Eutron) + szCmdline = szCmdDir ^ "HLINST"; + LaunchAppAndWait(szCmdline,"-d",WAIT); + szCmdline = szCmdDir ^ "skeyrm"; + LaunchAppAndWait(szCmdline,"-f",WAIT); + _Informazione("Precedenti installazioni dei servizi di protezione hardware sono stati de-installati"); +// install Eutron services + szCmdline = szCmdDir ^ "skeyadd"; + LaunchAppAndWait(szCmdline,"",WAIT); + _Informazione("I servizi di rete Eutron sono stati re-installati. Proseguo con l'installazione dei programmi di ambiente."); + endif; + + bXPServicesInstalled = TRUE; //per non installare i servizi piu' di una volta + + endif; // not an NT/2000/XP machine... +end; + +//________________________________________________________________________________________________________________________ +// *** installa il collegamento al master server nel menu autostart di windows + +function _InstallServerAutoStart(nDirection) + + STRING szTempore; + +begin + + if ( ! bInstallServer ) then + return; + endif; + + _InstallDongleXP(nDirection); + +//server di controllo dei vari servers possibili + szTempore = szAppPath ^ "\\servers\\lerch.exe"; + AddFolderIcon( szAutoRunFolder, "Lerch", szTempore, "", szTempore, 0, "", REPLACE ); +end; + +//________________________________________________________________________________________________________________________ +// *** memorizza e resetta un eventuale valore di server di chiavi + +function _ResetDongleServer(szDongle) + STRING szCampoIni; +begin + if ((! bUseDongleServer ) || (bInstallServer)) then + szCampoIni = szConfigPath ^ "campo.ini"; + if ( Is( FILE_EXISTS, szCampoIni ) ) then + GetProfString(szCampoIni, "Server", "Dongle",szDongle ); + WriteProfString(szCampoIni, "Server", "Dongle", ""); + endif; + endif; +end; + +//________________________________________________________________________________________________________________________ +// *** ripristina un eventuale valore di server di chiavi + +function _RestoreDongleServer(szDongle) + STRING szCampoIni; +begin + if ((! bUseDongleServer) || (bInstallServer)) then + szCampoIni = szConfigPath ^ "CAMPO.INI"; + if ( Is( FILE_EXISTS, szCampoIni ) ) then + WriteProfString(szCampoIni, "Server", "Dongle", szDongle); + endif; + endif; +end; + + + + + diff --git a/windows/install/setup2.rul b/windows/install/setup2.rul new file mode 100755 index 000000000..bce4215d5 --- /dev/null +++ b/windows/install/setup2.rul @@ -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; + + + diff --git a/windows/install/setup3.rul b/windows/install/setup3.rul new file mode 100755 index 000000000..5bce5062b --- /dev/null +++ b/windows/install/setup3.rul @@ -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; + diff --git a/windows/install/setup4.rul b/windows/install/setup4.rul new file mode 100755 index 000000000..c39ab0b61 --- /dev/null +++ b/windows/install/setup4.rul @@ -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; +