I assume, you intend to do the Installation of the service operated by a service user (if LogonInformationDlg is filled), or by "Local System" (If the LogonInformationDlg is leaved empty.
I had a similar situation, and resolved it this way:
Install the service without Login Information (so it is installed with "Local System" as the Service User.
Before the LognInformationDlg I inserted a "ServiceLogonTypeDlg, which asks if the service sould be run as Local System, or as a Domain / Local User and set a property "RUNS_AS_SYSTEM" or "RUNS_AS_USER".
According to this property I run a couple of custom actions (GrantLogonAsAService, SetServiceLogon) after the "Install Services" Standard Action, which does
- ntrights.exe -u [SERVICE_USER] +r SeServiceLogonRight (GrantLogonAsAService)
- sc config [ServiceName] type= own start= auto obj= [SERVICE_USER] password= [SVC_USR_PASSWORD] (SetServiceLogon)
Both Custom actions have the condition RUNS_AS_USER AND SERVICE_USER <> ""
I was not able to to it in other way.
hope this helps
Jimmy
FOLLOW US
Get the latest news in Application Packaging