./ : aggiunti i pif e gli exe per l'installazione moduli
src/aga : aggiunti i .rul e la lista per l'installazionecon InstallShield3 git-svn-id: svn://10.65.10.50/trunk@6061 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
7cb0311413
commit
2f90ce3bc6
167
support/interni/src/aga/declare.rul
Executable file
167
support/interni/src/aga/declare.rul
Executable file
@ -0,0 +1,167 @@
|
|||||||
|
|
||||||
|
// 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;
|
||||||
|
NUMBER nSystemFileModified;
|
||||||
|
// szAppPath e' la directory dove la applicazione verra' installata
|
||||||
|
STRING szAppPath[ _MAX_LENGTH ];
|
||||||
|
// szDataPath e' la directory dove risiederanno i dati
|
||||||
|
STRING szDataPath[ _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;
|
||||||
|
|
||||||
|
#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_BMP_FILE "PRASSI.BMP"
|
||||||
|
|
||||||
|
// #define STR_ERR_DLG "Errore di sistema. Impossibile visualizzare una finestra di dialogo."
|
||||||
|
#define STR_INVALID_PATH "Il percorso indicato non e' valido.\nIndicare un altro percorso.\n"
|
||||||
|
#define STR_TEXT1 "I programmi PR.A.S.S.I. verranno installati nella directory :"
|
||||||
|
#define STR_TEXTSER1 "I programmi PR.A.S.S.I. 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 4 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 "I files di sistema AUTOEXEC.BAT, CONFIG.SYS e WIN.INI sono stati modificati. Copie di backup di tali files sono state create nella directory %s, chiamate AUTOEXEC.PRA, CONFIG.PRA. e WIN.PRA"
|
||||||
|
#define STR_FILE_NOTMODIFIED "I files AUTOEXEC.PRA, CONFIG.PRA e WIN.PRA sono stati creati nella directory %s."
|
||||||
|
|
||||||
|
#define BA_MODULENUM 0
|
||||||
|
|
||||||
|
#define STR_SHARE "SHARE /F:5100 /L:500"
|
||||||
|
#define STR_TEMP "SET TEMP=C:\\TMP"
|
||||||
|
#define STR_MODSYSFILES "I file CONFIG.SYS, AUTOEXEC.BAT e WIN.INI devono essere modificati."
|
||||||
|
#define STR_MODIFY "Modifica automatica"
|
||||||
|
#define STR_NOTMODIFY "Modifica manuale. Seguire l'esempio dei file CONFIG.PRA, AUTOEXEC.PRA e WIN.PRA"
|
||||||
|
#define STR_INFOMODIFY "Visualizzazione delle modifiche."
|
||||||
|
#define NUM_FILES_IN_CONFIG 100
|
||||||
|
#define STR_PATHFILE "PATHPREF.INI"
|
||||||
|
|
||||||
|
#define INST_ENVIRONMENT "DITTA"
|
||||||
|
#define INST_DEMO "DEMO"
|
||||||
|
#define INST_AUTOFORM "AUTOFORM"
|
||||||
|
#define INST_WORKPLACE "WORKPLACE"
|
||||||
|
|
||||||
|
#define ZIP_DIRECTORY "ZIP"
|
||||||
|
#define ZIPDEMO_DIRECTORY "ZIPDEMO"
|
||||||
|
#define DEFAULT_LOCALPATH "C:\\PRASSI"
|
||||||
|
#define DEFAULT_NETPATH "F:\\PRASSI"
|
||||||
|
// 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 _SelectInstall(); // sceglie cosa installare
|
||||||
|
prototype _AddOrOverwrite();
|
||||||
|
prototype _SelectComponents();
|
||||||
|
prototype _SelectDataType( );
|
||||||
|
prototype _ChiediDestinazione();
|
||||||
|
prototype _ChiediDestDati();
|
||||||
|
prototype _InstallazioneMinima();
|
||||||
|
prototype _InstallazioneDati();
|
||||||
|
prototype _Ask4Purchase();
|
||||||
|
prototype _NewNetWorkPlace();
|
||||||
|
// first level
|
||||||
|
prototype _ExitOnConfirm( );
|
||||||
|
|
||||||
|
prototype _PerformSet(STRING);
|
||||||
|
prototype _TrovaPrgSuRete( );
|
||||||
|
prototype _DeleteFilesMinima();
|
||||||
|
prototype _InstallaFilesMinima();
|
||||||
|
prototype _UpdateRegistry( );
|
||||||
|
|
||||||
|
|
||||||
|
// 2nd level
|
||||||
|
|
||||||
|
prototype _CanOverwrite( );
|
||||||
|
prototype _FilesDiSistema( );
|
||||||
|
prototype _CambiaDirectory( );
|
||||||
|
prototype _CreateDLG( STRING, INT, LONG );
|
||||||
|
|
||||||
|
prototype _FineInstallazione( );
|
||||||
|
prototype _RemoveHDLOCK( );
|
||||||
|
prototype _UpdateSysFiles( );
|
||||||
|
|
||||||
|
prototype _SetPathpref();
|
||||||
|
prototype _CopiaPRASSIINI( );
|
||||||
|
prototype _CopiaINSTALLINI( );
|
||||||
|
prototype _CopiaRESETHL( );
|
||||||
|
prototype _SettaFlagNet();
|
||||||
|
prototype _PrimaInstallazione( STRING, BYREF NUMBER, BYREF STRING );
|
||||||
|
// **************
|
||||||
|
// utility
|
||||||
|
prototype _ShowExitDialog( NUMBER );
|
||||||
|
prototype _ForceAttrib4Dll( );
|
||||||
|
prototype _PreviewBatch( );
|
||||||
|
prototype _CercaFileOvunque( STRING ,BYREF STRING );
|
||||||
|
// **************
|
||||||
|
// utility
|
||||||
|
prototype _Verifica( STRING );
|
||||||
|
prototype _Errore( STRING );
|
||||||
|
prototype _Attenzione( STRING );
|
||||||
|
prototype _DeSlash( STRING, BYREF STRING );
|
||||||
|
prototype _GetOSName( );
|
||||||
|
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 );
|
||||||
|
|
||||||
|
/*
|
||||||
|
prototype _InstallaFiles( );
|
||||||
|
prototype _GetAut( NUMBER );
|
||||||
|
prototype _SpazioRichiesto( );
|
||||||
|
prototype _SpazioRichiestoDati( );
|
||||||
|
prototype _InstallaDati( );
|
||||||
|
prototype _ControlloSpazio( );
|
||||||
|
prototype _CheckNet( );
|
||||||
|
prototype _DeleteFiles( );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
prototype _FinalChecks( );
|
||||||
|
|
||||||
|
*/
|
11
support/interni/src/aga/setup.lst
Executable file
11
support/interni/src/aga/setup.lst
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
1;
|
||||||
|
sys.z
|
||||||
|
winsys.z
|
||||||
|
winsyscg.z
|
||||||
|
bademo.z
|
||||||
|
ba.z
|
||||||
|
std.z
|
||||||
|
com.z
|
||||||
|
cm770.z
|
||||||
|
datidemo.z
|
||||||
|
datiauto.z
|
174
support/interni/src/aga/setup.rul
Executable file
174
support/interni/src/aga/setup.rul
Executable file
@ -0,0 +1,174 @@
|
|||||||
|
// File principale della installazione EASY CAMPO
|
||||||
|
declare
|
||||||
|
// Dichiarazioni di costanti per questo script
|
||||||
|
#include "DECLARE.RUL"
|
||||||
|
// Windows API
|
||||||
|
#include "WINSUB.H"
|
||||||
|
// File di include con gli ID dei dialog usati in questo script
|
||||||
|
#include "PRADIAGS.H"
|
||||||
|
NUMBER nHandle;
|
||||||
|
NUMBER nTerminatedConv, nResult;
|
||||||
|
STRING szSXTR1,szSXTR2, szDoMnu, szText, szModifiedPath, szBaCnv;
|
||||||
|
STRING sInstType;
|
||||||
|
BOOL bPurchase, bInstallModules, bInstallAutoform, bInstallEnv, bInstallFirm, bInstallDemo, bInstallDemoData, bInstallNetWrk;
|
||||||
|
BOOL bInstallData, bInstallPrg, bInstallManual;
|
||||||
|
// Function declarations.
|
||||||
|
prototype _SetupScreen();
|
||||||
|
prototype _CheckRequirements();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//----------------------------------
|
||||||
|
NUMBER nDirection;
|
||||||
|
program
|
||||||
|
|
||||||
|
|
||||||
|
Step_start:
|
||||||
|
//---------------------------------- defaults
|
||||||
|
bInstallPrg = TRUE;
|
||||||
|
bInstallData = FALSE;
|
||||||
|
_ProgramPrologue();
|
||||||
|
|
||||||
|
#define SPACE_REQUIRED 3000 // Disk space in bytes.
|
||||||
|
#define APP_NAME "Easy Campo"
|
||||||
|
#define PROGRAM_FOLDER_NAME "PRASSI"
|
||||||
|
#define APPBASE_PATH "\\"
|
||||||
|
#define COMPANY_NAME "A.G.A. Informatica"
|
||||||
|
#define PRODUCT_NAME "EasyCampo"
|
||||||
|
#define PRODUCT_VERSION "1.0 beta"
|
||||||
|
#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 );
|
||||||
|
// Set up the installation screen.
|
||||||
|
_SetupScreen();
|
||||||
|
Enable( DIALOGCACHE );
|
||||||
|
_CheckRequirements();
|
||||||
|
|
||||||
|
Step_welcome:
|
||||||
|
Disable( BACKBUTTON );
|
||||||
|
Welcome( "", 0 );
|
||||||
|
Enable( BACKBUTTON );
|
||||||
|
|
||||||
|
Step_chooseinst:
|
||||||
|
// sceglie cosa installare
|
||||||
|
nDirection=_SelectInstall();
|
||||||
|
if (nDirection=BACK) then
|
||||||
|
goto Step_welcome;
|
||||||
|
endif ;
|
||||||
|
if nDirection=NEXT then
|
||||||
|
if bInstallNetWrk then
|
||||||
|
goto Step_installnet;
|
||||||
|
endif;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
Step_choosewhere:
|
||||||
|
nDirection= _ChiediDestinazione();
|
||||||
|
if nDirection=BACK then
|
||||||
|
goto Step_chooseinst;
|
||||||
|
endif;
|
||||||
|
if bInstallDemo then
|
||||||
|
bInstallPrg = TRUE;
|
||||||
|
bInstallData = TRUE;
|
||||||
|
bInstallDemoData=TRUE;
|
||||||
|
goto Step_choosewhereD;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
Step_choosecomp:
|
||||||
|
if nDirection=BACK && bInstallDemo then
|
||||||
|
goto Step_choosewhere;
|
||||||
|
endif;
|
||||||
|
nDirection= _SelectComponents( );
|
||||||
|
if nDirection=BACK then
|
||||||
|
goto Step_choosewhere;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
Step_choosewhereD:
|
||||||
|
nDirection= _ChiediDestDati();
|
||||||
|
if nDirection=BACK then
|
||||||
|
goto Step_choosecomp;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
Step_choosedata:
|
||||||
|
if bInstallData then
|
||||||
|
nDirection= _SelectDataType();
|
||||||
|
if nDirection=BACK then
|
||||||
|
if bInstallDemo then
|
||||||
|
goto Step_choosewhere;
|
||||||
|
else
|
||||||
|
goto Step_choosewhereD;
|
||||||
|
endif;
|
||||||
|
endif;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
Step_fromnet:
|
||||||
|
nDirection = _SettaFlagNet();
|
||||||
|
if nDirection=BACK then
|
||||||
|
if bInstallDemo then
|
||||||
|
goto Step_choosewhere;
|
||||||
|
elseif !bInstallData then
|
||||||
|
goto Step_choosewhereD;
|
||||||
|
else
|
||||||
|
goto Step_choosedata;
|
||||||
|
endif;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
Step_newORupdate:
|
||||||
|
if (bInstallPrg || bNuovaInst) && nDirection=BACK then
|
||||||
|
goto Step_fromnet;
|
||||||
|
endif;
|
||||||
|
if bInstallPrg then
|
||||||
|
nDirection=_AddOrOverwrite();
|
||||||
|
endif;
|
||||||
|
if nDirection=BACK then
|
||||||
|
goto Step_fromnet;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
Step_installData:
|
||||||
|
if bInstallData then
|
||||||
|
nDirection = _InstallazioneDati();
|
||||||
|
if (nDirection=BACK) then
|
||||||
|
goto Step_newORupdate;
|
||||||
|
endif;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
Step_installPrg:
|
||||||
|
if bInstallPrg then
|
||||||
|
if bInstallEnv || bInstallDemo then
|
||||||
|
nDirection = _InstallazioneMinima();
|
||||||
|
if (nDirection=BACK) then
|
||||||
|
goto Step_newORupdate;
|
||||||
|
endif;
|
||||||
|
endif;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
Step_purchase:
|
||||||
|
if bPurchase then
|
||||||
|
ChangeDirectory(szAppPath);
|
||||||
|
LaunchAppAndWait("ba1.exe","-4 -uPRASSI",WAIT);
|
||||||
|
endif;
|
||||||
|
if bInstallModules then
|
||||||
|
ChangeDirectory(szAppPath);
|
||||||
|
LaunchAppAndWait("ba1.exe","-6 -uPRASSI",WAIT);
|
||||||
|
endif;
|
||||||
|
|
||||||
|
_ProgramEpilogue();
|
||||||
|
exit;
|
||||||
|
|
||||||
|
Step_installnet:
|
||||||
|
nDirection = _NewNetWorkPlace();
|
||||||
|
if (nDirection=BACK) then
|
||||||
|
goto Step_chooseinst;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
_ProgramEpilogue();
|
||||||
|
exit;
|
||||||
|
|
||||||
|
#include "winsub.rul"
|
||||||
|
#include "setup1.rul"
|
||||||
|
#include "setup2.rul"
|
||||||
|
#include "setup3.rul"
|
||||||
|
#include "setup4.rul"
|
443
support/interni/src/aga/setup1.rul
Executable file
443
support/interni/src/aga/setup1.rul
Executable file
@ -0,0 +1,443 @@
|
|||||||
|
//----------------------------------------------------------------------------
|
||||||
|
// **** Selezione del tipo di installazione
|
||||||
|
// **** (programmi o postazione di rete)
|
||||||
|
function _SelectInstall( )
|
||||||
|
NUMBER nRetv;
|
||||||
|
STRING szMsg[512];
|
||||||
|
begin
|
||||||
|
szMsg = "Setup puo' essere utilizzato per installare ";
|
||||||
|
szMsg=szMsg + "EasyCampo in versione normale o demo, oppure per installare ";
|
||||||
|
szMsg=szMsg + "una postazione di lavoro che sfrutta una precedente intallazione su disco di rete";
|
||||||
|
nRetv = AskOptions(EXCLUSIVE,szMsg,
|
||||||
|
"&Installazione EasyCAMPO",
|
||||||
|
bInstallEnv,
|
||||||
|
"Installazione EasyCAMPO &Demo",
|
||||||
|
bInstallDemo,
|
||||||
|
"Installazione nuova postazione di lavoro in &rete",
|
||||||
|
bInstallNetWrk
|
||||||
|
);
|
||||||
|
return nRetv;
|
||||||
|
end;
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
// **** Selezione del tipo di installazione
|
||||||
|
// ****
|
||||||
|
function _SelectComponents()
|
||||||
|
NUMBER nRetv;
|
||||||
|
BOOL bJunk;
|
||||||
|
STRING szMsg[512];
|
||||||
|
begin
|
||||||
|
repeat
|
||||||
|
szMsg= "E' possibile installare i programmi (ambiente e moduli) e/o l'area dati. ";
|
||||||
|
szMsg=szMsg + "\nSelezionare almeno una delle componenti";
|
||||||
|
nRetv = AskOptions(NONEXCLUSIVE,szMsg,
|
||||||
|
"Installa i programmi", bInstallPrg,
|
||||||
|
"Installa l'area dati", bInstallData
|
||||||
|
);
|
||||||
|
until nRetv!=NEXT || bInstallData || bInstallPrg;
|
||||||
|
return nRetv;
|
||||||
|
end;
|
||||||
|
|
||||||
|
// **** Selezione del tipo di installazione
|
||||||
|
// ****
|
||||||
|
function _SelectDataType( )
|
||||||
|
NUMBER nRetv;
|
||||||
|
BOOL bJunk;
|
||||||
|
STRING szMsg[512];
|
||||||
|
begin
|
||||||
|
szMsg= "Si e' selezionato di installare gli archivi. \n";
|
||||||
|
szMsg= szMsg + "L'area dati deve contenere:";
|
||||||
|
repeat
|
||||||
|
nRetv = AskOptions(EXCLUSIVE,szMsg,
|
||||||
|
"gli archivi di &ditta",
|
||||||
|
bInstallFirm,
|
||||||
|
"gli archivi De&mo",
|
||||||
|
bInstallDemoData,
|
||||||
|
"gli archivi di Auto&formazione",
|
||||||
|
bInstallAutoform
|
||||||
|
);
|
||||||
|
if nRetv=BACK then
|
||||||
|
return BACK;
|
||||||
|
endif;
|
||||||
|
sInstType = INST_ENVIRONMENT;
|
||||||
|
if bInstallDemoData then
|
||||||
|
sInstType = INST_DEMO;
|
||||||
|
elseif bInstallAutoform then
|
||||||
|
sInstType = INST_AUTOFORM;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
until nRetv=NEXT;
|
||||||
|
return nRetv;
|
||||||
|
end;
|
||||||
|
|
||||||
|
//----------------------------------
|
||||||
|
// chiede la directory dell'applicazione e dei dati;
|
||||||
|
// l'installazione dei soli dati ha bisogno di dir_applicaz (per settare pathpref)
|
||||||
|
// l'installazione dei soli programmi ha bisogno di dir_dati (per sapere se esiste un direttorio dati)
|
||||||
|
function _ChiediDestinazione()
|
||||||
|
BOOL bReenterPath, bConfirmdatapath;
|
||||||
|
NUMBER nRetv;
|
||||||
|
begin
|
||||||
|
// ricontrolla la presenza di una installazione
|
||||||
|
// e determina la posizione della directory "DATI"
|
||||||
|
|
||||||
|
if szAppPath="" then
|
||||||
|
szAppPath= "c:\prassi";
|
||||||
|
bNuovaInst = _FindExistingInst(szAppPath);
|
||||||
|
endif;
|
||||||
|
if (AskDestPath( "", "", szAppPath, 0 )=BACK) then
|
||||||
|
return BACK;
|
||||||
|
endif;
|
||||||
|
bNuovaInst = ! _CheckExistingInst(szAppPath);
|
||||||
|
szTmp = szAppPath ^ "PATHPREF.INI";
|
||||||
|
if ( ! Is( FILE_EXISTS, szTmp ) ) then
|
||||||
|
szDataPath = szAppPath ^ "DATI\\";
|
||||||
|
else
|
||||||
|
OpenFileMode( FILE_MODE_NORMAL );
|
||||||
|
OpenFile( nTmp, szAppPath, "PATHPREF.INI");
|
||||||
|
if GetLine( nTmp, szTmp ) = 0 then
|
||||||
|
StrSub( szTmp2, szTmp, 1, 1 );
|
||||||
|
if ( szTmp2 = ":" ) then
|
||||||
|
szDataPath = szTmp;
|
||||||
|
else
|
||||||
|
StrSub( szTmp2, szTmp, 0, 1 );
|
||||||
|
if ( szTmp2 = "." ) then
|
||||||
|
szDataPath = szTmp;
|
||||||
|
else
|
||||||
|
if ( szTmp2 = "\\" ) then
|
||||||
|
szDataPath = szTmp;
|
||||||
|
else
|
||||||
|
szDataPath = szAppPath ^ szTmp;
|
||||||
|
endif;
|
||||||
|
endif;
|
||||||
|
endif;
|
||||||
|
else
|
||||||
|
MessageBox( "Errore nel file PATHPREF.INI" ,SEVERE);
|
||||||
|
szDataPath = szAppPath ^ "DATI\\";
|
||||||
|
endif;
|
||||||
|
CloseFile( nTmp );
|
||||||
|
endif;
|
||||||
|
return nRetv;
|
||||||
|
end;
|
||||||
|
|
||||||
|
//----------------------------------
|
||||||
|
function _ChiediDestDati()
|
||||||
|
BOOL bConfirmdatapath;
|
||||||
|
STRING szChangedPath[256]
|
||||||
|
STRING sMsg[256]
|
||||||
|
begin
|
||||||
|
// ricontrolla la presenza di una installazione
|
||||||
|
// e determina la posizione della directory "DATI"
|
||||||
|
// step 2: data path
|
||||||
|
if bInstallData then
|
||||||
|
sMsg = "I dati verranno installati nel seguente direttorio.";
|
||||||
|
else
|
||||||
|
sMsg = "I dati sono installati nel seguente direttorio.";
|
||||||
|
endif;
|
||||||
|
sMsg = sMsg + "\nE' possibile cambiare il direttorio digitando il nuovo nome o scegliendo il pulsante <Sfoglia>";
|
||||||
|
repeat
|
||||||
|
bConfirmdatapath=TRUE;
|
||||||
|
if (AskPath(sMsg ,szDataPath, szChangedPath)=BACK) then
|
||||||
|
return BACK;
|
||||||
|
endif;
|
||||||
|
szDataPath=szChangedPath;
|
||||||
|
bDatiPresenti = _CheckExistingData(szDataPath);
|
||||||
|
if (bDatiPresenti && bInstallData) then
|
||||||
|
bConfirmdatapath=_CanOverwrite();
|
||||||
|
endif;
|
||||||
|
if ((! bDatiPresenti) && (! bInstallData)) then
|
||||||
|
MessageBox( "La cartella indicata non contiene dati. \nSe si desidera davvero utilizzare questa cartella, \nabilitare l'installazione dell'area dati" ,SEVERE);
|
||||||
|
bConfirmdatapath=FALSE;
|
||||||
|
endif;
|
||||||
|
until (bConfirmdatapath);
|
||||||
|
|
||||||
|
return NEXT;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
// **** Installi o aggiungi moduli ?
|
||||||
|
|
||||||
|
function _AddOrOverwrite()
|
||||||
|
STRING szMsg[512];
|
||||||
|
BOOL bJunk;
|
||||||
|
NUMBER nRet;
|
||||||
|
begin
|
||||||
|
if bNuovaInst then
|
||||||
|
szMsg= "Setup procedera' con l'installazione dei programmi di ambiente.";
|
||||||
|
szMsg=szMsg + "Si desidera acquistare e abilitare nuovi moduli prima di installarli?";
|
||||||
|
bInstallModules=TRUE;
|
||||||
|
nRet = AskOptions(NONEXCLUSIVE,szMsg,
|
||||||
|
"&Acquisto e abilitazione nuovi moduli",
|
||||||
|
bPurchase
|
||||||
|
);
|
||||||
|
else
|
||||||
|
szMsg= "Si sta aggiornando una precedente installazione. Si desidera aggiornare i moduli gia' acquistati ";
|
||||||
|
szMsg=szMsg + "o acquistarne e abilitarne dei nuovi prima di installarli ?";
|
||||||
|
nRet = AskOptions(NONEXCLUSIVE,szMsg,
|
||||||
|
"&Acquisto e abilitazione nuovi moduli",
|
||||||
|
bPurchase,
|
||||||
|
"Installazione o aggiornamento nuovi &moduli",
|
||||||
|
bInstallModules
|
||||||
|
);
|
||||||
|
endif;
|
||||||
|
return nRet;
|
||||||
|
end;
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// ****
|
||||||
|
// ****
|
||||||
|
function _TrovaPrgSuRete( )
|
||||||
|
STRING szText[ _MAX_LENGTH ], szModifiedPath[ _MAX_LENGTH ], szTemp[ _MAX_LENGTH ];
|
||||||
|
NUMBER nHandle;
|
||||||
|
begin
|
||||||
|
szText = "E' stata scelta l'installazione di una postazione di lavoro.";
|
||||||
|
szText =szText + "\nInserire il nome del direttorio di rete che contiene l'installazione di EasyCAMPO";
|
||||||
|
szAppPath = DEFAULT_NETPATH;
|
||||||
|
while ( TRUE )
|
||||||
|
if ( AskPath( szText , szAppPath, szModifiedPath ) = NEXT ) then
|
||||||
|
if ( _CheckExistingInst(szModifiedPath) ) then
|
||||||
|
szAppPath = szModifiedPath;
|
||||||
|
szTmp = szAppPath ^ "PATHPREF.INI";
|
||||||
|
if ( ! Is( FILE_EXISTS, szTmp ) ) then
|
||||||
|
szDataPath = szAppPath ^ "DATI\\";
|
||||||
|
else
|
||||||
|
OpenFileMode( FILE_MODE_NORMAL );
|
||||||
|
OpenFile( nTmp, szAppPath, "PATHPREF.INI");
|
||||||
|
if GetLine( nTmp, szTmp ) = 0 then
|
||||||
|
StrSub( szTmp2, szTmp, 1, 1 );
|
||||||
|
if ( szTmp2 = ":" ) then
|
||||||
|
szDataPath = szTmp;
|
||||||
|
else
|
||||||
|
StrSub( szTmp2, szTmp, 0, 1 );
|
||||||
|
if ( szTmp2 = "." ) then
|
||||||
|
szDataPath = szTmp;
|
||||||
|
else
|
||||||
|
if ( szTmp2 = "\\" ) then
|
||||||
|
szDataPath = szTmp;
|
||||||
|
else
|
||||||
|
szDataPath = szAppPath ^ szTmp;
|
||||||
|
endif;
|
||||||
|
endif;
|
||||||
|
endif;
|
||||||
|
else
|
||||||
|
_Attenzione( "Errore nel file PATHPREF.INI" );
|
||||||
|
szDataPath = szAppPath ^ "DATI\\";
|
||||||
|
endif;
|
||||||
|
CloseFile( nTmp );
|
||||||
|
endif;
|
||||||
|
StrToUpper( szAppPath, szAppPath );
|
||||||
|
StrToUpper( szDataPath, szDataPath );
|
||||||
|
bProgrammiServer = TRUE;
|
||||||
|
szTemp = DEFAULT_LOCALPATH ^ "\\PREFIX.TXT";
|
||||||
|
if ( ! Is( FILE_EXISTS, szTemp ) ) then
|
||||||
|
CreateDir( DEFAULT_LOCALPATH );
|
||||||
|
CreateFile( nHandle, DEFAULT_LOCALPATH, "PREFIX.TXT" );
|
||||||
|
WriteLine( nHandle, "COM" );
|
||||||
|
CloseFile( nHandle );
|
||||||
|
endif;
|
||||||
|
_UpdateRegistry( );
|
||||||
|
return NEXT;
|
||||||
|
else
|
||||||
|
_Attenzione( "Impossibile trovare i programmi di EasyCAMPO in " + szModifiedPath );
|
||||||
|
endif;
|
||||||
|
else
|
||||||
|
return BACK;
|
||||||
|
endif;
|
||||||
|
endwhile;
|
||||||
|
end;
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// **** installazione postazione di rete
|
||||||
|
// ****
|
||||||
|
function _NewNetWorkPlace( )
|
||||||
|
STRING szText[ _MAX_LENGTH ];
|
||||||
|
NUMBER nGoOut, nRet, nResult, nDisk;
|
||||||
|
BOOL bRet;
|
||||||
|
begin
|
||||||
|
if (_TrovaPrgSuRete() =BACK) then
|
||||||
|
return BACK;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
bRet = _Verifica("Installare anche le librerie di CG ? ");
|
||||||
|
|
||||||
|
FileSetBeginDefine ( "SYS");
|
||||||
|
SetColor(STATUSBAR,BLUE);
|
||||||
|
Enable(FEEDBACK_OPERATION);
|
||||||
|
Enable(STATUS);
|
||||||
|
SetStatusWindow( 0, "Scompattamento in corso..." );
|
||||||
|
TARGETDIR = WINDIR ^ "SYSTEM";
|
||||||
|
|
||||||
|
if ( CompressGet( "WINSYS.Z", "*.*", INCLUDE_SUBDIR ) < 0) then
|
||||||
|
szText = STR_ERR_DECOMPRESS + " la libreria WINSYS.";
|
||||||
|
_Errore( szText );
|
||||||
|
endif;
|
||||||
|
if (bRet) then
|
||||||
|
if ( CompressGet( "WINSYSCG.Z", "*.*", INCLUDE_SUBDIR ) < 0) then
|
||||||
|
szText = STR_ERR_DECOMPRESS + " la libreria WINSYSCG.";
|
||||||
|
_Errore( szText );
|
||||||
|
endif;
|
||||||
|
ChangeDirectory( szAppPath);
|
||||||
|
szText = szAppPath ^ "\\cgpostIN.EXE";
|
||||||
|
LaunchAppAndWait( szText , szAppPath, WAIT );
|
||||||
|
endif;
|
||||||
|
FileSetEndDefine ( "SYS");
|
||||||
|
StatusUpdate( ON, 100 );
|
||||||
|
repeat
|
||||||
|
nRet=FileSetPerformEz ("SYS", nDisk );
|
||||||
|
until nRet = FS_DONE;
|
||||||
|
Delay(1);
|
||||||
|
FileSetEndPerform ( "SYS" );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_UpdateSysFiles();
|
||||||
|
_SetPathpref();
|
||||||
|
ChangeDirectory( szAppPath);
|
||||||
|
_RemoveHDLOCK();
|
||||||
|
|
||||||
|
Disable( FEEDBACK_FULL );
|
||||||
|
Disable(STATUS);
|
||||||
|
return NEXT;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
//----------------------------------
|
||||||
|
function _InstallazioneDati()
|
||||||
|
BOOL bReenterPath, bConfirmdatapath;
|
||||||
|
STRING szTitle[_MAX_LENGTH];
|
||||||
|
STRING szPath[_MAX_LENGTH];
|
||||||
|
STRING szTemp[_MAX_LENGTH];
|
||||||
|
NUMBER nTmp;
|
||||||
|
begin
|
||||||
|
|
||||||
|
|
||||||
|
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);
|
||||||
|
SetStatusWindow( 0, "Installazione dati in corso..." );
|
||||||
|
// ******** installa dati DEMO ?
|
||||||
|
if bInstallDemoData then
|
||||||
|
szTitle = "Installazione dati dimostrativi su " + szDataPath;
|
||||||
|
SetStatusWindow( 0, szTitle );
|
||||||
|
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 );
|
||||||
|
_PerformSet ( "DDEMO");
|
||||||
|
|
||||||
|
// ******** installa dati autoformazione ?
|
||||||
|
elseif bInstallAutoform then
|
||||||
|
szTitle = "Installazione dati di autoformazione su " + szDataPath;
|
||||||
|
SetStatusWindow( 0, szTitle );
|
||||||
|
FileSetBeginDefine ( "DAUTO");
|
||||||
|
if ( CompressGet( "DATIAUTO.Z", "*.*", INCLUDE_SUBDIR ) < 0) then
|
||||||
|
szText = STR_ERR_DECOMPRESS + " il modulo Dati di autoformazione.";
|
||||||
|
_Attenzione( szText );
|
||||||
|
endif;
|
||||||
|
FileSetEndDefine ( "DAUTO");
|
||||||
|
StatusUpdate( ON, 100 );
|
||||||
|
_PerformSet ( "DAUTO");
|
||||||
|
|
||||||
|
// ******** installa dati iniziali ditte
|
||||||
|
elseif bInstallFirm then
|
||||||
|
szTitle = "Installazione dati comuni e standard su " + szDataPath;
|
||||||
|
SetStatusWindow( 0, szTitle );
|
||||||
|
FileSetBeginDefine ( "DATI");
|
||||||
|
if ( CompressGet( "STD.Z", "*.*", INCLUDE_SUBDIR ) < 0) then
|
||||||
|
szText = STR_ERR_DECOMPRESS + " il modulo Dati standard.";
|
||||||
|
_Attenzione( szText );
|
||||||
|
endif;
|
||||||
|
if ( CompressGet( "COM.Z", "*.*", INCLUDE_SUBDIR ) < 0) then
|
||||||
|
szText = STR_ERR_DECOMPRESS + " il modulo Dati comuni.";
|
||||||
|
_Attenzione( szText );
|
||||||
|
endif;
|
||||||
|
if ( CompressGet( "CM770.Z", "*.*", INCLUDE_SUBDIR ) < 0) then
|
||||||
|
szText = STR_ERR_DECOMPRESS + " il modulo Dati comuni (M770).";
|
||||||
|
_Attenzione( szText );
|
||||||
|
endif;
|
||||||
|
FileSetEndDefine ( "DATI");
|
||||||
|
|
||||||
|
StatusUpdate( ON, 100 );
|
||||||
|
_PerformSet ( "DATI");
|
||||||
|
endif;
|
||||||
|
|
||||||
|
|
||||||
|
Disable(STATUS);
|
||||||
|
|
||||||
|
// ****************
|
||||||
|
_CopiaPRASSIINI( );
|
||||||
|
_SetPathpref();
|
||||||
|
// ****************
|
||||||
|
// 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,sInstType);
|
||||||
|
CloseFile( nTmp );
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
//----------------------------------
|
||||||
|
function _InstallazioneMinima()
|
||||||
|
BOOL bReenterPath, bConfirmdatapath;
|
||||||
|
STRING sTmp[32],sPath[64];
|
||||||
|
begin
|
||||||
|
|
||||||
|
_ForceAttrib4Dll( );
|
||||||
|
// Effettua la vera e propria installazione minima
|
||||||
|
_DeleteFilesMinima( );
|
||||||
|
_InstallaFilesMinima( );
|
||||||
|
|
||||||
|
Disable( FEEDBACK_FULL );
|
||||||
|
Disable( STATUS );
|
||||||
|
// Ripristina il valore di TARGETDIR
|
||||||
|
VarRestore( SRCTARGETDIR );
|
||||||
|
_UpdateRegistry( );
|
||||||
|
_UpdateSysFiles( );
|
||||||
|
|
||||||
|
ChangeDirectory( szAppPath);
|
||||||
|
|
||||||
|
_CopiaINSTALLINI( );
|
||||||
|
_CopiaRESETHL( );
|
||||||
|
_RemoveHDLOCK( );
|
||||||
|
|
||||||
|
_SetPathpref();
|
||||||
|
|
||||||
|
// IlMiticoINST.EXE: //( Trice.exe cb0000.exe ):
|
||||||
|
// E' stato spostato come post-process della CG
|
||||||
|
// if bNuovaInst then
|
||||||
|
// if nInstallCG then
|
||||||
|
// ChangeDirectory( szAppPath);
|
||||||
|
// szRunProgram = szAppPath ^ "\\INST.EXE";
|
||||||
|
// LaunchAppAndWait( szRunProgram , szAppPath, WAIT );
|
||||||
|
// endif;
|
||||||
|
// endif;
|
||||||
|
return NEXT;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function _Ask4Purchase()
|
||||||
|
begin
|
||||||
|
if (AskYesNo("Vuoi acquistare nuovi moduli",NO)) then
|
||||||
|
// lancia il programma ''enabler''
|
||||||
|
endif;
|
||||||
|
return NEXT;
|
||||||
|
end;
|
||||||
|
|
525
support/interni/src/aga/setup2.rul
Executable file
525
support/interni/src/aga/setup2.rul
Executable file
@ -0,0 +1,525 @@
|
|||||||
|
function _SetPathpref( )
|
||||||
|
STRING szTmpPath[_MAX_LENGTH];
|
||||||
|
begin
|
||||||
|
// Setto il Pathpref in modo da poter eseguire BA1 o BACNV,
|
||||||
|
// anche in prima installazione su rete (mancando set PREFPATH)
|
||||||
|
|
||||||
|
ChangeDirectory( szAppPath);
|
||||||
|
if (Is( FILE_EXISTS, "PATHPREF.INI" )) then
|
||||||
|
DeleteFile("PATHPREF.INI" );
|
||||||
|
endif;
|
||||||
|
CreateFile( nHandle, szAppPath, "PATHPREF.INI" );
|
||||||
|
WriteLine( nHandle, szDataPath );
|
||||||
|
CloseFile( nHandle );
|
||||||
|
|
||||||
|
ChangeDirectory( szAppPath);
|
||||||
|
if ( Is( FILE_EXISTS, "PREFIX.TXT" )) then
|
||||||
|
DeleteFile("PREFIX.TXT" );
|
||||||
|
endif;
|
||||||
|
CreateFile( nHandle, szAppPath, "PREFIX.TXT" );
|
||||||
|
WriteLine( nHandle, "COM" );
|
||||||
|
CloseFile( nHandle );
|
||||||
|
// scrive le stesse cose nel file unico prawin.ini , se esiste
|
||||||
|
szTmpPath=szAppPath ^ "PRAWIN.INI";
|
||||||
|
WriteProfString(szTmpPath, "Main", "Program",szAppPath);
|
||||||
|
WriteProfString(szTmpPath, "Main", "Study",szDataPath);
|
||||||
|
WriteProfString(szTmpPath, "Main", "Firm","COM");
|
||||||
|
end;
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// **** Funzione per aggiornare i files di sistema
|
||||||
|
// ****
|
||||||
|
function _UpdateSysFiles( )
|
||||||
|
NUMBER nNotModify, nGoOut, nRet, nInfo, nCurFiles, nLen, nNr;
|
||||||
|
STRING szTemp[_MAX_LENGTH], szWin_Ini[_MAX_LENGTH], szSaveDir[_MAX_LENGTH];
|
||||||
|
begin
|
||||||
|
if !bNuovaInst then
|
||||||
|
return;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
nSystemFileModified = TRUE;
|
||||||
|
nNotModify = FALSE;
|
||||||
|
nInfo = FALSE;
|
||||||
|
nGoOut = FALSE;
|
||||||
|
SetDialogTitle(DLG_ASK_OPTIONS, "Modifica ai files di sistema" );
|
||||||
|
Disable( BACKBUTTON );
|
||||||
|
SetDialogTitle(DLG_CANCEL, "Uscita" );
|
||||||
|
SetDialogTitle(DLG_OK, "Conferma" );
|
||||||
|
|
||||||
|
while ! nGoOut
|
||||||
|
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;
|
||||||
|
|
||||||
|
// Modifiche per installare BAFAX & FAXMAN (30 settembre 1996)
|
||||||
|
if (bProgrammiServer) then
|
||||||
|
szSaveDir = DEFAULT_LOCALPATH;
|
||||||
|
else
|
||||||
|
szSaveDir = szAppPath;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
VarSave(SRCTARGETDIR);
|
||||||
|
SRCDIR = WINDIR;
|
||||||
|
TARGETDIR = szSaveDir;
|
||||||
|
CopyFile( "WIN.INI", "WIN.PRA" );
|
||||||
|
VarRestore(SRCTARGETDIR);
|
||||||
|
// Fine modifiche del 30 settembre 1996
|
||||||
|
VarSave(SRCTARGETDIR);
|
||||||
|
SRCDIR = "C:\\";
|
||||||
|
TARGETDIR = szSaveDir;
|
||||||
|
CopyFile( "AUTOEXEC.BAT", "AUTOEXEC.PRA" );
|
||||||
|
CopyFile( "CONFIG.SYS", "CONFIG.PRA" );
|
||||||
|
VarRestore(SRCTARGETDIR);
|
||||||
|
if nSystemFileModified then
|
||||||
|
BatchSetFileName( "C:\\AUTOEXEC.BAT" );
|
||||||
|
ConfigSetFileName( "C:\\CONFIG.SYS" );
|
||||||
|
szWin_Ini = WINDIR ^ "WIN.INI";
|
||||||
|
else
|
||||||
|
szTemp = szSaveDir ^ "AUTOEXEC.PRA";
|
||||||
|
BatchSetFileName( szTemp );
|
||||||
|
szTemp = szSaveDir ^ "CONFIG.PRA";
|
||||||
|
ConfigSetFileName( szTemp );
|
||||||
|
szWin_Ini = szSaveDir ^ "WIN.PRA";
|
||||||
|
endif;
|
||||||
|
if (szOSName != "3.95") then
|
||||||
|
EzBatchReplace( STR_SHARE );
|
||||||
|
endif;
|
||||||
|
EzBatchReplace( STR_TEMP );
|
||||||
|
if bProgrammiServer then
|
||||||
|
EzBatchReplace("SET PREFPATH=C:\\PRASSI\\PREFIX.TXT");
|
||||||
|
endif;
|
||||||
|
szTemp = "C:\\RESET_HL.EXE";
|
||||||
|
EzBatchReplace( szTemp );
|
||||||
|
nLen = StrLength( szAppPath );
|
||||||
|
StrSub( szTemp, szAppPath, 0, nLen - 1);
|
||||||
|
EzBatchAddPath( "PATH", szTemp, "", AFTER );
|
||||||
|
EzConfigGetValue( "FILES", nCurFiles );
|
||||||
|
if nCurFiles < NUM_FILES_IN_CONFIG then
|
||||||
|
EzConfigSetValue( "FILES", NUM_FILES_IN_CONFIG );
|
||||||
|
endif;
|
||||||
|
|
||||||
|
// *****************
|
||||||
|
// Modifiche per installare BAFAX & FAXMAN
|
||||||
|
|
||||||
|
nNr = GetProfString(szWin_Ini,"FaxMan,EASYFAX","Application",szTemp);
|
||||||
|
if (nNr <0 || szTemp = "") then
|
||||||
|
WriteProfString(szWin_Ini,"ports","EASYFAX"," ");
|
||||||
|
szTemp = szAppPath ^ "bafax.exe";
|
||||||
|
WriteProfString(szWin_Ini,"FaxMan,EASYFAX","Application",szTemp);
|
||||||
|
WriteProfString(szWin_Ini,"PrinterPorts","FaxMan","fmfaxdrv,EASYFAX,5,5");
|
||||||
|
WriteProfString(szWin_Ini,"devices","FaxMan","fmfaxdrv,EASYFAX");
|
||||||
|
endif;
|
||||||
|
// *****************
|
||||||
|
if nSystemFileModified then
|
||||||
|
SprintfBox( WARNING, "Attenzione", STR_FILE_MODIFIED, szSaveDir );
|
||||||
|
else
|
||||||
|
SprintfBox( WARNING, "Attenzione", STR_FILE_NOTMODIFIED, szSaveDir );
|
||||||
|
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;
|
||||||
|
|
||||||
|
//************
|
||||||
|
// ?????????
|
||||||
|
//
|
||||||
|
pDataList = ListCreate( STRINGLIST );
|
||||||
|
if ( pDataList = LIST_NULL ) then
|
||||||
|
_Errore( "Errore in ListCreate ( DataList )" );
|
||||||
|
exit;
|
||||||
|
endif;
|
||||||
|
pProgramList = ListCreate( STRINGLIST );
|
||||||
|
if ( pProgramList = LIST_NULL ) then
|
||||||
|
_Errore( "Errore in ListCreate ( ProgramList )" );
|
||||||
|
exit;
|
||||||
|
endif;
|
||||||
|
OpenFileMode( FILE_MODE_NORMAL );
|
||||||
|
szPath = SRCDIR;
|
||||||
|
szFileName = "FTODEL.DAT";
|
||||||
|
OpenFile( nFile, szPath, szFileName );
|
||||||
|
nFlag = GetLine( nFile, szLine );
|
||||||
|
while( nFlag = 0 )
|
||||||
|
StrSub( szFC, szLine, 0, 1 );
|
||||||
|
nLen = StrLength( szLine);
|
||||||
|
StrSub( szFileName, szLine, 1, nLen - 1 );
|
||||||
|
if ( szFC != "#" ) then
|
||||||
|
if ( szFC = "D" ) then
|
||||||
|
ListAddString( pDataList, szFileName, AFTER );
|
||||||
|
else
|
||||||
|
ListAddString( pProgramList, szFileName, AFTER );
|
||||||
|
endif;
|
||||||
|
endif;
|
||||||
|
nFlag = GetLine( nFile, szLine );
|
||||||
|
endwhile;
|
||||||
|
CloseFile( nFile );
|
||||||
|
VarSave( SRCTARGETDIR );
|
||||||
|
TARGETDIR = szDataPath;
|
||||||
|
nFlag = ListGetFirstString( pDataList, szLine );
|
||||||
|
while ( nFlag = 0 )
|
||||||
|
DeleteFile( szLine );
|
||||||
|
nFlag = ListGetNextString( pDataList, szLine );
|
||||||
|
endwhile;
|
||||||
|
ListDestroy( pDataList );
|
||||||
|
nFlag = ListGetFirstString( pProgramList, szLine );
|
||||||
|
TARGETDIR = szAppPath;
|
||||||
|
while ( nFlag = 0 )
|
||||||
|
DeleteFile( szLine );
|
||||||
|
nFlag = ListGetNextString( pProgramList, szLine );
|
||||||
|
endwhile;
|
||||||
|
ListDestroy( pProgramList );
|
||||||
|
VarRestore( SRCTARGETDIR );
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
// ****
|
||||||
|
function _InstallaFilesMinima ( )
|
||||||
|
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);
|
||||||
|
|
||||||
|
SetStatusWindow( 0, "Installazione programmi di ambiente in corso..." );
|
||||||
|
|
||||||
|
FileSetBeginDefine ( "WIN");
|
||||||
|
TARGETDIR = WINDIR ^ "SYSTEM";
|
||||||
|
if ( CompressGet( "WINSYS.Z", "*.*", INCLUDE_SUBDIR ) < 0) then
|
||||||
|
szText = STR_ERR_DECOMPRESS + " la libreria WINSYS.";
|
||||||
|
_Errore( szText );
|
||||||
|
endif;
|
||||||
|
if ( CompressGet( "WINSYSCG.Z", "*.*", INCLUDE_SUBDIR ) < 0) then
|
||||||
|
szText = STR_ERR_DECOMPRESS + " la libreria WINSYSCG.";
|
||||||
|
_Errore( szText );
|
||||||
|
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;
|
||||||
|
if bInstallDemo then
|
||||||
|
szText = "BADEMO.Z";
|
||||||
|
else
|
||||||
|
szText = "BA.Z";
|
||||||
|
endif;
|
||||||
|
if ( CompressGet( szText, "*.*", 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 );
|
||||||
|
_PerformSet ( "WIN");
|
||||||
|
StatusUpdate( ON, 100 );
|
||||||
|
_PerformSet ( "BA");
|
||||||
|
|
||||||
|
szTemp = szAppPath ^ "RECDESC";
|
||||||
|
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 = FileSetPerform ( sFileset, nDisk );
|
||||||
|
switch ( nRet )
|
||||||
|
case FS_TONEXTDISK:
|
||||||
|
if nDisk > 0 then
|
||||||
|
NumToStr( szExt, nDisk );
|
||||||
|
szTemp = szTemp + szExt ;
|
||||||
|
switch( nDisk )
|
||||||
|
case 1 : szEntDisk = STR_INSERTDISK + STR_TAGDISK1;
|
||||||
|
szTemp = "diskid.1";
|
||||||
|
endswitch;
|
||||||
|
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( "Indicazione di unita' non valida." );
|
||||||
|
case BADPATH:
|
||||||
|
_Attenzione( "Indicazione di sentiero non valida." );
|
||||||
|
case DRIVEOPEN:
|
||||||
|
_Attenzione( "Inserire un dischetto nella 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 registry (o il ProgramManager)
|
||||||
|
function _UpdateRegistry( )
|
||||||
|
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="EasyCAMPO";
|
||||||
|
ShowGroup (szFolder , SW_NORMAL );
|
||||||
|
if ( TRUE) then
|
||||||
|
// Aggiunge EasyCAMPO Program Manager
|
||||||
|
szItemName = "EasyCAMPO";
|
||||||
|
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 PRASSI.INI
|
||||||
|
function _CopiaPRASSIINI( )
|
||||||
|
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 ^ "PRASSI.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 = "PRASSI.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
|
||||||
|
if bInstallDemo then
|
||||||
|
szSrcPath= SRCDIR ^ ZIPDEMO_DIRECTORY;
|
||||||
|
else
|
||||||
|
szSrcPath= SRCDIR ^ ZIP_DIRECTORY;
|
||||||
|
endif;
|
||||||
|
szFileName = SRCDIR ^ "INSTALL.INI";
|
||||||
|
szPath= szAppPath ^ "INSTALL.INI";
|
||||||
|
|
||||||
|
WriteProfString(szPath,"Main","DiskPath",szSrcPath);
|
||||||
|
GetProfString(szFileName,"Main","DiskSize",szTmp);
|
||||||
|
WriteProfString(szPath,"Main","DiskSize",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;
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
function _ProgramPrologue()
|
||||||
|
begin
|
||||||
|
// setta lo sfondo
|
||||||
|
// Abilita il pulsante Exit
|
||||||
|
// Disabilita lo screen-saver
|
||||||
|
// Mostra una immagine nell'angolo in alto a destra
|
||||||
|
_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 bisogni 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" );
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
function _ProgramEpilogue()
|
||||||
|
begin
|
||||||
|
_FineInstallazione( );
|
||||||
|
_RiattivaScreenSaver( );
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
387
support/interni/src/aga/setup3.rul
Executable file
387
support/interni/src/aga/setup3.rul
Executable file
@ -0,0 +1,387 @@
|
|||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// funzioni specifiche di basso livello
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
*
|
||||||
|
* Function: CheckRequirements
|
||||||
|
*
|
||||||
|
* Purpose: This function will check all minimum requirements for the
|
||||||
|
* application being installed. If any fail, then the user
|
||||||
|
* is informed and the installation is terminated.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* Input:
|
||||||
|
*
|
||||||
|
* Returns:
|
||||||
|
*
|
||||||
|
* Comments:
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
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 _SettaFlagNet( )
|
||||||
|
begin
|
||||||
|
return AskOptions(EXCLUSIVE, "L'installazione sul PC puo' essere indipendente o basarsi su una installazione su server di rete. \n I programmi di EasyCAMPO ",
|
||||||
|
"vanno installati sul disco locale", bProgrammiServer,
|
||||||
|
"si trovano sul server di rete", bProgrammiServer );
|
||||||
|
end;
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
function _FindExistingInst(szPrevPath )
|
||||||
|
begin
|
||||||
|
_CercaFileOvunque( "PRASSI.AUT",szPrevPath);
|
||||||
|
if (szPrevPath!="") then
|
||||||
|
ParsePath(szPrevPath,szPrevPath,PATH);
|
||||||
|
return TRUE;
|
||||||
|
else
|
||||||
|
return FALSE;
|
||||||
|
endif;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function _CheckExistingInst(szPrevPath )
|
||||||
|
begin
|
||||||
|
szPrevPath = szPrevPath ^ "PRASSI.AUT";
|
||||||
|
return Is( FILE_EXISTS, szPrevPath );
|
||||||
|
end;
|
||||||
|
|
||||||
|
function _CheckExistingData(szDataPath )
|
||||||
|
begin
|
||||||
|
szDataPath = szDataPath ^ "COM\\";
|
||||||
|
return Is( PATH_EXISTS, szDataPath );
|
||||||
|
end;
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// determina la presenza di una installazione ricercando il file passato
|
||||||
|
function _PrimaInstallazione( szTagFile, nPrimaInst, szPrevPath )
|
||||||
|
STRING szTmp[512];
|
||||||
|
begin
|
||||||
|
nPrimaInst = 0;
|
||||||
|
_CheckExistingInst(szPrevPath );
|
||||||
|
|
||||||
|
if szPrevPath != "" then
|
||||||
|
ParsePath( szPrevPath, szPrevPath, PATH );
|
||||||
|
Sprintf( szTmp, STR_NOTFIRST1, szPrevPath );
|
||||||
|
szTmp = szTmp + STR_NOTFIRST2;
|
||||||
|
SetDialogTitle(DLG_ASK_YESNO, "Attenzione" );
|
||||||
|
if AskYesNo( szTmp, NO ) then
|
||||||
|
nPrimaInst = 2;
|
||||||
|
else
|
||||||
|
nPrimaInst = 1;
|
||||||
|
endif;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
if nPrimaInst = 2 then
|
||||||
|
_CambiaDirectory( ); // richiede di cambiare directory o confermare la sovrascrittura
|
||||||
|
endif;
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
function _PreviewBatch( )
|
||||||
|
NUMBER nFile, nGoOut, nRet, pList, nFlag, nCurFiles, nNr;
|
||||||
|
STRING szAuto, szConf, szWinIni, szTemp, szTemp1;
|
||||||
|
begin
|
||||||
|
_CreateDLG( "DLG_BATCH", 110, HWND_INSTALL );
|
||||||
|
szAuto = "";
|
||||||
|
szConf = "";
|
||||||
|
szWinIni = "";
|
||||||
|
if (szOSName != "3.95") then
|
||||||
|
szAuto = szAuto + STR_SHARE;
|
||||||
|
szAuto = szAuto + "\n";
|
||||||
|
endif;
|
||||||
|
szAuto = szAuto + STR_TEMP;
|
||||||
|
szAuto = szAuto + "\n";
|
||||||
|
if bProgrammiServer then
|
||||||
|
szAuto = szAuto + "SET PREFPATH=" + DEFAULT_LOCALPATH + "\\PREFIX.TXT";
|
||||||
|
szAuto = szAuto + "\n";
|
||||||
|
endif;
|
||||||
|
szTemp = "C:\RESET_HL.EXE";
|
||||||
|
szAuto = szAuto + szTemp;
|
||||||
|
szAuto = szAuto + "\n";
|
||||||
|
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;
|
||||||
|
szTemp1 = WINDIR ^ "WIN.INI";
|
||||||
|
nNr = GetProfString(szTemp1,"FaxMan,EASYFAX","Application",szTemp);
|
||||||
|
if (nNr < 0 || szTemp = "") then
|
||||||
|
szWinIni = "[ports]\n";
|
||||||
|
szWinIni = szWinIni + "EASYFAX=\n";
|
||||||
|
szWinIni = szWinIni + "[FaxMan,EASYFAX]\n";
|
||||||
|
szTemp = szAppPath+"bafax.exe";
|
||||||
|
szWinIni = szWinIni + "Application=" + szTemp + "\n";
|
||||||
|
szWinIni = szWinIni + "[PrinterPorts]\n";
|
||||||
|
szWinIni = szWinIni + "FaxMan=fmfaxdrv,EASYFAX,5,5\n";
|
||||||
|
szWinIni = szWinIni + "[devices]\n";
|
||||||
|
szWinIni = szWinIni + "FaxMan=fmfaxdrv,EASYFAX\n";
|
||||||
|
endif;
|
||||||
|
if szAuto = "" then
|
||||||
|
szAuto = "Nessuna modifica.";
|
||||||
|
endif;
|
||||||
|
if szConf = "" then
|
||||||
|
szConf = "Nessuna modifica.";
|
||||||
|
endif;
|
||||||
|
if szWinIni = "" then
|
||||||
|
szWinIni = "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", 10, szAuto );
|
||||||
|
CtrlSetText( "DLG_BATCH", 20, szConf );
|
||||||
|
CtrlSetText( "DLG_BATCH", 30, szWinIni );
|
||||||
|
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;
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
function _CopiaRESETHL( )
|
||||||
|
begin
|
||||||
|
VarSave(SRCTARGETDIR);
|
||||||
|
TARGETDIR = "C:\\";
|
||||||
|
SRCDIR = szAppPath;
|
||||||
|
CopyFile( "RESET_HL.EXE", "RESET_HL.EXE" );
|
||||||
|
VarRestore(SRCTARGETDIR);
|
||||||
|
end;
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
function _RemoveHDLOCK( )
|
||||||
|
begin
|
||||||
|
// HARDLOCK.VXD e' necessario solo su Win95,
|
||||||
|
// si è scoperto che è sempre necessario
|
||||||
|
// if (szOSName != "3.95") then
|
||||||
|
// DeleteFile("HARDLOCK.VXD");
|
||||||
|
// endif;
|
||||||
|
end;
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
function _ForceAttrib4Dll( )
|
||||||
|
begin
|
||||||
|
// Forza gli attributi di alcuni file per evitare che siano a sola lettura:
|
||||||
|
szTmp = szAppPath ^ "HARDLOCK.FLL";
|
||||||
|
_Cambia_Attributi(szTmp);
|
||||||
|
szTmp = szAppPath ^ "AGA.FLL";
|
||||||
|
_Cambia_Attributi(szTmp);
|
||||||
|
szTmp = szAppPath ^ "AGALIGHT.FLL";
|
||||||
|
_Cambia_Attributi(szTmp);
|
||||||
|
szTmp = szAppPath ^ "FOXW2600.ESL";
|
||||||
|
_Cambia_Attributi(szTmp);
|
||||||
|
szTmp = szAppPath ^ "AL100.DLL"; // Da cambiare se cambia versione
|
||||||
|
_Cambia_Attributi(szTmp);
|
||||||
|
szTmp = szAppPath ^ "CB5.DLL";
|
||||||
|
_Cambia_Attributi(szTmp);
|
||||||
|
szTmp = szAppPath ^ "DEVPRN.DLL";
|
||||||
|
_Cambia_Attributi(szTmp);
|
||||||
|
szTmp = szAppPath ^ "DLLGFM.DLL";
|
||||||
|
_Cambia_Attributi(szTmp);
|
||||||
|
szTmp = szAppPath ^ "MSAES110.DLL";
|
||||||
|
_Cambia_Attributi(szTmp);
|
||||||
|
szTmp = szAppPath ^ "MSAJT112.DLL";
|
||||||
|
_Cambia_Attributi(szTmp);
|
||||||
|
szTmp = szAppPath ^ "MSAJT200.DLL";
|
||||||
|
_Cambia_Attributi(szTmp);
|
||||||
|
szTmp = szAppPath ^ "VBDB300.DLL";
|
||||||
|
_Cambia_Attributi(szTmp);
|
||||||
|
szTmp = szAppPath ^ "VBRUN300.DLL";
|
||||||
|
_Cambia_Attributi(szTmp);
|
||||||
|
szTmp = szAppPath ^ "XBS200.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 sInstType = INST_ENVIRONMENT || sInstType = 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;
|
||||||
|
|
||||||
|
elseif szTemp = INST_ENVIRONMENT then
|
||||||
|
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;
|
163
support/interni/src/aga/setup4.rul
Executable file
163
support/interni/src/aga/setup4.rul
Executable file
@ -0,0 +1,163 @@
|
|||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// 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 _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;
|
||||||
|
begin
|
||||||
|
VarSave(SRCTARGETDIR);
|
||||||
|
TARGETDIR = WINDIR ^ "SYSTEM";
|
||||||
|
GetSystemInfo(WINMAJOR,nResult,szOSName);
|
||||||
|
VarRestore(SRCTARGETDIR);
|
||||||
|
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;
|
||||||
|
|
917
support/interni/src/aga/winsub.rul
Executable file
917
support/interni/src/aga/winsub.rul
Executable file
@ -0,0 +1,917 @@
|
|||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// InstallSHIELD Sample Files
|
||||||
|
// Copyright (c) 1990-1994, Stirling Technologies, Inc. All Rights Reserved
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// FILE: WINSUB.RUL
|
||||||
|
//
|
||||||
|
// PURPOSE:
|
||||||
|
// This script interfaces to several Windows APIs.
|
||||||
|
// For example, WinSubIsWindow (hWnd) interfaces to Windows
|
||||||
|
// IsWindow API. Please refer to IsWindow API in Windows
|
||||||
|
// Programmer's Manual for the detailed description.
|
||||||
|
//
|
||||||
|
// RESOURCE: NONE
|
||||||
|
//
|
||||||
|
// RELATED FILES: WINSUB.H
|
||||||
|
//
|
||||||
|
// MAIN FUNCTION CALLS:
|
||||||
|
// _WinSubGetModuleHandle ( szModule );
|
||||||
|
// Retrieves the handle of the specified module.
|
||||||
|
//
|
||||||
|
// _WinSubShowCursor ( nShow );
|
||||||
|
// This function shows or hides the cursor.
|
||||||
|
//
|
||||||
|
// _WinSubShowWindow ( hWnd, nShow );
|
||||||
|
// This function sets the given window's visibility state.
|
||||||
|
//
|
||||||
|
// _WinSubFocusControl ( hWnd, nBtnId );
|
||||||
|
// This function sets the input focus to the given child window.
|
||||||
|
// all subsequent keyboard input is directed to this child window.
|
||||||
|
// The child window, if any, that previously had the input focus
|
||||||
|
// loses it.
|
||||||
|
//
|
||||||
|
// _WinSubFocusWindow ( hWnd );
|
||||||
|
// This function sets the input focus to the given window.
|
||||||
|
// all subsequent keyboard input is directed to this window. The
|
||||||
|
// window, if any, that previously had the input focus loses it.
|
||||||
|
//
|
||||||
|
// _WinSubEnableControl ( hWnd, nBtnID, nEnable );
|
||||||
|
// This function enables or disables mouse and keyboard input to
|
||||||
|
// the given window or control. When input is disabled, the window
|
||||||
|
// ignores input such as mouse clicks and key presses. When input
|
||||||
|
// is enabled, the window processes all input.
|
||||||
|
//
|
||||||
|
// _WinSubGetChildWindow ( hWnd, nBtnID );
|
||||||
|
// This function retrieves the handle of a control that is in the
|
||||||
|
// given dialog box.
|
||||||
|
//
|
||||||
|
// _WinSubEnableWindow ( INT, INT );
|
||||||
|
// This function enables or disables mouse and keyboard input to
|
||||||
|
// the given window or control. When input is disabled, the window
|
||||||
|
// ignores input such as mouse clicks and key presses. When input
|
||||||
|
// is enabled, the window processes all input.
|
||||||
|
//
|
||||||
|
// _WinSubSetWindowTitle ( hWnd, szText );
|
||||||
|
// This function sets the given window's title to the specified text.
|
||||||
|
//
|
||||||
|
// _WinSubCenterWindow ( hWnd );
|
||||||
|
// This function changes the position and dimensions to be the center
|
||||||
|
// of the screen.
|
||||||
|
//
|
||||||
|
// _WinSubIsWindow ( hWnd );
|
||||||
|
// This function determines whether the given window handle is valid.
|
||||||
|
//
|
||||||
|
// _WinSubGetWindowRect ( hWnd, nOX, nOY, nSX, nSY );
|
||||||
|
// This function retrieves the dimensions of the bounding rectangle
|
||||||
|
// of a given window.
|
||||||
|
//
|
||||||
|
// _WinSubGetClientRect ( hWnd, nOX, nOY, nSX, nSY )
|
||||||
|
// This function retrieves the client coordinates of a window's client
|
||||||
|
// area.
|
||||||
|
//
|
||||||
|
// _WinSubSetWindowPos ( hWnd, nNX, nNY, nSX, nSY, sFlags )
|
||||||
|
// This function changes the size, position, and Z-order of child,
|
||||||
|
// pop-up, and top-level windows.
|
||||||
|
//
|
||||||
|
// _WinSubMoveWindow ( hWnd, nNX, nNY, nSX, nSY, sFlags )
|
||||||
|
// This function changes the position and dimensions of a window.
|
||||||
|
//
|
||||||
|
// _WinSubPostMessage ( hWnd, nCmd, sParam1, lParam2 )
|
||||||
|
// This function posts a message in a window's message queue and
|
||||||
|
// then returns without waiting for the corresponding window to process
|
||||||
|
// the message.
|
||||||
|
//
|
||||||
|
// _WinSubScreenSaver ( TurnOnOff );
|
||||||
|
// This function checks to see the global variable SCREENSAVER. If it
|
||||||
|
// is true then sets the state of the screen saver otherwise does nothing.
|
||||||
|
//
|
||||||
|
// _WinSubCheckScreenSaver ( )
|
||||||
|
// This function sets a bool value SCREENSAVER global variable
|
||||||
|
// that indicates whether a screen saver is on or off.
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// PARAMETERS
|
||||||
|
// szModules specifies module name to be tested.
|
||||||
|
//
|
||||||
|
// DESCRIPTION
|
||||||
|
// The routine returns 0 if module is not found, otherwise return -1.
|
||||||
|
//
|
||||||
|
// PURPOSE
|
||||||
|
// Retrieves the handle of the specified module.
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
function _WinSubGetModuleHandle ( szModule )
|
||||||
|
|
||||||
|
STRING szString [255];
|
||||||
|
NUMBER hInst;
|
||||||
|
|
||||||
|
begin
|
||||||
|
|
||||||
|
// Retrieve module handle
|
||||||
|
hInst = GetModuleHandle (szModule);
|
||||||
|
|
||||||
|
if ( hInst = -1 ) then
|
||||||
|
_WinSubErrDLLFunc ( "GetModuleHandle" );
|
||||||
|
return -1;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
hInst = hInst & 0x0000FFFF;
|
||||||
|
|
||||||
|
if (hInst = 0) then
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
|
return 1;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// PARAMETER:
|
||||||
|
// nShow specifies whether the display count to be increased
|
||||||
|
// or decreased. The display count is increased if nShow is
|
||||||
|
// nonzero. Otherwise, it is decreased. The cusor is displayed
|
||||||
|
// only if the display count is greater than or equal to zero.
|
||||||
|
// PURPOSE
|
||||||
|
// This function shows or hides the cursor.
|
||||||
|
//
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
function _WinSubShowCursor ( nShow )
|
||||||
|
|
||||||
|
NUMBER nRet;
|
||||||
|
|
||||||
|
begin
|
||||||
|
// Check if the given window handle is valid?
|
||||||
|
nRet = ShowCursor ( nShow );
|
||||||
|
if ( nRet = -1 ) then
|
||||||
|
|
||||||
|
_WinSubErrDLLFunc ( "ShowCursor" );
|
||||||
|
nRet = -1;
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
// Need to mark out the higher 2 bytes
|
||||||
|
nRet = nRet & 0x0000FFFF;
|
||||||
|
if ( nRet != 0 ) then
|
||||||
|
nRet = 1;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
endif;
|
||||||
|
|
||||||
|
return nRet;
|
||||||
|
end;
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// PARAMETERS:
|
||||||
|
// hWnd specifies the window
|
||||||
|
// nShow specifies how the window is to be shown which
|
||||||
|
// supports all SWP_* flags under Windows.
|
||||||
|
// PURPOSE
|
||||||
|
// This function sets the given window's visibility state.
|
||||||
|
//
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
function _WinSubShowWindow ( hWnd, nShow )
|
||||||
|
|
||||||
|
NUMBER nRet;
|
||||||
|
|
||||||
|
begin
|
||||||
|
// Check if the given window handle is valid?
|
||||||
|
nRet = ShowWindow ( hWnd, nShow );
|
||||||
|
if ( nRet = -1 ) then
|
||||||
|
|
||||||
|
_WinSubErrDLLFunc ( "ShowWindow" );
|
||||||
|
nRet = -1;
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
// Need to mark out the higher 2 bytes
|
||||||
|
nRet = nRet & 0x0000FFFF;
|
||||||
|
if ( nRet != 0 ) then
|
||||||
|
nRet = 1;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
endif;
|
||||||
|
|
||||||
|
return nRet;
|
||||||
|
end;
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// PARAMETERS:
|
||||||
|
// hWnd specifies the window or the dialogbox.
|
||||||
|
// nBtnId specifies the identifier of the control.
|
||||||
|
// PURPOSE
|
||||||
|
// This function sets the input focus to the given child window.
|
||||||
|
// all subsequent keyboard input is directed to this child window.
|
||||||
|
// The child window, if any, that previously had the input focus
|
||||||
|
// loses it.
|
||||||
|
//
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
function _WinSubFocusControl ( hWnd, nBtnID )
|
||||||
|
|
||||||
|
INT hCtrl;
|
||||||
|
INT nRet;
|
||||||
|
|
||||||
|
begin
|
||||||
|
|
||||||
|
// Check window handle
|
||||||
|
if ( _WinSubIsWindow ( hWnd ) <= 0 ) then
|
||||||
|
return -1;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
// Retrieve child window handle
|
||||||
|
hCtrl = _WinSubGetChildWindow ( hWnd, nBtnID );
|
||||||
|
if ( hCtrl <= 0 ) then
|
||||||
|
return -1;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
// Enable/disable the window
|
||||||
|
nRet = _WinSubFocusWindow ( hCtrl );
|
||||||
|
|
||||||
|
return nRet;
|
||||||
|
end;
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// PARAMETER:
|
||||||
|
// hWnd specifies the window
|
||||||
|
// PURPOSE
|
||||||
|
// This function sets the input focus to the given window.
|
||||||
|
// all subsequent keyboard input is directed to this window. The
|
||||||
|
// window, if any, that previously had the input focus loses it.
|
||||||
|
//
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
function _WinSubFocusWindow ( hWnd )
|
||||||
|
|
||||||
|
INT nRet;
|
||||||
|
|
||||||
|
begin
|
||||||
|
|
||||||
|
// Check window handle
|
||||||
|
if ( _WinSubIsWindow ( hWnd ) <= 0 ) then
|
||||||
|
return -1;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
// Check if the given window handle is valid?
|
||||||
|
nRet = SetFocus ( hWnd );
|
||||||
|
if ( nRet = -1 ) then
|
||||||
|
|
||||||
|
_WinSubErrDLLFunc ( "SetFocus" );
|
||||||
|
nRet = -1;
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
// Need to mark out the higher 2 bytes
|
||||||
|
nRet = nRet & 0x0000FFFF;
|
||||||
|
if ( nRet != 0 ) then
|
||||||
|
nRet = 1;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
endif;
|
||||||
|
|
||||||
|
return nRet;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// PARAMETERS:
|
||||||
|
// hWnd specifies the window or the dialogbox.
|
||||||
|
// nBtnID specifies the identifier of the control.
|
||||||
|
// nEnable specifies to enable or to disable the control.
|
||||||
|
// PURPOSE
|
||||||
|
// This function enables or disables mouse and keyboard input to
|
||||||
|
// the given window or control. When input is disabled, the window
|
||||||
|
// ignores input such as mouse clicks and key presses. When input
|
||||||
|
// is enabled, the window processes all input.
|
||||||
|
//
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
function _WinSubEnableControl ( hWnd, nBtnID, nEnable )
|
||||||
|
|
||||||
|
INT hCtrl;
|
||||||
|
INT nRet;
|
||||||
|
|
||||||
|
begin
|
||||||
|
|
||||||
|
// Check window handle
|
||||||
|
if ( _WinSubIsWindow ( hWnd ) <= 0 ) then
|
||||||
|
return -1;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
// Retrieve child window handle
|
||||||
|
hCtrl = _WinSubGetChildWindow ( hWnd, nBtnID );
|
||||||
|
if ( hCtrl <= 0 ) then
|
||||||
|
return -1;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
// Enable/disable the window
|
||||||
|
nRet = _WinSubEnableWindow ( hCtrl, nEnable );
|
||||||
|
|
||||||
|
return nRet;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// PARAMETERS:
|
||||||
|
// hWnd specifies the window or the dialogbox.
|
||||||
|
// nBtnID specifies the identifier of the child window.
|
||||||
|
// PURPOSE
|
||||||
|
// This function retrieves the handle of a control that is in the
|
||||||
|
// given dialog box.
|
||||||
|
//
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
function _WinSubGetChildWindow ( hWnd, nBtnID )
|
||||||
|
|
||||||
|
INT hCtrl;
|
||||||
|
|
||||||
|
begin
|
||||||
|
|
||||||
|
// Check window handle
|
||||||
|
if ( _WinSubIsWindow ( hWnd ) <= 0 ) then
|
||||||
|
return -1;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
// Check if the given window handle is valid?
|
||||||
|
hCtrl = GetDlgItem ( hWnd, nBtnID );
|
||||||
|
if ( hCtrl = -1 ) then
|
||||||
|
|
||||||
|
_WinSubErrDLLFunc ( "GetDlgItem" );
|
||||||
|
hCtrl = -1;
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
// Need to mark out the higher 2 bytes
|
||||||
|
hCtrl = hCtrl & 0x0000FFFF;
|
||||||
|
|
||||||
|
endif;
|
||||||
|
|
||||||
|
return hCtrl;
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// PARAMETERS:
|
||||||
|
// hWnd specifies the window.
|
||||||
|
// nBtnID specifies to enable or to disable the window.
|
||||||
|
// PURPOSE
|
||||||
|
// This function enables or disables mouse and keyboard input to
|
||||||
|
// the given window or control. When input is disabled, the window
|
||||||
|
// ignores input such as mouse clicks and key presses. When input
|
||||||
|
// is enabled, the window processes all input.
|
||||||
|
//
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
function _WinSubEnableWindow ( hWnd, nEnable )
|
||||||
|
|
||||||
|
SHORT sFlag;
|
||||||
|
INT nRet;
|
||||||
|
|
||||||
|
begin
|
||||||
|
|
||||||
|
// Check window handle
|
||||||
|
if ( _WinSubIsWindow ( hWnd ) <= 0 ) then
|
||||||
|
return -1;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
// Setup flag
|
||||||
|
if ( nEnable = 0 ) then
|
||||||
|
sFlag = 0;
|
||||||
|
else
|
||||||
|
sFlag = 1;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
|
||||||
|
// Check if the given window handle is valid?
|
||||||
|
nRet = EnableWindow ( hWnd, sFlag );
|
||||||
|
if ( nRet = -1 ) then
|
||||||
|
|
||||||
|
_WinSubErrDLLFunc ( "Enable" );
|
||||||
|
nRet = -1;
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
// Need to mark out the higher 2 bytes
|
||||||
|
nRet = nRet & 0x0000FFFF;
|
||||||
|
if ( nRet != 0 ) then
|
||||||
|
nRet = 1;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
endif;
|
||||||
|
|
||||||
|
return nRet;
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// PARAMETERS:
|
||||||
|
// hWnd specifies the window.
|
||||||
|
// szText specifies the new caption text.
|
||||||
|
// PURPOSE
|
||||||
|
// This function sets the given window's title to the specified text.
|
||||||
|
//
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
function _WinSubSetWindowTitle ( hWnd, szText )
|
||||||
|
|
||||||
|
INT nRet;
|
||||||
|
|
||||||
|
begin
|
||||||
|
|
||||||
|
// Check window handle
|
||||||
|
if ( _WinSubIsWindow ( hWnd ) <= 0 ) then
|
||||||
|
return -1;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
|
||||||
|
// Set window title
|
||||||
|
nRet = _WinSubSetWindowText ( hWnd, szText );
|
||||||
|
|
||||||
|
return nRet;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// PARAMETER:
|
||||||
|
// hWnd is the window or the dialogbox to be centered.
|
||||||
|
// PURPOSE
|
||||||
|
// This function changes the position and dimensions to be the center
|
||||||
|
// of the screen.
|
||||||
|
//
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
function _WinSubCenterWindow ( hWnd )
|
||||||
|
|
||||||
|
INT nRet;
|
||||||
|
INT nOX, nOY, nSX, nSY;
|
||||||
|
INT nNX, nNY;
|
||||||
|
SHORT sFlags;
|
||||||
|
|
||||||
|
begin
|
||||||
|
|
||||||
|
// ## remove this line when hide/show dialogbox are supported
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Check window handle
|
||||||
|
if ( _WinSubIsWindow ( hWnd ) <= 0 ) then
|
||||||
|
return -1;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
// Retrieve window rect
|
||||||
|
_WinSubGetWindowRect ( hWnd, nOX, nOY, nSX, nSY );
|
||||||
|
|
||||||
|
// Retrieve screen extent
|
||||||
|
GetExtents ( nNX, nNY );
|
||||||
|
|
||||||
|
// Calculate new orig
|
||||||
|
nSX = nSX - nOX + 1;
|
||||||
|
nSY = nSY - nOY + 1;
|
||||||
|
nNX = ( nNX - nSX ) / 2;
|
||||||
|
nNY = ( nNY - nSY ) / 2;
|
||||||
|
|
||||||
|
// Move the window
|
||||||
|
sFlags = 1;
|
||||||
|
nRet = _WinSubMoveWindow ( hWnd, nNX, nNY, nSX, nSY, sFlags );
|
||||||
|
|
||||||
|
return nRet;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// PARAMETERS:
|
||||||
|
// hWnd specifies the window.
|
||||||
|
// szText specifies the new caption text.
|
||||||
|
// PURPOSE
|
||||||
|
//
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
function _WinSubSetWindowText ( hWnd, szText )
|
||||||
|
|
||||||
|
INT nRet;
|
||||||
|
POINTER pszText;
|
||||||
|
|
||||||
|
begin
|
||||||
|
|
||||||
|
// Check window handle
|
||||||
|
if ( _WinSubIsWindow ( hWnd ) <= 0 ) then
|
||||||
|
return -1;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
// Check if the given window handle is valid?
|
||||||
|
pszText = AddressString ( szText );
|
||||||
|
nRet = SetWindowText ( hWnd, pszText );
|
||||||
|
if ( nRet = -1 ) then
|
||||||
|
|
||||||
|
_WinSubErrDLLFunc ( "SetWindowText" );
|
||||||
|
nRet = -1;
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
nRet = 0 ;
|
||||||
|
|
||||||
|
endif;
|
||||||
|
|
||||||
|
return nRet;
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// PARAMETER:
|
||||||
|
// hWnd is the window or the dialogbox to be centered.
|
||||||
|
// PURPOSE
|
||||||
|
// This function determines whether the given window handle is valid.
|
||||||
|
//
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
function _WinSubIsWindow ( hWnd )
|
||||||
|
|
||||||
|
INT nRet;
|
||||||
|
|
||||||
|
begin
|
||||||
|
|
||||||
|
// Check if the given window handle is valid?
|
||||||
|
nRet = IsWindow ( hWnd );
|
||||||
|
if ( nRet = -1 ) then
|
||||||
|
|
||||||
|
_WinSubErrDLLFunc ( "IsWindow" );
|
||||||
|
nRet = -1;
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
// Need to mark out the higher 2 bytes
|
||||||
|
nRet = nRet & 0x0000FFFF;
|
||||||
|
if ( nRet != 0 ) then
|
||||||
|
nRet = 1;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
endif;
|
||||||
|
|
||||||
|
return nRet;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// PARAMETERS:
|
||||||
|
// (INPUT)
|
||||||
|
// hWnd specifies the window.
|
||||||
|
// (OUTPUT)
|
||||||
|
// nOX receives the X-coord. of the upper-left corner.
|
||||||
|
// nOY receives the Y-coord. of the upper-left corner.
|
||||||
|
// nSX receives the X-coord. of the lower-right corner.
|
||||||
|
// nSY receives the Y-coord. of the lower-right corner.
|
||||||
|
// PURPOSE
|
||||||
|
// This function retrieves the dimensions of the bounding rectangle
|
||||||
|
// of a given window.
|
||||||
|
//
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
function _WinSubGetWindowRect ( hWnd, nOX, nOY, nSX, nSY )
|
||||||
|
|
||||||
|
NUMBER nRet;
|
||||||
|
POINTER pRect;
|
||||||
|
WINRECTSTRUCT rect;
|
||||||
|
STRING szTemp [MAX_WINSUB_TMPSTRING_LENGTH];
|
||||||
|
|
||||||
|
begin
|
||||||
|
|
||||||
|
// Check window handle
|
||||||
|
if ( _WinSubIsWindow ( hWnd ) <= 0 ) then
|
||||||
|
return -1;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
// Retrieve the address of the structure
|
||||||
|
pRect = AddressStruct ( rect );
|
||||||
|
|
||||||
|
// Retrieve window rect
|
||||||
|
nRet = GetWindowRect ( hWnd, pRect );
|
||||||
|
if ( nRet = -1 ) then
|
||||||
|
|
||||||
|
// Can not locate the function?
|
||||||
|
_WinSubErrDLLFunc ( "GetWindowRect" );
|
||||||
|
nRet = -1;
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
// Separate each field of the rect structure
|
||||||
|
StructGet ( rect, "WINRECTSTRUCT", "origX", nOX, szTemp );
|
||||||
|
StructGet ( rect, "WINRECTSTRUCT", "origY", nOY, szTemp );
|
||||||
|
StructGet ( rect, "WINRECTSTRUCT", "relX" , nSX, szTemp );
|
||||||
|
StructGet ( rect, "WINRECTSTRUCT", "relY" , nSY, szTemp );
|
||||||
|
nRet = 0;
|
||||||
|
|
||||||
|
endif;
|
||||||
|
|
||||||
|
return nRet;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// PARAMETERS:
|
||||||
|
// (INPUT)
|
||||||
|
// hWnd specifies the window.
|
||||||
|
// (OUTPUT)
|
||||||
|
// nOX receives 0.
|
||||||
|
// nOY receives 0.
|
||||||
|
// nSX receives the width of the window.
|
||||||
|
// nSY receives the height of the window.
|
||||||
|
// PURPOSE
|
||||||
|
// This function retrieves the client coordinates of a window's client
|
||||||
|
// area.
|
||||||
|
//
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
function _WinSubGetClientRect ( hWnd, nOX, nOY, nSX, nSY )
|
||||||
|
|
||||||
|
NUMBER nRet;
|
||||||
|
POINTER pRect;
|
||||||
|
WINRECTSTRUCT rect;
|
||||||
|
STRING szTemp [MAX_WINSUB_TMPSTRING_LENGTH];
|
||||||
|
|
||||||
|
begin
|
||||||
|
|
||||||
|
// Check window handle
|
||||||
|
if ( _WinSubIsWindow ( hWnd ) <= 0 ) then
|
||||||
|
return -1;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
// Retrieve the address of the structure
|
||||||
|
pRect = AddressStruct ( rect );
|
||||||
|
|
||||||
|
// Retrieve window rect
|
||||||
|
nRet = GetClientRect ( hWnd, pRect );
|
||||||
|
if ( nRet = -1 ) then
|
||||||
|
|
||||||
|
// Can not locate the function?
|
||||||
|
_WinSubErrDLLFunc ( "GetClientRect" );
|
||||||
|
nRet = -1;
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
// Separate each field of the rect structure
|
||||||
|
StructGet ( rect, "WINRECTSTRUCT", "origX", nOX, szTemp );
|
||||||
|
StructGet ( rect, "WINRECTSTRUCT", "origY", nOY, szTemp );
|
||||||
|
StructGet ( rect, "WINRECTSTRUCT", "relX" , nSX, szTemp );
|
||||||
|
StructGet ( rect, "WINRECTSTRUCT", "relY" , nSY, szTemp );
|
||||||
|
nRet = 0;
|
||||||
|
|
||||||
|
endif;
|
||||||
|
|
||||||
|
return nRet;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// PARAMETERS:
|
||||||
|
// hWnd specifies the window.
|
||||||
|
// nNX specifies X-coord. of the new upper-left corner.
|
||||||
|
// nNY specifies Y-coord. of the new upper-left corner.
|
||||||
|
// nSX specifies the width of the window.
|
||||||
|
// nSY specifies the height of the window.
|
||||||
|
// sFlags supports all SWP_* available in SetWindowPos API.
|
||||||
|
// PURPOSE
|
||||||
|
// This function changes the size, position, and Z-order of child,
|
||||||
|
// pop-up, and top-level windows.
|
||||||
|
//
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
function _WinSubSetWindowPos ( hWnd, nNX, nNY, nSX, nSY, sFlags )
|
||||||
|
|
||||||
|
NUMBER nRet;
|
||||||
|
|
||||||
|
begin
|
||||||
|
|
||||||
|
// Check window handle
|
||||||
|
if ( _WinSubIsWindow ( hWnd ) <= 0 ) then
|
||||||
|
return -1;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
// Move window
|
||||||
|
nRet = SetWindowPos ( hWnd, 0, nNX, nNY, nSX, nSY, sFlags );
|
||||||
|
if ( nRet = -1 ) then
|
||||||
|
|
||||||
|
_WinSubErrDLLFunc ( "SetWindowPos" );
|
||||||
|
nRet = -1;
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
nRet = 0;
|
||||||
|
|
||||||
|
endif;
|
||||||
|
|
||||||
|
return nRet;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// PARAMETERS:
|
||||||
|
// hWnd specifies the window.
|
||||||
|
// nNX specifies X-coord. of the new upper-left corner.
|
||||||
|
// nNY specifies Y-coord. of the new upper-left corner.
|
||||||
|
// nSX specifies the width of the window.
|
||||||
|
// nSY specifies the height of the window.
|
||||||
|
// sFlags specifies whether to redraw the window.
|
||||||
|
// PURPOSE
|
||||||
|
// This function changes the position and dimensions of a window.
|
||||||
|
//
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
function _WinSubMoveWindow ( hWnd, nNX, nNY, nSX, nSY, sFlags )
|
||||||
|
|
||||||
|
NUMBER nRet;
|
||||||
|
|
||||||
|
begin
|
||||||
|
|
||||||
|
#ifdef CHECKWINDOW=1
|
||||||
|
if ( _WinSubIsWindow ( hWnd ) <= 0 ) then
|
||||||
|
return -1;
|
||||||
|
endif;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Move window
|
||||||
|
nRet = MoveWindow ( hWnd, nNX, nNY, nSX, nSY, sFlags );
|
||||||
|
if ( nRet = -1 ) then
|
||||||
|
|
||||||
|
_WinSubErrDLLFunc ( "MoveWindow" );
|
||||||
|
nRet = -1;
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
nRet = 0;
|
||||||
|
|
||||||
|
endif;
|
||||||
|
|
||||||
|
return nRet;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// PARAMETERS:
|
||||||
|
// hWnd specifies the window.
|
||||||
|
// nCmd specifies the type of message posted.
|
||||||
|
// sParam1 specifies additional message information.
|
||||||
|
// lParam2 specifies additional message information.
|
||||||
|
// PURPOSE
|
||||||
|
// This function posts a message in a window's message queue and
|
||||||
|
// then returns without waiting for the corresponding window to process
|
||||||
|
// the message.
|
||||||
|
//
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
function _WinSubPostMessage ( hWnd, nCmd, sParam1, lParam2 )
|
||||||
|
|
||||||
|
NUMBER nRet;
|
||||||
|
|
||||||
|
begin
|
||||||
|
|
||||||
|
// Move window
|
||||||
|
nRet = PostMessage ( hWnd, nCmd, sParam1, lParam2 );
|
||||||
|
if ( nRet = -1 ) then
|
||||||
|
|
||||||
|
_WinSubErrDLLFunc ( "PostMessage" );
|
||||||
|
nRet = -1;
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
nRet = 0;
|
||||||
|
|
||||||
|
endif;
|
||||||
|
|
||||||
|
return nRet;
|
||||||
|
end;
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// PARAMETERS:
|
||||||
|
// TurnOnOff Specifies whether to turn it on or off
|
||||||
|
// 1 implies TURNON
|
||||||
|
// 0 implies TURNOFF
|
||||||
|
// PURPOSE
|
||||||
|
// This function checks to see the global variable SCREENSAVER. If it
|
||||||
|
// is true then sets the state of the screen saver otherwise does nothing.
|
||||||
|
//
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
function _WinSubScreenSaver ( TurnOnOff )
|
||||||
|
|
||||||
|
NUMBER nRet;
|
||||||
|
NUMBER nTemp;
|
||||||
|
|
||||||
|
begin
|
||||||
|
|
||||||
|
nTemp = SPIF_UPDATEINIFILE | SPIF_SENDWININICHANGE ;
|
||||||
|
|
||||||
|
if ( TurnOnOff = 1 ) then
|
||||||
|
|
||||||
|
if ( bSCREENSAVER = 1 ) then
|
||||||
|
nRet = SystemParametersInfo (
|
||||||
|
SPI_SETSCREENSAVEACTIVE,
|
||||||
|
TRUE,
|
||||||
|
NULL ,
|
||||||
|
nTemp );
|
||||||
|
endif;
|
||||||
|
|
||||||
|
|
||||||
|
elseif (TurnOnOff = 0) then
|
||||||
|
|
||||||
|
if ( bSCREENSAVER = 1 ) then
|
||||||
|
nRet = SystemParametersInfo (
|
||||||
|
SPI_SETSCREENSAVEACTIVE,
|
||||||
|
FALSE,
|
||||||
|
NULL ,
|
||||||
|
nTemp );
|
||||||
|
endif;
|
||||||
|
|
||||||
|
endif;
|
||||||
|
|
||||||
|
if ( nRet = -1 ) then
|
||||||
|
|
||||||
|
_WinSubErrDLLFunc ( "ShowWindow" );
|
||||||
|
nRet = -1;
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
// Need to mark out the higher 2 bytes
|
||||||
|
nRet = nRet & 0x0000FFFF;
|
||||||
|
if ( nRet != 0 ) then
|
||||||
|
nRet = 1;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
endif;
|
||||||
|
|
||||||
|
return nRet;
|
||||||
|
end;
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// PURPOSE:
|
||||||
|
// Check to see if the screen saver is activated if it is then set the
|
||||||
|
// global variable SCREENSAVER to 1 if it is not then set the global
|
||||||
|
// variable SCREENSAVER to 0
|
||||||
|
// PURPOSE
|
||||||
|
// This function sets a bool value SCREENSAVER global variable
|
||||||
|
// that indicates whether screen saving is on or off.
|
||||||
|
//
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
function _WinSubCheckScreenSaver ( )
|
||||||
|
|
||||||
|
NUMBER nRet;
|
||||||
|
NUMBER nTemp;
|
||||||
|
INT nCheckScreenSaver;
|
||||||
|
POINTER pCheckScreenSaver;
|
||||||
|
|
||||||
|
begin
|
||||||
|
|
||||||
|
nTemp = SPIF_UPDATEINIFILE | SPIF_SENDWININICHANGE ;
|
||||||
|
|
||||||
|
pCheckScreenSaver = AddressNumber( nCheckScreenSaver );
|
||||||
|
|
||||||
|
nRet = SystemParametersInfo (
|
||||||
|
SPI_GETSCREENSAVEACTIVE,
|
||||||
|
0 ,
|
||||||
|
pCheckScreenSaver ,
|
||||||
|
nTemp );
|
||||||
|
|
||||||
|
// check if the ScreenSaver is on or off
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if ( nCheckScreenSaver = TRUE ) then
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
elseif ( nCheckScreenSaver = FALSE ) then
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
endif;
|
||||||
|
|
||||||
|
|
||||||
|
if ( nRet = -1 ) then
|
||||||
|
|
||||||
|
_WinSubErrDLLFunc ( "ShowWindow" );
|
||||||
|
nRet = -1;
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
// Need to mark out the higher 2 bytes
|
||||||
|
nRet = nRet & 0x0000FFFF;
|
||||||
|
if ( nRet != 0 ) then
|
||||||
|
nRet = 1;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
endif;
|
||||||
|
|
||||||
|
return nRet;
|
||||||
|
end;
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// PARAMETERS:
|
||||||
|
// szDLLFuncName specifies the DLL function name which returns -1.
|
||||||
|
// PURPOSE
|
||||||
|
//
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
function _WinSubErrDLLFunc ( szDLLFuncName )
|
||||||
|
|
||||||
|
STRING szMsg [MAX_WINSUB_MSGSTRING_LENGTH];
|
||||||
|
|
||||||
|
begin
|
||||||
|
|
||||||
|
szMsg = "InstallSHIELD can not call DLL function: " + szDLLFuncName;
|
||||||
|
MessageBox ( szMsg, SEVERE );
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
BIN
support/interni/unzip.pif
Executable file
BIN
support/interni/unzip.pif
Executable file
Binary file not shown.
BIN
support/interni/unzip32.exe
Executable file
BIN
support/interni/unzip32.exe
Executable file
Binary file not shown.
BIN
support/interni/zip.pif
Executable file
BIN
support/interni/zip.pif
Executable file
Binary file not shown.
2
support/interni/zip386.bat
Executable file
2
support/interni/zip386.bat
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
@echo off
|
||||||
|
zip386.exe %1 -@ < %2
|
BIN
support/interni/zip386.exe
Executable file
BIN
support/interni/zip386.exe
Executable file
Binary file not shown.
BIN
support/interni/zipsplit.pif
Executable file
BIN
support/interni/zipsplit.pif
Executable file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user