luca 2d974ea278 Patch level :2.0 nopatch
Files correlati     :
Ricompilazione Demo : [ ]
Commento            :aggiunta directory per sorgenti installazione


git-svn-id: svn://10.65.10.50/trunk@11398 c028cbd2-c16b-5b4b-a496-9718f37d4682
2003-09-05 15:05:16 +00:00

239 lines
7.8 KiB
Plaintext
Executable File
Raw Blame History

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