function GetAcrobatPath(var AcrobatPath: string): Boolean;
var
key: hkey;
AcrobatStatus: Integer;
ExeFilePathPath: array[0..100] of char;
valuebuffersize, valuedatasize: dWord;
ValueData: array[0..100] of char;
fg: Boolean;
Index: Integer;
IndexTop: Integer;
begin
fg := False;
Result := False;
AcrobatPath := '';
IndexTop := 0;
AcrobatStatus := 0;
while (IndexTop < 2) and (fg = False) do
begin
case IndexTop of
0: AcrobatStatus := RegOpenKey(HKEY_CURRENT_USER, 'Software/Adobe/Adobe Acrobat/6.0/InstallPath', KEY);
1: AcrobatStatus := RegOpenKey(HKEY_CURRENT_USER, 'Software/Adobe/Adobe Acrobat/5.0/InstallPath', KEY);
end;
if AcrobatStatus = 0 then
begin
Index := 0;
ExeFilePathPath[0] := #0;
while (Index < 2) do
begin
valuebuffersize := 100;
valuedatasize := 100;
if (RegEnumValue(key, Index, @ExeFilePathPath, valuebuffersize, nil, nil, @ValueData, @valuedatasize) = 0) then
begin
AcrobatPath := strpas(valueData);
if (AcrobatPath[length(AcrobatPath)] <> '/') then
AcrobatPath := AcrobatPath + '/';
if FileExists(AcrobatPath + 'Acrobat.exe') then
begin
fg := True;
Result := True;
Exit;
end
else
begin
Index := Index + 1;
end;
end;
end;
RegCloseKey(KEY);
IndexTop := IndexTop + 1;
if fg = True then
begin
Result := True;
Exit;
end;
end
else
begin
IndexTop := IndexTop + 1;
end;
end;
end;