Headphones Service

htpc build

Headphones Service Install Guide

NOTE: It appears that Windows 7 is no longer allowing users to merge .reg files into the Windows registry. You must manually add the Parameter key and string values to your registry. Please refer to the video as we walk you through how to add these keys and values to your windows registry.

NOTE: It appears that Windows 7 no longer allows users to create a service for a program inside of the “Program Files” folder.

NOTE: This guide assume that you have the Windows Resource Kit 2003. This will enable you to install Headphones as a service. If you do not have the Windows Resource Kit please visit HTPCBuilds.com Window Resource Kit Install Guide.

1. We first need to create the service Headphones. We need to open a windows command prompt. The command prompt needs elevated user rights to install a service. There are two ways to open a elevated command prompt:

Go to your start menu, and type into the search ‘cmd’. Your computer should automatically find the Command Prompt. By simultaneously hitting CTRL, SHIFT, & ENTER, you will launch an elevated instance of the command prompt. The Windows User Account Control will prompt you to confirm that you executed this command. Click “Yes”.

Go to your start menu and navigate to All Programs -> Accessories and right click on Command Prompt then select “Run as Administrator”. The Windows User Account Control will prompt you to confirm that you executed this command. Click “Yes”.

You should now have an elevated command prompt. To confirm this is a elevated command prompt, check to see if your command prompt displays “C:\Windows\System32?. If your command prompt does not display this directory, and instead displays “C:\User\XXXXXX\” where XXXX is your username, then you do not have an elevated command prompt.

Elevated

Not Elevated

2. In your elevated command prompt type and execute the following command:

instsrv Headphones “C:\Program Files (x86)\Windows Resource Kit\Tools\srvany.exe”

The command prompt will echo back that the service has installed successfully.

3. Now that your service is installed we need to add a TCPIP dependency to the service. To add the dependency type and execute the following command:

sc config Headphones depend= Tcpip

The command prompt should echo back that the service successfully has been changed.

4. Now that the service has been created, we need to add the proper parameters to help the service run correctly.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Headphones\Parameters]

“AppDirectory”=”C:\Python27

“Application”=”C:\Python27\python.exe C:\Headphones\headphones.py”

NOTE: It appears that Windows 7 no longer allows users to create a service for programs inside of the “Program Files” folder. Therefore, make sure your Headphones is not inside of the “Program Files”.

5. Start by launching “regedit”, the windows registry editor. To do this, hit “Windows+R”, and the “Run” box will pop up. Type in “regedit” and hit enter.

6. Now you should have the registry editor launched.

7. In the registry editor navigate to:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Headphones\

Right click on Sabnzbd and click “New Key”. Name this new key “Parameters”.

NOTE: If this is your first Sabnzbd Service install, you will not have AppDirectory & Application.

8. Next you’ll need to add three string values to your Parameters key.To add the string values, right click on “Parameters”, go to “New”, then click on “String Value”. Do this two times, renaming each string value as one of the following:

“AppDirectory”

“Application”



9. For the string value “AppDirectory”, set the value to the directory of your Python.

IE: “AppDirectory”=”C:\Python27”

10. For the string value “Application”, set the value to the Python executable with the Headphones.py database.

IE: “Application”=”C:\Python27\python.exe C:\Headphones\headphones.py”

Headphones has now be installed as a service! To confirm that Headphones is running as a service reboot your computer and navigate to http://localhost:8181 or http://XXX.XXX.XXX.XXX:8181.

NOTE: XXX.XXX.XXX.XXX is the ip address of your server. Also note that 8181 is Headphones’ default port, if you have changed the port you will need to adjust your address.

Check back often for more guides to help you with your HTPC build!