首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何检查是否安装了Adobe Acrobat Reader

如何检查是否安装了Adobe Acrobat Reader
EN

Stack Overflow用户
提问于 2013-04-10 08:06:14
回答 1查看 6.6K关注 0票数 1

我有这个代码,提示用户安装Foxit PDF阅读器。如何检查电脑是否已安装Adobe Acrobat Reader?

代码语言:javascript
复制
[Components]
Name: "foxit"; Description: "Foxit"; Types: "games"; ExtraDiskSpaceRequired: "30000000"; Check: "not AcrobatExists"; 

如果找不到Adobe Acrobat Reader,我想开始安装Foxit Reader。

EN

回答 1

Stack Overflow用户

发布于 2013-04-14 21:25:42

尝试此Acrobat Reader - Detect installed version脚本:

代码语言:javascript
复制
[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;

您可以使用GetAcrobatReaderVersion()并创建一个检查函数,例如:

代码语言:javascript
复制
function AcrobatExists(): Boolean;
begin
    result := Length( GetAcrobatReaderVersion() ) <> 0;
end;
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15914697

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档