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.
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
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); [B]Service.Create[/B](PathOfExe, ServiceDisplayName, ServiceKeyName, SERVICE_WIN32_OWN_PROCESS, false, SERVICE_AUTO_START, SERVICE_ERROR_NORMAL, "", "", nil, NetworkService, ""); [b]Service.Start[/B](ServiceDisplayName, ServiceKeyName); Dialog.Message("Error starting service",Application.GetLastError()); --shows 3406 end
Please advise.
Thanks,
Eliezer
Comment