Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:24 pm
by Torrie Moore >> Wed, 20 Aug 2003 20:08:02 GMT
Reinier
I've had a look and managed to get it working.
The jade service command line for Jadrap is something like
"C:\Program Files\Jade52\bin\jadserv.exe" path="C:\Program Files\Jade52\system" ini="C:\Program Files\Jade52\system\jade.ini" service="JadeServer" run
Note the quotes are needed so windows can resolve the path names.
You also need to make the jade service dependent on the Browser service as jade needs this loaded before it will work. The service="<name>" I'm guessing needs to match the service name you used when registering the service.
The command line for Jadeapp is similar
"C:\Program Files\Jade52\bin\jadappb.exe" "C:\Program Files\Jade52\bin\jadappb.exe" path="D:\Jade Systems\Local System\System" server=multiuser appServerPort=6011
You can make the Jade app service dependent on the Jadrap service so it will be started once the server has started (if not it must be dependent on the Browser service like the Jade rap service. (This is not done by the Jade App utility)
Torrie
=======================
Some sample code in C
VOID CreateSampleService( )
{
SC_HANDLE schSCManager;
SC_HANDLE schService;
LPCTSTR lpszJadAppCommandLine = "\"C:\\Program Files\\Jade52\\bin\\jadappb.exe\" \"C:\\Program Files\\Jade52\\bin\\jadappb.exe\" path=\"C:\\Program Files\\Jade52\\bin\\System\" server=multiuser appServerPort=6011";
LPCTSTR lpszJadAppServiceName = "JadeAppServer" ;
LPCTSTR lpszJadAppDisplayName = "Jade Application Server";
LPCTSTR lpszJadAppDependencies = "Browser\0JadeServer\0" ;
LPCTSTR lpszJadRapCommandLine = "\"C:\\Program Files\\Jade52\\bin\\jadserv.exe\" path=\"C:\\Program Files\\Jade52\\bin\\system\" ini=\"C:\\Program Files\\Jade52\\bin\\system\\jade.ini\" service=\"JadeServer\" run";
LPCTSTR lpszJadRapServiceName = "JadeServer" ;
LPCTSTR lpszJadRapDisplayName = "Jade Server";
LPCTSTR lpszJadRapDependencies = "Browser\0" ;
schSCManager = OpenSCManager( NULL,SERVICES_ACTIVE_DATABASE ,SC_MANAGER_ALL_ACCESS );
// Create the Jade Rap Service and start it
schService = CreateService(
schSCManager, // SCManager database
lpszJadRapServiceName, // name of service
lpszJadRapDisplayName, // service name to display
SERVICE_ALL_ACCESS, // desired access
SERVICE_WIN32_OWN_PROCESS, // service type
SERVICE_AUTO_START, // start type
SERVICE_ERROR_NORMAL, // error control type
lpszJadRapCommandLine, // service's binary
NULL, // no load ordering group
NULL, // no tag identifier
lpszJadRapDependencies, // dependencies
NULL, // LocalSystem account
NULL); // no password
StartService( schService, 0, NULL );
CloseServiceHandle( schService );
// Create the Jade Application Server Service and start it
schService = CreateService(
schSCManager, // SCManager database
lpszJadAppServiceName, // name of service
lpszJadAppDisplayName, // service name to display
SERVICE_ALL_ACCESS, // desired access
SERVICE_WIN32_OWN_PROCESS, // service type
SERVICE_AUTO_START, // start type
SERVICE_ERROR_NORMAL, // error control type
lpszJadAppCommandLine, // service's binary
NULL, // no load ordering group
NULL, // no tag identifier
lpszJadAppDependencies, // dependencies
NULL, // LocalSystem account
NULL); // no password
StartService( schService, 0, NULL );
CloseServiceHandle( schService );
// Close the handle opened for the service manager
CloseServiceHandle( schSCManager );
}