commit 0e211e6b353b2c1328394fc0b0ca07e29d0a8bb6 parent ac035dba03aa85c81f2c394ff428452bdef9cad4 Author: Ben Webb <ben@salilab.org> Date: Wed, 5 Dec 2001 20:45:01 +0000 Function added to Win32 installer for testing whether we can install an NT Service Diffstat:
M | win32/setup.c | | | 13 | +++++++++++++ |
1 file changed, 13 insertions(+), 0 deletions(-)
diff --git a/win32/setup.c b/win32/setup.c @@ -44,6 +44,19 @@ char *oldversion=NULL; DWORD WINAPI DoInstall(LPVOID lpParam); static void GetWinText(char **text,HWND hWnd); +/* Returns TRUE if this operating system version supports NT Services */ +BOOL ServicesSupported(void) { + SC_HANDLE scManager; + + scManager = OpenSCManager(NULL,NULL,SC_MANAGER_CONNECT); + if (scManager) { + CloseServiceHandle(scManager); + } else if (GetLastError()==ERROR_CALL_NOT_IMPLEMENTED) { + return FALSE; + } + return TRUE; +} + void InstallService(InstData *idata) { SC_HANDLE scManager,scService; HKEY key;