Код:
uses
Registry;
const
cKeyName = 'Software\Eagle Dynamics\LockOn Flaming Cliffs 2\';
function GetGamePath : String;
var
R : TRegistry;
begin
Result := '';
R := TRegistry.Create;
Try
If R.OpenKeyReadOnly(cKeyName) Then
Begin
If R.ValueExists('Path')
Then Result := R.ReadString('Path');
R.CloseKey;
End;
Finally
R.Free;
End;
If Result = '' Then Raise Exception.Create('Key not found.');
end;
Если ключа нет, то получишь ошибку.