CISA FotoGallery

Statistiche

Tot. visite contenuti : 928369
Home Articoli tecnici InnoSetup Determinare la versione di Access

Determinare la versione di Access

;Inno Setup Extensions Knowledge Base
;Article 20 - How to detect if and which version of MS Access is installed
;http://www13.brinkster.com/vincenzog/isxart.asp?idart=20
;Author: Vincenzo Giordano
;Compiler: ISX 3.0.2
;

;
; ISX 3.0.2
;
;
[Setup]
AppName=MSAccessVersion
AppVerName=MSAccessVersion
DefaultDirName={pf}\MSAccessVersion
DisableStartupPrompt=true
Uninstallable=false
DisableDirPage=true
OutputBaseFilename=MSAccessVersion

[Code]

// Legenda
// 8.00.00.3512 Access 97
// 8.00.00.4122 Access 97 SR1
// 8.00.00.5903 Access 97 SR2
// 9.00.00.2719 Access 2000
// 9.00.00.3822 Access 2000 SR1
// 9.00.00.4506 Access 2000 SR2
// 10.00.2627.1 Access XP

function AccessVersion(): String;
var accversion, accpath: String;
begin
accversion := '';

if RegQueryStringValue(HKEY_LOCAL_MACHINE,
'SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\MSACCESS.EXE',
'', accpath) then
begin
// in varResult there is path of msaccess.exe
GetVersionNumbersString( accpath, accversion );
end;

Result := accversion;
end;



function InitializeSetup(): Boolean;
var accver: String;
begin
accver := AccessVersion();
if Length( accver ) > 0 then
begin

MsgBox( 'Version ('+ accver +') of MS Access is installed.',
mbInformation, MB_OK );

// go on with setup
Result := true;

end
else begin
MsgBox( 'MS Access is not installed.', mbInformation, MB_OK );

// cannot go with setup anyway
Result := false;
end;

end;