RegDBGetKeyValueEx retorna -1
Estou usando o código installscript abaixo para identificar se o SharePoint está instalado ou não. mas não está funcionando. A função retorna -1. Não tenho certeza qual é o problema. Alguém pode ajudar por favor? Eu quero fazer as etapas abaixo
1) Acesse esse local do registro primeiro "" SOFTWARE \ Microsoft \ Ferramentas compartilhadas \ Extensões de servidor da Web \ 15.0 ""
2) Leia o nome "SharePoint" e seu valor "Instalado"
consulte a imagem anexada.
function IsSharePointInstalled()
STRING szKey, svValue, szName;
NUMBER nvType, nvSize;
begin
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
szKey = "SOFTWARE\\Microsoft\\Shared Tools\\Web Server
Extensions\\15.0";
szName = "SharePoint";
if(RegDBKeyExist (szKey) >=1) then
MessageBox("Key found", INFORMATION);
if(RegDBGetKeyValueEx(szKey, szName, nvType, svValue, nvSize) < 0) then
MessageBox("Failed to get value", INFORMATION);
else
MessageBox("Successfully got value", INFORMATION);
endif;
endif;
RegDBSetDefaultRoot(HKEY_CLASSES_ROOT);
end;