Time for me to write a blog..... 
I didn't have access to the source code for ServiceExistsService but I do have access to example Code from InstallSite. Changing the rights request to the OpenSCManager and OpenService to only require SC_MANAGER_CONNECT privedge allows the ServiceExists check to be made on Vista without requiring the elevated token from UAC.
Put the below code in a NTService.rul file and call it from Setup.rul like this:
//top of setup.rul
#include "NTService.rul"
// inside your function
bExists = _IsServiceAvailable( "BITS" );
Code:
#if _ISCRIPT_VER >= 0x600
#ifndef AddressString
#define AddressString &
#endif
#endif
// constants copied from Winsvc.h
#define SC_MANAGER_ALL_ACCESS 0x000F003F
#define SERVICE_ALL_ACCESS 0x000F01FF
#define SC_MANAGER_CONNECT 0x00000001
// Prototype the service control APIs
prototype NUMBER AdvAPI32.OpenSCManagerA(POINTER, POINTER, NUMBER);
prototype NUMBER Advapi32.OpenServiceA(NUMBER, POINTER, NUMBER);
prototype BOOL AdvAPI32.CloseServiceHandle(NUMBER);
prototype BOOL Advapi32.QueryServiceStatus(NUMBER, POINTER);
prototype NUMBER KERNEL.GetLastError();
// global service handles, filled and released
POINTER ptrMcName, ptrDBName, pszSStartName;
NUMBER schService, schSCManager;
// prototype the InstallScript functions.
prototype _InitServiceConnections(STRING);
prototype _CloseServiceConnections();
prototype _IsServiceAvailable(STRING);
function _InitServiceConnections(szServiceName)
NUMBER nReturn, nResult;
begin
// Initialize global variables
schService = NULL;
schSCManager = NULL;
ptrMcName = NULL; // use local machine
ptrDBName = NULL; // open services active database
// Locals
nReturn = 0;
nResult = 0;
// Load ADVAPI32.DLL, which is necessary for Service Manager-
// related functions.
if (UseDLL("AdvAPI32.dll") < 0) then
#ifdef _NTS_DEBUG
MessageBox ("Couldn't load AdvAPI32.dll.", SEVERE);
#endif
nReturn = -1;
endif;
// First establish the connection with the Service Manager
if (nReturn = 0) then
schSCManager = OpenSCManagerA(ptrMcName, ptrDBName, SC_MANAGER_CONNECT);
if (schSCManager = NULL) then
nResult = GetLastError();
#ifdef _NTS_DEBUG
SprintfBox(INFORMATION, "OpenSCManagerA Error",
"Error connecting to Service Manager.\n\n" +
"Error number = %ld.", nResult);
#endif
nReturn = -1;
endif;
endif;
if (szServiceName != "") then
pszSStartName = AddressString(szServiceName); //FIX IS3
if (nReturn = 0) then
// Now open the service.
schService = OpenServiceA(schSCManager, pszSStartName, SC_MANAGER_CONNECT); //FIX IS3
if (schService = NULL) then
nResult = GetLastError();
#ifdef _NTS_DEBUG
SprintfBox(INFORMATION, "OpenService Error",
"Error opening service.\n\n"+
"Error number = %ld.", nResult);
#endif
nReturn = -1;
endif;
endif;
endif;
return nReturn;
end;
/////////////////////////////////////////////////////////////
// FUNCTION: _CloseServiceConnections()
//
// DESCRIPTION: Closes connections to services and manager
//
// OUTPUT: 0 If function is successful in connecting
// -1 If function fails to connect
/////////////////////////////////////////////////////////////
function _CloseServiceConnections()
NUMBER nResult;
begin
// Close connection to Service Manager
if (schSCManager != NULL) then
nResult = CloseServiceHandle(schSCManager);
endif;
// Close handle of the service installed
if (schService != NULL) then
nResult = CloseServiceHandle(schService);
endif;
// Deinitialize global variables, just in case
schService = NULL;
schSCManager = NULL;
ptrMcName = NULL; // use local machine
ptrDBName = NULL; // open services active database
UnUseDLL("AdvAPI32.dll");
return nResult;
end;
/////////////////////////////////////////////////////////////
// FUNCTION: _IsServiceAvailable(szServiceName)
//
// DESCRIPTION: Checks to see if a service is installed
//
// INPUT: szServiceName = service name to check for
//
// OUTPUT: 0 If service is available
// -1 If service is unavailable
/////////////////////////////////////////////////////////////
function _IsServiceAvailable(szServiceName)
NUMBER nvResult;
begin
nvResult = _InitServiceConnections(szServiceName);
_CloseServiceConnections();
return nvResult;
end;