//--------------------------------------------------------------------------------------- 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 _CheckExistingInst(szPrevPath ) begin szPrevPath = szPrevPath ^ "campo.ini"; return Is( FILE_EXISTS, szPrevPath ); end; //__________________________________________________________________________________________________ function _CheckExistingData(szDataPath ) begin szDataPath = szDataPath ^ "COM\\"; return Is( PATH_EXISTS, szDataPath ); end; //________________________________________________________________________________________________________________________ // *** propone i cambiamenti al file config.sys (files = ...) in caso di win 95/98 function _PreviewBatch( ) NUMBER nFile, nGoOut, nRet, pList, nFlag, nCurFiles, nNr; STRING szConf, szTemp, szTemp1; begin _CreateDLG( "DLG_BATCH", 110, HWND_INSTALL );; szConf = ""; EzConfigGetValue( "FILES", nCurFiles ); if nCurFiles < NUM_FILES_IN_CONFIG then szConf = szConf + "FILES="; NumToStr( szTemp, NUM_FILES_IN_CONFIG ); szConf = szConf + szTemp; szConf = szConf + "\n"; endif; if szConf = "" then szConf = "Nessuna modifica."; endif; nGoOut = FALSE; while nGoOut = FALSE nRet = WaitOnDialog( "DLG_BATCH"); if ( nRet = DLG_ERR ) then _Attenzione( STR_ERR_DLG ); nGoOut = TRUE; endif; switch( nRet ) case DLG_INIT: CtrlSetText( "DLG_BATCH", 20, szConf ); case IDD_CONTINUE: nRet = TRUE; nGoOut = TRUE; case 2: nRet = FALSE; nGoOut = TRUE; case DLG_CLOSE: nGoOut = TRUE; endswitch; endwhile; EndDialog( "DLG_BATCH" ); ReleaseDialog( "DLG_BATCH" ); return nRet; end; //----------------------------------------------------------------------------- // Funzione che mostra un dialog box di benvenuto function _Benvenuto( ) NUMBER nGoOut, nRet, nHwnd; begin _CreateDLG( "DLG_WELCOME", DLG_WELCOME, HWND_INSTALL ); nGoOut = FALSE; while nGoOut = FALSE nRet = WaitOnDialog( "DLG_WELCOME"); if ( nRet = DLG_ERR ) then _Attenzione( STR_ERR_DLG ); nGoOut = TRUE; endif; switch( nRet ) case IDD_EXIT: _ExitOnConfirm( ); case IDD_CONTINUE: nGoOut = TRUE; case DLG_CLOSE: nGoOut = TRUE; endswitch; endwhile; EndDialog( "DLG_WELCOME" ); ReleaseDialog( "DLG_WELCOME" ); end; //________________________________________________________________________________________________________________________ // *** // Forza gli attributi delle DLL per evitare che siano di sola lettura function _ForceAttrib4Dll( ) begin szTmp = szAppPath ^ "cb6.dll"; _Cambia_Attributi(szTmp); szTmp = szAppPath ^ "gfm.dll"; _Cambia_Attributi(szTmp); szTmp = szAppPath ^ "pdflib.dll"; _Cambia_Attributi(szTmp); szTmp = szAppPath ^ "xidll.dll"; _Cambia_Attributi(szTmp); szTmp = szAppPath ^ "xvaga.dll"; _Cambia_Attributi(szTmp); szTmp = szAppPath ^ "wxmsw240.dll"; _Cambia_Attributi(szTmp); end; //----------------------------------------------------------------------------- // chiede conferma per l'uscita ed esce function _ExitOnConfirm( ) begin if ! _Verifica( "Desideri veramente terminare la installazione ?" ) then return; endif; _ShowExitDialog( DLG_EXITQUIT ); exit; end; //----------------------------------------------------------------------------- function _FineInstallazione( ) STRING szRunProgram[ _MAX_LENGTH ]; LONG lGoOut, lRet, lHwnd, lFlag; begin _CreateDLG( "DLG098", ID_DLG098, HWND_INSTALL ); lGoOut = FALSE; while lGoOut = FALSE lRet = WaitOnDialog("DLG098"); if ( lRet = DLG_ERR ) then _Attenzione( STR_ERR_DLG ); lGoOut = TRUE; endif; switch( lRet ) case DLG_INIT: lHwnd = CmdGetHwndDlg( "DLG098" ); if nSystemFileModified then CtrlSetText( "DLG098", ID_DLG098_RUN, "Riavvia il computer" ); CtrlSetText( "DLG098", 1004, "I files di sistema sono cambiati.\nOccorrera' riavviare il computer perche' le modifiche siano attive." ); endif; case ID_DLG098_RUN: lFlag = FALSE; lGoOut = TRUE; case ID_DLG098_EXIT: lFlag = TRUE; lGoOut = TRUE; case DLG_CLOSE: lGoOut = TRUE; endswitch; endwhile; EndDialog( "DLG098" ); ReleaseDialog( "DLG098" ); if ( lFlag = FALSE ) then if nSystemFileModified then System( SYS_BOOTMACHINE ); else // ChangeDirectory(szAppPath); // szRunProgram = szAppPath ^ "\\BA1.EXE -0 C"; // LaunchApp( szRunProgram , "" ); endif; return TRUE; else return FALSE; endif; end; //------------------------------------------------------------------------------------------------------------------------ function _CanOverwrite( ) BOOL bRetv; NUMBER nTemp; STRING szPath[256],szTemp[80],szJunk[80]; begin bRetv=FALSE; szPath=szDataPath ^ "\\CONFIG"; szTemp=szPath ^ DATATYPE_FILE; if ( Is( FILE_EXISTS, szTemp ) ) then OpenFileMode( FILE_MODE_NORMAL ); OpenFile( nTmp, szPath, DATATYPE_FILE); if GetLine( nTmp, szTemp ) = 0 then if szTemp = INST_DEMO then bRetv=_Verifica("Il direttorio indicato contiene dati \ndi una precedente installazione demo.\n\nConfermi la sovrascrittura"); elseif szTemp = INST_AUTOFORM then if szInstType = INST_ENVIRONMENT || szInstType = INST_AUTOFORM then bRetv=_Verifica("Il direttorio indicato contiene i dati \ndi una precedente installazione di autoformazione.\n\nConfermi la sovrascrittura"); else MessageBox("Impossibile scrivere i dati nel direttorio indicato.\nIl direttorio contiene gia' i dati di una precedente installazione \ndi autoformazione.",SEVERE); endif; else MessageBox("Impossibile scrivere i dati nel direttorio indicato.\nIl direttorio contiene gia' i dati di una precedente installazione.",SEVERE); endif; else MessageBox( "Il direttorio indicato contiene dati \ndi una precedente installazione.",SEVERE); endif; CloseFile( nTmp ); else MessageBox( "Impossibile installare. Il direttorio indicato contiene dati \ndi una precedente installazione.",SEVERE); endif; return bRetv; end;