njshaw2
Posts: 26
Joined: Fri Apr 19, 2013 10:36 am

Service error control not 'continuing' on error

My installer installs a service as part of its jobs, which works fine. It is set to then start the service. There are certain conditions under which my service may not start (independent of the installer), and I want the installer to display a warning message to the user (to say they'll need to start it manually later) then continue with the install.

The Services page has an Error Control dropdown with the 3 options:
  • Ignore the error
    Display an error message and continue
    Display an error message and restart the computer
BUG REPORT: I would have expected the second option to show an error message then continue with the install. What it actually does is abort the installation. (Note, I don't have "The service is vital for installation" ticked).

So to work around this, I'm setting the error control to "Ignore the error".

BUG REPORT 2: "Ignore the error" only works if I don't have "Wait until the service completes" ticked in the Control Operations part of the service setup.

So, I have "Ignore the error" set and "wait until the service completes" UNticked: The installer now correctly ignores the service start failure. But then I want to detect whether the service started or not using the built-in custom-action "Detect a service". I put this as a sequenced custom-action just after the InstallFinalize, thinking I could then have a Message Box custom action just after it in sequence to warn the user, if AI_SERVICE_STATE <> "Started". The problem is, AI_SERVICE_STATE equals "Started" at that point. I'm thinking I must be doing something very wrong here. The documentation mentions that the Detect a Service custom-action can be put anywhere in the sequence, which implies it could be being called at any point, though the service is never "started" (it may be "starting", at some point before it fails, but never "started". Does the Detect a Service custom action not work on services the installer itself has just installed perhaps?...

What am I doing wrong? Is there a better way?
Dan
Posts: 4513
Joined: Wed Apr 24, 2013 3:51 pm

Re: Service error control not 'continuing' on error

Hello,

Thank you for sharing this with us.

For the bug no 1 report is a windows installer bug.
You can see very easily that every time you change the option in the “Error control”, in the “Table Editor” page, selecting the “Service Install” from Tables the ErrorControl is changing having the 3 possible values (0, 1 or 3). In the service install table from Microsoft you can verify that our values are the same with the one that OS should manage. It's nothing we can do about it.

For the bug report no 2 we will have an improvement to synchronize the UI in our next releases.

Indeed the custom action can be placed anywhere, I'm not sure why you have this issue.
Can you please send us the .AIP (project file) and a verbose log of the installation to support at advancedinstaller dot com so we can investigate them.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
njshaw2
Posts: 26
Joined: Fri Apr 19, 2013 10:36 am

Re: Service error control not 'continuing' on error

Thanks for the info Dan. Shame Microsoft can't fix such an obvious problem! :)

I think I've resolved the service detection problem; I've made them into out-of-sequence custom actions instead, and now execute them as Published Events when the user clicks the Finish button on the ExitDlg. That seems to do the job correctly, so I'll stick with that.
sjeslis
Posts: 308
Joined: Mon Aug 22, 2011 11:40 pm
Contact: Website

Re: Service error control not 'continuing' on error

In "Bug Report 1" I was under the assumption that the "Error Control" settings had to do more with how the service should behave when its "running" vs. how the Installer should behave. The text here implies both.
Scott Jeslis
Senior Software Engineer
Cicero, Inc.

Return to “Common Problems”