Oleksandr
Posts: 15
Joined: Tue Dec 04, 2012 11:09 am

"Log on as a service" fails installation in silent mode

Dear Support,

We've faced with very weird behavior which prevents us from using silent mode installation for Windows services (this is most frequently used way of installation).
We have 2 installers for installing Windows services.
While running installation in user interactive mode administrator can specify service account for the service, for silent mode this service account is specified using installer parameters.
After installation this service account should be granted "Log on as a service" permissions, otherwise Windows service fails to start.
The installers are run on the Windows Server 2008 R2 machines with UAC turned on, thus when running in user interactive mode, Windows displays elevating user permissions popup asking Administrator for permission to proceed with installation. And in user interactive mode it works fine and service account is granted "Log on as a service" permissions.
But if we run installers in silent mode either from command-line or from PowerShell script (PS script launching installers in silent mode is used in almost all cases) installation fails.
Both command line and PS script are launched under "Run as administrator" option.
Below please find the dump from verbose log:

MSI (s) (C8:74) [08:05:21:394]: Executing op: ActionStart(Name=AI_SetLogOnAsService,,)
MSI (s) (C8:74) [08:05:21:394]: Executing op: CustomActionSchedule(Action=AI_SetLogOnAsService,ActionType=3073,Source=BinaryData,Target=LogOnAsAService,CustomActionData=null)
MSI (s) (C8:18) [08:05:21:394]: Invoking remote custom action. DLL: C:\Windows\Installer\MSI940F.tmp, Entrypoint: LogOnAsAService
CustomAction AI_SetLogOnAsService returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
MSI (s) (C8:74) [08:05:21:441]: User policy value 'DisableRollback' is 0
MSI (s) (C8:74) [08:05:21:441]: Machine policy value 'DisableRollback' is 0
Action ended 8:05:21: InstallExecute. Return value 3.

I guess this is very common error and it doesn't give too much information about the failure itself.
Won't it be possible to provide us with the debug version of dll used to install Windows service so we can check why it fails and maybe adjust the environments (unfortunately, turning UAC off on the servers is not the option)?
Thank you.

Kind regards,
Oleksandr
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: "Log on as a service" fails installation in silent mode

Hello Oleksandr,

This may happen if the Command Line Interface is not elevated. So, can you please make sure that you use the “Run as admin” option to open your command line?

Please let us know if that helped.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Oleksandr
Posts: 15
Joined: Tue Dec 04, 2012 11:09 am

Re: "Log on as a service" fails installation in silent mode

Dear Dan,

Thank you very much for the quick reply.
We tried to test installers in silent mode (as it was described) with elevated permissions for both command line and PowerShell.
Unfortunately, they fail in both cases.
Although if we start installers in UI mode, they elevate permissions and installation succeeds.
Could you please provide us (if possible, of course) the debug version of dll to generate the log when installing Windows service?
Thank you.

Kind regards,
Oleksandr
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: "Log on as a service" fails installation in silent mode

Hi Oleksandr,

I'm afraid that the service registration is handled by the Windows Installer through the InstallService standard action, so we don't have any debug .dll

I've tested your scenario with our own service and it worked as expected. Please make sure that you have all the necesary dependencies for your sevice.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”