I’d like to know if there is any built-in functionality to obtain the User that is running a Windows Service using Wix 3.5. I have seen this post where it’s stated that there is nothing built into Wix to check for a Service Status. I think that if this is not possible, then getting the User that runs the service is far more impossible.
Using a Custom Action is a last resort.
Thanks.
I’d like to know if there is any built-in functionality to obtain the User
Share
You could do a registry search for HKLM\SYSTEM\CurrentControlSet\Services\ServiceName|ObjectName but that assumes nothing updated the registry value without restarting the service. (Potential disconnect).
Programatically (custom action) you can interact with the SCM API (win32) or WMI (win32_service class StartName attribute) to get more detailed information.
I agree with avoiding CA’s but if the only purpose of the CA is to gather data and not change machine state, it can be done very robustly with little downside.