Acrobat Reader - Detect installed version

From ISXKB

Jump to: navigation, search

This script is useful to detect if, and which version of Adobe Acrobat reader is installed on the PC.

[Setup]
AppName=Acrobat
AppVerName=Acrobat
DefaultDirName={pf}\Acrobat
DisableStartupPrompt=true
Uninstallable=false
DisableDirPage=true
OutputBaseFilename=Acrobat
CreateAppDir=false


[Code]

function GetAcrobatReaderVersion(): String;
var
  sVersion:  String;
begin
  sVersion := '';
  RegQueryStringValue( HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AcroRd32.exe',
     '', sVersion );
  GetVersionNumbersString( sVersion , sVersion );
  Result := sVersion;
end;


function NextButtonClick(CurPage: Integer): Boolean;
begin

  // by default go to next page
  Result := true;

  if CurPage = wpWelcome then
  begin

    if Length( GetAcrobatReaderVersion() ) = 0 then
    begin
      MsgBox( 'There is not installed Acrobat reader',  mbInformation, MB_OK );
      Result := false;
    end
    else
      MsgBox( 'Acrobat reader installed is version ' + GetAcrobatReaderVersion() ,
           mbInformation, MB_OK );

  end;

end;
Personal tools
Ads: