Saturday, March 23, 2013

generic cheat sheet on installing a Windows Service

How to install a Windows Service once you have an installer:
  1. You will need a user to run the service
    • Right-click on "My Computer" or the comparable icon and pick "Manage."
    • At the Computer Manager pane that appears.
    • Navigate to: Configuration > Local Users and Groups > Users
    • Add a user.
    • At: Configuration > Local Users and Groups > Groups ...right-click on the "Administrators" group and select "Add to Group..." from the menu which appears.
    • Add the new user here at the "Administrators Properties" window which pops up.
  2. Uninstall the same service if it exists in a botched form. (This can be just another part of getting the installation right.)
    • Stop the service.
    • Run the command prompt as an administrator, and yes, you must be an administrator.
    • Navigate to: C:\Windows\Microsoft.NET\Framework\v4.0.30319
    • Run: installutil /u C:\LocaleOfPublishedFiles\NameOfApplication.exe
  3. Install the service from an installer, this may mean pushing to a shared folder on another server. If you are using a local .wsdl (for SalesForce for example) you may need to beforehand update the "Web Reference URL" property at Visual Studio to point to the appropriate folder within the share folder as found from the root of the applicable drive.
  4. Once the files have been installed from the installer, the App.config will have, at the installation, a counterpart named something like NameOfApplication.exe.config. Do not assume that the settings in this file mirror those at the App.config. Somehow they may grow apart. Perhaps the installer caches these settings. You may need to update these settings.
  5. Once the files have been installed from the installer, they must ALSO be installed from the installutil tool:
    • Run the command prompt as an administrator, and yes, you must be an administrator.
    • Navigate to: C:\Windows\Microsoft.NET\Framework\v4.0.30319
    • Run: installutil C:\LocaleOfPublishedFiles\NameOfApplication.exe
  6. Type "component services" at the start menu to bring up the "Component Services" dialog box. Go to services and find your service.
    • Right-click on the service and pick "Properties" to specify the user who will use the service. A dialog box with four tabs will appear. Specify the user at the second tab dubbed "Log On."
    • Right-click on the service and pick "Start."
    • Console Root > Event Viewer (Local) > Windows Logs > Application ...should be navigated to within the "Component Services" dialog box. Herein, check the logs for progress and signs of health or a lack of health.

No comments:

Post a Comment