|
|
|
|
|
Dicas
|
|
Visual Basic (ActiveX/Controles/DLL)
|
|
|
Título da Dica: Detectando a versão do IE com o INNO SETUP
|
|
|
|
Postada em 15/5/2006 por ¨Hennyere¨
[Setup] AppName=IEVersion2 AppVerName=IEVersion2 DefaultDirName=IEVersion2 DisableStartupPrompt=true Uninstallable=false
[Code] function InitializeSetup( ): Boolean; var sIEVersion: String; cIEMinVersionRegistry: String; cIEMinVersionShowed: String;
begin Result := true;
// Initialize constants: cIEMinVersionRegistry := '4.72'; // this is display version v4.01 cIEMinVersionShowed := '4.01SP2'; // this is registry entry v4.72.xxx
// now we check the version of the installed Internet Explorer: sIEVersion := GetIExplorerVersion(); if ( sIEVersion <= cIEMinVersionRegistry ) then begin if ( sIEVersion = '' ) then sIEVersion := ''; MsgBox( 'ERROR: The Program needs an installed' + #13 + #10 + ' Microsoft Internet Explorer >= v' + cIEMinVersionShowed + #13 + #10 + ' (detected version:"' + sIEVersion + '") !' + #13 + #10 + #13 + #10 + 'Please install the necessary version (or higher) and then reenter the setup !', mbError, MB_OK ); Result := false; end; end; // END_FUNC InitializeSetup
function GetIExplorerVersion(): String; var sVersion: String; begin RegQueryStringValue( HKLM, 'SOFTWAREMicrosoftInternet Explorer', 'Version', Result ); if ( Result = '' ) then begin // the registry-key does not exist; // versions before v4 used another one --> check this also RegQueryStringValue( HKLM, 'SOFTWAREMicrosoftInternet Explorer', 'IVer', sVersion ); if ( sVersion <> '' ) then begin Result := ''; case sVersion of '103': Result := '3.0'; '102': Result := '2.5'; '101': Result := '2.0'; '100': Result := '1.0'; end; // END case sVersion of end; // END if ( sVersion <> '' ) then end; // END if ( Result = '' ) then end; // END_FUNC GetIEXplorerVersion
|
|
|
|
|