查看注册表中是否有安装程序的路径 procedure TForm6.Button1Click(Sender: TObject); var Rego:TRegistry; begin Rego:=TRegistry.Create; with Rego do begin try try Rego. RootKey:=HKEY_LOCAL_MACHINE; openKey'SOFTWARE\Microsoft\Windows\CurrentVersion\AppPaths\Acrobat.exe’,True); RarPath:=ReadString('path'); if trim(RarPath)='' then begin messagedlg(' 你机器上没有安装Acrobat',mtInformation,[mbOK],0); exit; end; except messagedlg('读取注册表失败 ',mtInformation,[mbOK],0); exit; end; finally Rego.Free; end; end; end;
查看注册表中是否有安装程序的路径
procedure TForm6.Button1Click(Sender: TObject);
var
Rego:TRegistry;
begin
Rego:=TRegistry.Create;
with Rego do
begin
try
try
Rego.
RootKey:=HKEY_LOCAL_MACHINE;
openKey'SOFTWARE\Microsoft\Windows\CurrentVersion\AppPaths\Acrobat.exe’,True);
RarPath:=ReadString('path');
if trim(RarPath)='' then
begin
messagedlg(' 你机器上没有安装Acrobat',mtInformation,[mbOK],0);
exit;
end;
except messagedlg('读取注册表失败 ',mtInformation,[mbOK],0);
exit;
end;
finally
Rego.Free;
end;
end;
end;