Wix4 Controlling when a call to an extension happens / Virtual Service Accounts #8658
-
I'm trying to use Wix4 to deploy a Windows service. I want to make use of the Windows virtual service account feature. However I'm hitting a significant block. The following code will install the service, but it fails to start. I did some digging and it looks like the virtual service account doesn't have the Logon As a Service right assigned to it by default. If I wait for my installer to complete the service installation, then manually grant it the right the service will start. Great - but I can't find a way to assign those rights at the right time within Wix4. There is a potential option to use the util extension included within Wix.
Unfortunately I can't figure out how to specify to run this only after the ServiceInstall has completed. It would need to run after the service is installed and before the service start is attempted. From looking at the execution sequence it appears that these tasks happen one after the other, which is fine. But I simply can't figure out how to drop the util:User extension action inbetween. The block appears to allow me to specify that something should happen before or after a given activity, but then it seems like that can only link to a custom action, which in turn appears to only be an external executable rather than the built-in Wix extension. I really don't want to have to hand craft and deploy additional executables to complete these actions, it just seems excessive given that it should be possible within Wix's capabilities. Does anyone have any pointers as to how I can make this flow work? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
The What normally happens is that ConfigureUsers (the Custom Action) is introduced into the execution schedule, it runs and looks through the .MSI tables for user things, and based on desired state and current state it determines which other Custom Actions should be called. If you look in Orca, you could try to schedule ConfigureUsers between the InstallServices, and the StartServices. |
Beta Was this translation helpful? Give feedback.
The
util:User
functionality is broken up into a few different Custom Actions. So you'd need to control the scheduling of the appropriate one of those.https://github.com/wixtoolset/wix/blob/ce73352b1fa1d4f9cded10a0ee410f2e786bd326/src/ext/Util/wixlib/UtilExtension_Platform.wxi#L136-L145
What normally happens is that ConfigureUsers (the Custom Action) is introduced into the execution schedule, it runs and looks through the .MSI tables for user things, and based on desired state and current state it determines which other Custom Actions should be called.
If you look in Orca, you could try to schedule ConfigureUsers between the InstallServices, and the StartServices.
Easiest would be to use …