vlexdev
Flexera beginner

starting a service using installscript

i tried starting service after creating it. but it is'nt working. Although the creation of service is successfull.

kindly help.

Below is the code:
function AddService(hMSI)
string szServiceStartName, szPassword,szStartServiceArgs;
string szServiceName, szServiceDisplayName, szServiceDescription, szServicePathFile;

begin


szServiceName = "Platform Service";
/*szServiceDisplayName = "Platform Service";
szServiceDescription = "Service ";
szServicePathFile = INSTALLDIR^"\\ClientFiles\\PlatformMonitorService.exe";
if (!ServiceExistsService ( szServiceName )) then
if (!ServiceAddService(szServiceName, szServiceDisplayName, szServiceDescription, szServicePathFile, FALSE, ""))then
MessageBox("Service created successfully!", INFORMATION);
else
MessageBox("Service could not be created!", SEVERE);
endif;
endif;*/

szStartServiceArgs="";
ServiceStartService (szServiceName,szStartServiceArgs);

end;

Labels (1)
0 Kudos