Quantcast
Channel: Indigo Rose Software Forums - Forums
Viewing all articles
Browse latest Browse all 2105

Cannot successfully start service

$
0
0
My call to create the service works as I see the service was properly created. When I try to start it in the next line, though, it does not start, but rather gets a 3406 ("The start command failed.") error.

Code:

function InstallAndStartService()
        PathOfExe = SessionVar.Expand("%AppFolder%").."\\".."EcFtpClient.exe";
        NetworkService = "NT AUTHORITY\\NETWORK SERVICE";
        File.SetPermissions(SessionVar.Expand("%AppFolder%"), System.GetUserSID(NetworkService), GRANT_ACCESS, ALL_PERMISSIONS, SUB_CONTAINERS_AND_OBJECTS_INHERIT);

        Service.Create(PathOfExe, ServiceDisplayName, ServiceKeyName, SERVICE_WIN32_OWN_PROCESS, false, SERVICE_AUTO_START, SERVICE_ERROR_NORMAL, "", "", nil, NetworkService, "");
        Service.Start(ServiceDisplayName, ServiceKeyName);

        Dialog.Message("Error starting service",Application.GetLastError());  --shows 3406
end

After the installer finishes running, I can start the service manually and it works fine. I've tried adding a 5000ms delay between the Create and Start line but that didn't help, either. I've also tried removing the "KeyName" being passed to the Start command, but that didn't help, either.

Please advise.

Thanks,
Eliezer

Viewing all articles
Browse latest Browse all 2105

Trending Articles