<?sphp $this->text('pagetitle') ?>
 
Home of the Squeezebox™ & Transporter® network music players.

Install SVN trunk as service

From SqueezeboxWiki

Revision as of 06:53, 23 June 2010 by Soulkeeper (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Installation

  1. Download and install ActiveState perl (Perl 5.10 is required to run Squeezebox Server 7.4. For SqueezeCenter 7.3, use the latest 5.8 version)
  2. Download and install TortoiseSVN
  3. Download and install the Windows Server 2003 Resource Kit Tools
  4. Create a folder C:\Program Files\Squeezebox, C:\Program Files\Slimserver or C:\Program Files\SqueezeCenter. Win32.pm only looks for files in one of these folders during startup, so you must use one of the three folder names for the server to start.
  5. Browse to this folder in Explorer
  6. Right-click and choose "SVN Checkout"
  7. Enter [1] http://svn.slimdevices.com/repos/slim/7.4/trunk/server as the "URL of Repository" ("7.4" should be replaced by the release version number you'd like to base your installation upon (e.g. "7.3", for a demonstration follow the link with your browser).
  8. Click OK and wait until the Checkout completes
  9. This step is not required for 7.4. Browse to the C:\Program Files\Slimserver\server folder. Check to see if there is a folder called "Cache". If it doesn't exist, create it.
  10. Win32.pm only looks for scanner.exe which doesn't exist when running interpreted perl. You need to tell the server to use scanner.pl instead. Browse to the C:\Program Files\Squeezebox\Slim\Utils\OS folder and create the file called Custom.pm with the contents below. Replace the "Squeezebox" in the PATHs with the folder name you created above, if different.
package Slim::Utils::OS::Custom;
use strict;
use base qw(Slim::Utils::OS::Win32);
sub initDetails {
       my $class = shift;
       $class->{osDetails} = $class->SUPER::initDetails();
       # Make sure we can find any CPAN modules packaged with Squeezebox Server.
       unshift @INC, 'C:/Program Files/Squeezebox/CPAN';
       # Make sure plugin files are found.
       push @INC, 'C:/Documents and Settings/All Users/Application Data/Squeezebox';
       return $class->{osDetails};
}
sub scanner {
	return 'C:/Program Files/Squeezebox/scanner.pl';
}
1;
  1. The latest 5.10 ActiveState perl requires Digest::SHA1 to be newer than 2.11. Version 2.11 is still included within the source and needs to be removed before attempting to start the server. Browse to the C:\Program Files\Squeezebox\CPAN\Digest folder. Right click on SHA1.pm, select TortoiseSVN->Delete and add to the ignore list->SHA1.pm. After an exclaimation mark is added to the icon, delete the file.
  2. Open a Command prompt and create the new Squeezebox Server service as follows:
    instsrv slimsvc "C:\Program Files\Windows Resource Kits\Tools\srvany.exe"
  3. Configure the Squeezebox Server service as follows:
    1. Run regedit
    2. Go to [=HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services]
    3. Right-click the slimsvc keyname, point to New, and then click Key.
    4. In the console pane, for the name of the new key, type Parameters.
    5. Right-click the Parameters subkey, point to New, and then click String Value.
    6. Type the name of the new entry as Application.
    7. Right-click Application and then click Modify.
    8. In the Edit String window, in Value Data, type [C:\perl\bin\perl "C:\Program Files\Squeezebox\slimserver.pl"]
  1. If you have a firewall installed, don't forget to make sure you open the necessary ports.
  2. Start the new service from the Services tool or from the command-line as follows:
    net start slimsvc
  3. Browse to http://localhost:9000 to check it's working.
  4. Finally, go to Server Settings and set your Music Folder location.


Steps 3.2 through 3.8 can be replaced by a copy and paste of the following into notepad, save the file as slimsvc.reg and import with regedit. You may need to adjust the path to slimserver.pl.

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\slimsvc]
"Type"=dword:00000010
"Start"=dword:00000002
"ErrorControl"=dword:00000001
"ImagePath"=hex(2):43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,\
  20,00,46,00,69,00,6c,00,65,00,73,00,5c,00,57,00,69,00,6e,00,64,00,6f,00,77,\
  00,73,00,20,00,52,00,65,00,73,00,6f,00,75,00,72,00,63,00,65,00,20,00,4b,00,\
  69,00,74,00,73,00,5c,00,54,00,6f,00,6f,00,6c,00,73,00,5c,00,73,00,72,00,76,\
  00,61,00,6e,00,79,00,2e,00,65,00,78,00,65,00,00,00
"DisplayName"="Squeezebox Server SVN"
"ObjectName"="LocalSystem"
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\slimsvc\Parameters]
"Application"="C:\\perl\\bin\\perl  \"C:\\Program Files\\Squeezebox\\slimserver.pl\""
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\slimsvc\Security]
"Security"=hex:01,00,14,80,90,00,00,00,9c,00,00,00,14,00,00,00,30,00,00,00,02,\
  00,1c,00,01,00,00,00,02,80,14,00,ff,01,0f,00,01,01,00,00,00,00,00,01,00,00,\
  00,00,02,00,60,00,04,00,00,00,00,00,14,00,fd,01,02,00,01,01,00,00,00,00,00,\
  05,12,00,00,00,00,00,18,00,ff,01,0f,00,01,02,00,00,00,00,00,05,20,00,00,00,\
  20,02,00,00,00,00,14,00,8d,01,02,00,01,01,00,00,00,00,00,05,0b,00,00,00,00,\
  00,18,00,fd,01,02,00,01,02,00,00,00,00,00,05,20,00,00,00,23,02,00,00,01,01,\
  00,00,00,00,00,05,12,00,00,00,01,01,00,00,00,00,00,05,12,00,00,00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\slimsvc\Enum]
"0"="Root\\LEGACY_SLIMSVC\\0000"
"Count"=dword:00000001
"NextInstance"=dword:00000001

Updating

To update to the latest version simply browse to the folder in Explorer, right-click, and choose "SVN Update". You will need to restart the service for the changes to take effect.

Alternatively, a batch file can be written to automate the update. The following temporarily stops the service, updates to the latest SVN, and then restarts the service. This ensures that all files can be overwritten during the update. Here's an example of how the batch file should look like:

net stop slimsvc
"<path to Tortoise SVN bin folder>\TortoiseProc.exe" /command:update /path:"<path to Slimserver>" /notempfile /closeonend:1
net start slimsvc

Where <path to Slimserver>: e.g. "C:\Program Files\SlimServer"

The argument /closeonend:1 closes the TortoiseProc window if no errors occur. If you would prefer to keep the GUI window up with what occured you can remove this argument.

Errors

Should Squeezebox Server crash, the application will not log the error report to the event log. srvany.exe will still be running, and thus the service will still be reported as running. The service should therefore be stopped manually using net stop slimsvc, and then restarted with net start slimsvc.