So I put the "control" call into the Launch File command, ran the installer and got this:
-
MSI (s) (78:D4) [13:37:29:031]: Doing action: LaunchFile_Install
Action start 13:37:29: LaunchFile_Install.
CustomAction LaunchFile_Install returned actual error code 1062 (note this may not be 100% accurate if translation happened inside sandbox)
MSI (s) (78:D4) [13:37:45:655]: Note: 1: 1722 2: LaunchFile_Install 3: C:\Windows\Installer\MSIFA4B.tmp 4: /RunAsAdmin /HideWindow sc control CetrusAgentService 128
Info 2898. For DlgFont8 textstyle, the system created a 'Tahoma' font, in 0 character set.
MSI (s) (78:D4) [13:37:54:959]: Product: Cetrus Agent Service -- Error 1722. There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. Action LaunchFile_Install, location: C:\Windows\Installer\MSIFA4B.tmp, command: /RunAsAdmin /HideWindow sc control CetrusAgentService 128
Action ended 13:37:54: LaunchFile_Install. Return value 3.
Action ended 13:37:54: INSTALL. Return value 3.
This is strange indeed. For the moment I have no clue why this happens. Maybe it has something to do with the fact that the custom action call is triggered within the same process as the one which effectively installs the service too.
Please give me some more time to further test and investigate this scenario and as soon as I have a conclusion I will get back with updates.
I have tested your installation scenario and a service notification control was successfully sent to a service whithin the same installation process that installed the service too. Also, the service installation was launched within another custom action too.
I am not sure why this does not work in your case too. Can you please make sure that your service was successfully installed and started by the moment your control notification custom action was launched? For troubleshooting this you can simply add a message box custom action just before your service control notification action and when the message box is thrown you can check in the system Service Manage that your service was correctly installed and started.