Hello Lee,
Unfortunately, the predefined
"Detect Service" custom action does not allow the use of wildcards.
However, we can create our own custom action that does that. For instance, we can use a PowerShell script and the
"Run PowerShell Inline Script" custom action.
In order to get the status of a service using wildcards in PowerShell, we can proceed as it follows (the example give here is for the
Windows Update service - wuauserv):
Code: Select all
$serviceStatus = (Get-Service wuaus*).Status
- serviceStatus.png (51.86 KiB) Viewed 5727 times
We can then use the $serviceStatus variable to set an installer property, similar to our predefined custom action that sets the
AI_SERVICE_STATUS property, e.g.:
Code: Select all
$serviceStatus = (Get-Service wuaus*).Status
AI_SetMsiProperty MY_SERVICE_STATUS $serviceStatus
Hope this helps!
Best regards,
Catalin