cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
klim_c
Level 3

HOw to detect if Active Directory is installed on target machine?

A would appreciate any help - snippet, InstallShield IDE steps or any article.
Thanks
Labels (1)
0 Kudos
(2) Replies
WalterT
Level 4

you need to do a system search for a file or registry key that get installed by active directory and store this in a Public property say MYSEARCHPROP. You can use this in a condition like this: if MYSEARCHPROP then ...
This works because MYSEARCHPROP is empty if the search returns no results.
0 Kudos
klim_c
Level 3

WalterT wrote:
you need to do a system search for a file or registry key that get installed by active directory and store this in a Public property say MYSEARCHPROP. You can use this in a condition like this: if MYSEARCHPROP then ...
This works because MYSEARCHPROP is empty if the search returns no results.


Hi Walter,
Thanks a lot for your help. I've just done this

function BOOL CheckMAPI()
STRING szKey, szField, szValue, svResult, msg;
NUMBER nValue, nSize, nType;
BOOL nRet;
begin

nRet = FALSE;
szKey = "\\SOFTWARE\\Microsoft\\Windows Messaging Subsystem";
szField = "MAPI";
nType = REGDB_NUMBER;
REGDB_OPTIONS = REGDB_OPTIONS | REGDB_OPTION_WOW64_64KEY;
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
//Check to see if the key exists.
if (RegDBKeyExist (szKey) = 1) then
// Retrieve key value information.
if (RegDBGetKeyValueEx(szKey, szField, nType, szValue, nSize) = 0) then
StrToNum(nValue,szValue);
Sprintf(msg,"Method Suceess: RegDBGetKeyValueEx(szKey=%s,szField=%s,nType=%d,szValue=%s,nSize=%d)",szKey,szField,nType,szValue,nSize);
WriteLogMsg(msg);

if(nValue = 1) then
// look for MAPI32.DLL
if(FindFile (WINSYSDIR, "mapi32.dll", svResult) = 0) then
WriteLogMsg("Detected " + "MAPI32.DLL at WINSYSDIR=" + WINSYSDIR);
nRet = TRUE;
else
WriteLogMsg("NOT Detected " + "MAPI32.DLL at WINSYSDIR=" + WINSYSDIR);
endif;

endif;

else
Sprintf(msg,"Method Failed: RegDBGetKeyValueEx(szKey=%s,szField=%s,nType=%d,szValue=%s,nSize=%d)",szKey,szField,nType,szValue,nSize);
WriteLogMsg(msg);
SprintfBox( SEVERE, "MAPI not detected", "Unable to retreive MAPI information." );
endif;

endif;

if(!nRet) then
msg = "MAPI not installed.\nCisco Mail Free/Busy Synchronization service requires MAPI installed and running.";
WriteLogMsg(msg);
SprintfBox( SEVERE, "MAPI not installed", msg);
endif;

return nRet;
end;


Is there any MAPI prerequisite or AD prerequisites I could include into the project? Similar to .NET Framework prerequisite etc.?

Thanks,
0 Kudos