How do I install a service for a custom user?AnswerThe Java Service Tutorial explains how to install a service under the Local System Account. However, if you want to install a service for a specific user, you need to make sure that this user has enough privileges to install and start system services. In order to be able to install system services, the user for which you install the service must be an Administrator. Also, this user must be able to log on as a service (a policy must be set for him). Install a service for an existing userYou can configure a service installation for a custom user which is present on the target machine by following these steps:
-u [SERVICE_USER] +r SeServiceLogonRight
The "ntrights.exe" file will set a policy for the "[SERVICE_USER]" user which will allow him to log on as a service (install and start system services). If you want to revoke this privilege, you can create another custom action under the "InstallExecuteSequence" -> "Uninstall" standard action. This custom action will be configured like the previous one, except it will use this command line: -u [SERVICE_USER] -r SeServiceLogonRight
You can verify if an user can log on as a service by using the "Local Security Policy" tool: Control Panel -> Administrative Tools -> Local Security Policy\Local Policies\User Rights Assignment\Log on as a service Install a service for an user created by your installation packageWindows Installer cannot install a service for an user which is created by the same package which installs the service. Therefore, if you want to install a service for an user you create, you can follow these steps:
When using this approach, the prerequisite package will create your custom user. After its installation is finished, the main package will install the service for this custom user. | |
|
| Privacy Policy | Windows Installer | Search Engine Ranking | Link Analyzer | ||
| © 2002 - 2008 Caphyon Ltd. Trademarks belong to their respective owners. All rights reserved. | ||