1062 lines
33 KiB
Plaintext
Raw Normal View History

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