phaedrus30
Posts: 12
Joined: Wed Jun 26, 2013 3:42 am

Can't install service for LocalSystem OR custom account?

Hi there,

I'm building an Enterprise Advanced Installer setup that installs a Windows Service as one of its components. I want the user to be able to use either LocalSystem or a custom account as the service account.

I've added a custom dialog that allows the user to enter credentials for the service account, defaulting to LocalSystem and a dummy password (which is ignored). I then map the associated public properties for these fields to the service account name and password in the service component, so that it works for either LocalSystem, or a custom username / password combination.

This all works perfectly for LocalSystem. However to get a domain account to work, I have to enable the "Log on as a service" checkbox, but then this stops LocalSystem from working - I get this in the log:

MSI (s) (AC:04) [16:53:43:089]: Executing op: ActionStart(Name=AI_SetLogOnAsService,,)
Action 16:53:43: AI_SetLogOnAsService.
MSI (s) (AC:04) [16:53:43:090]: Executing op: CustomActionSchedule(Action=AI_SetLogOnAsService,ActionType=3073,Source=BinaryData,Target=LogOnAsAService,CustomActionData=LocalSystem)
MSI (s) (AC:68) [16:53:43:122]: Invoking remote custom action. DLL: C:\Windows\Installer\MSI6341.tmp, Entrypoint: LogOnAsAService
CustomAction AI_SetLogOnAsService returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
Action ended 16:53:43: InstallExecute. Return value 3.

Am I doing something wrong, or is this particular workflow not supported by the product yet? All I need is for this particular custom action to be ignored if the user account = 'LocalSystem' and executed for anything else, but I can't see any way of doing this in the UI for Advanced Installer.

Cheers,

Sam
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: Can't install service for LocalSystem OR custom account?

Hi Sam,

In order to achieve what you want you can follow the steps below:
- go in the Files and Folders page and duplicate the executable related to your service like is described in the How do I install two files with the same name in the same folder tutorial
- go in the Services page and also duplicate your service (one with the "Log on as a service" option checked and one without this option)
- go in the Organization page and set conditions for the components that contain the .exe files related to your services (i.e. one will be installed if the USERNAME property is set and another if that property is empty)
- build and run the project

Let us know if this helped, otherwise give us more details about your scenario.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
phaedrus30
Posts: 12
Joined: Wed Jun 26, 2013 3:42 am

Re: Can't install service for LocalSystem OR custom account?

Thanks Eusebiu, I'll give that a try!

Cheers,

Sam
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: Can't install service for LocalSystem OR custom account?

You're welcome. Glad to help.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”