ojanacek
Posts: 8
Joined: Fri Jul 28, 2017 2:29 pm

Service failure actions in merge module not applied

Hi,

we are having issue setting up a Windows service failure operation in a merge module. The merge module comes with a set of files and a Windows service definition. The merge module requires parameters for Windows service name, display name and description. These are used for the service definition. Once used from an installer project and installed, it registers the service just fine. It also respects Control operations in that the service doesn't start after install. All good.

But then when a Failure operation is defined and all three failure actions specified we cannot see these applied in the final service installation. All the actions are set to Restart the service After 1 minute. It's set to configure both on Install and Reinstall (since we need to update existing installations).

There's only this much about it in the verbose log. Hardly helpful.

MSI (s) (48:38) [09:19:19:334]: Doing action: AI_ProcessFailActions.181E7C3D_2A17_4623_8FB3_91028F900CB9
Action 9:19:19: AI_ProcessFailActions.181E7C3D_2A17_4623_8FB3_91028F900CB9. Generating actions to configure service failure actions
Action start 9:19:19: AI_ProcessFailActions.181E7C3D_2A17_4623_8FB3_91028F900CB9.
MSI (s) (48:1C) [09:19:19:338]: Invoking remote custom action. DLL: C:\WINDOWS\Installer\MSI20DE.tmp, Entrypoint: ProcessFailActions
MSI (s) (48!78) [09:19:19:345]: PROPERTY CHANGE: Adding AI_CA_MODULE_ID property. Its value is '181E7C3D_2A17_4623_8FB3_91028F900CB9'.
MSI (s) (48!78) [09:19:19:345]: PROPERTY CHANGE: Deleting AI_CA_MODULE_ID property. Its current value is '181E7C3D_2A17_4623_8FB3_91028F900CB9'.
Action ended 9:19:19: AI_ProcessFailActions.181E7C3D_2A17_4623_8FB3_91028F900CB9. Return value 1.

It happens in two different merge modules created by different teams.
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Service failure actions in merge module not applied

Hello,

Are you by any chance using an older version of Advanced Installer?

I have had a look over our bug tracking tool and I've noticed a fixed issue regarding the same scearnio back in version 15.6.

If that's the case, please upgrade to a newer version and let me know if everything is working as expected.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ojanacek
Posts: 8
Joined: Fri Jul 28, 2017 2:29 pm

Re: Service failure actions in merge module not applied

Not sure if the CreateVersion is relevant but this is what I see in the file CreateVersion="15.1" version="19.2". The later is, of course, the one we use on daily basis and on our build server.
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Service failure actions in merge module not applied

Hello,

No, the CreateVersion shouldn't really matter in this case.

I have run a test just now and it looks like you are right about this, as I was able to reproduce with the latest version as well.

I will create a ticket and hopefully this will be fixed in a future version of Advanced Installer.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ojanacek
Posts: 8
Joined: Fri Jul 28, 2017 2:29 pm

Re: Service failure actions in merge module not applied

Thank you for the confirmation. For now we settled on a workaround that I'll mention here in case someone needs it until this is fixed.

Add a custom action "Run PowerShell Inline Script" in the install execution stage right after "Add Resources". In the script, specify a service name parameter and make sure you assign it from a property right below the script window. In our case Parameters values: [WindowsServiceName]. Then in the scripts call "sc.exe" with arguments as showed below. In our case, 3 restarts with no delay in between are desired.

Code: Select all

Param($ServiceName)
sc.exe failure $ServiceName actions= restart/0 reset= 86400
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Service failure actions in merge module not applied

Hello,

Thank you for your followup on this and for sharing your solution with us!

I am sure this will come in handy for users facing a similar scenario. :)

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Service failure actions in merge module not applied

Hello,

This has been fixed in version 21.2 of Advanced Installer.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”