Service_Create
Description
Section titled “Description”Creates a Windows service with the specified name, display name and executable.
Syntax
Section titled “Syntax”Service_Create(sServiceName, sDisplayName, sBinPath) As Boolean
Parameters
Section titled “Parameters”sServiceName (String)
Section titled “sServiceName (String)”Name of the service. Use the service name, for example Spooler, not the display name.
sDisplayName (String)
Section titled “sDisplayName (String)”Display name of the service, as shown in the Services console
sBinPath (String)
Section titled “sBinPath (String)”Full path of the service executable, including any command-line arguments
Return value
Section titled “Return value”The function returns False if Windows can’t create the service, for example because a service with the same name already exists. giErrorCode contains the return code from Windows, and the package log shows its meaning.
Example
Section titled “Example”If bStatus Then bStatus = Service_Create("ServiceName", "DisplayName", "C:\CapaInstaller.exe")Related functions
Section titled “Related functions”Service_Delete Service_Exist Service_SetStartMode Service_Start Constants Package Property Variables