Wix - ServiceControl start takes four minutes to fail, should be 30 sec

前端 未结 3 691
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-07 04:49

My service automatically starts during install...



        
3条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-07 05:12

    Error 1920: this error would seem to indicate a missing privilege (logon as a service) or access right, or perhaps some sort of interference from an external cause or perhaps an MSI package that is not running elevated (unlikely I think - then you can only write to per-user paths).

    • Are you running this service with the LocalSystem account or NetworkService or LocalService or with a regular user account? (about the above service accounts).
    • Or the newer concepts of managed service accounts, group managed service accounts or virtual accounts step-by-step info (concepts that I do not know enough about).
    • If you use a regular user account, does it have the "logon as a service" privilege set?
      • If you create the user in your WiX MSI (or define it), you can set LogonAsService="yes" for the User(element) in question. I believe this adds the privilege for the account (SeServiceLogonRight).
      • A privilege is different from access rights (ACLs) - for the record: a privilege is a pervasive system-wide access to some sort of function / feature - for example change system time, start / stop services, logon as a service, etc... (see section 13 here for more).
    • Is there a security software / antivirus on your test box? It could be interfering with your setup's API calls. If so, try to disable it (if possible) during the installation process. I'll mention firewalls too.
    • Is your MSI set to run elevated? (Package Element => InstallPrivileges).
    • UPDATE: Just adding the issue it turned out to be: the custom action update of config data needed to run with elevated rights or faulty service configuration data resulted which in turn caused the generic 1920 error message. In this case the configuration was in JSON format, it can obviously be in several formats: XML, registry, INI, etc... See OP comment above for more details.

    Timeout: As to the long timeout. I have seen this sometimes with security software (locks the whole setup so the service timeout runs only after some scanning delay), or with setups that trigger the creation of a system restore point prior to the installation kicking off in the first place (this is one of the possible reasons why some MSI installations suddenly take a long time when they ordinarily complete quickly - it is possible to prevent this restore point creation - MSIFASTINSTALL). Also, maybe check this answer from serverfault and the registry value described for whether there is a policy on your network to change the default service start timeout: How do I increase windows service startup timeout (ServicesPipeTimeout). Frankly I am not sure whether MSI uses its own timeout or the system default one - maybe someone can illuminate? One could also speculate that the database connection you initiate has its own timeout? (doesn't match your interactive test experience?) Maybe you can check your code and your call and let us know? Does your service depend on another service? (see symantec link below). Any dependencies to files installed to the GAC or to WinSxS as mentioned by Chris in the first link below?

    A lot of speculation. Let's hope some of it helps or that it inspires other ideas that solve the problem. Below some links for safekeeping (trying to write a generic answer that may also help others with the same or similar problems - which makes the answer too long, sorry about that).


    Links:

    • Error 1920 service failed to start. Verify that you have sufficient privileges to start system services
    • http://blog.iswix.com/2008/09/different-year-same-problem.html
    • https://support.symantec.com/en_US/article.TECH103676.html (adds issues such as: dependency on other services)
    • How to debug Windows services (service timeout and more)
    • windows service startup timeout (I would check this)
    • Service failed to start error 1920 (generatePublisherEvidence)

提交回复
热议问题