RegDBGetKeyValueEx返回-1 [英] RegDBGetKeyValueEx returns -1

查看:101
本文介绍了RegDBGetKeyValueEx返回-1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用以下installscript代码来标识是否已安装SharePoint.但它不起作用.该函数返回-1.不知道是什么问题.有人可以帮忙吗?我想按照以下步骤做

I am using below installscript code to identify whether SharePoint is installed or not. but its not working. The function returns -1. Not sure what is the issue. can someone please help? I want to do below steps

  1. 首先到达此注册表位置"SOFTWARE \ Microsoft \ Shared Tools \ Web服务器扩展\ 15.0""

  1. Reach to this registry location first ""SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\15.0""

读取名称"SharePoint"及其值已安装"

Read Name "SharePoint" and its value "Installed"

请参阅附件图片.

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;                    

图像

推荐答案

Installscipt :您的价值所在何处?您是否考虑了注册表的64-32 bit部分?

  • HKEY_LOCAL_MACHINE\SOFTWARE

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node

可能要调查如果您需要注册表的64位部分,请点击此处的64位选项 (REGDB_OPTION_WOW64_64KEY).

AppSearch :对于这样的简单注册表检索,您可以使用系统搜索视图/向导.

AppSearch: for a simple registry retrieval like this, you could use AppSearch instead (System Search View). I don't have the time to make a sample for that right now. You can also see the System Search View / Wizard.

这篇关于RegDBGetKeyValueEx返回-1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆