Export (0) Print
Expand All

FolderWatcherService sample

Expression Studio 4.0

The FolderWatcherService sample provides an automatic watch folder and encoding service for Microsoft Expression Encoder. Building the sample creates two files, FolderWatcherService.exe.xml and FolderWatcherService.exe. In FolderWatcherService.exe.xml, you set the location where the service will create the output and source file folders. You can also specify your e-mail address and SMTP server so that you can receive e-mails detailing the status of your encoding projects. Next, you install the service using FolderWatcherService.exe.

To install the FolderWatcher service

  1. In the "C:\Program Files\Microsoft Expression\Encoder 4\SDK\Samples" folder, locate the FolderWatcherService.csproj file.

  2. Build the file. This creates the FolderWatcherService.exe.xml and FolderWatcherService.exe files.

  3. Before you can continue, you must modify the FolderWatcherService.exe.xml file. Locate and open it either in Microsoft Visual Studio 2010 or in a text editor.

  4. The FolderWatcherService.exe.xml file contains a default reference to an invalid location. Change that location to one that is specific to your local hard disk by doing the following:

    1. Locate the <setting name="watcherRootDirectory" serializeAs="String"><value>[location]</value> string.

    2. Substitute the [location] designation for a specific location on your hard disk, for example, <value>C:\Watcher</value>.

  5. Note that this alteration of the FolderWatcherService.exe.xml file will not instruct the service to automatically create the designated folder on your hard disk. You must do that manually. To do so, browse to the location that you specified in the previous step and create the designated folder. For example, to correspond with the location designated in the previous step, browse to drive C and create a folder called "Watcher" there. This is the folder where all the FolderWatcherService folders will be stored, after you install the service.

  6. Optional: If you want to configure the service to send you an e-mail about the encoding status, or if you want to regulate the frequency of progress updates, the number times to retry copying a file, or the maximum time that older files remain accessible, you can specify all of those parameters in the subsequent tags in the FolderWatcherService.exe.xml file.

  7. Save the file.

  8. Now, you can install the service. At a command prompt, run the FolderWatcherService.exe with the "install" option, as shown in the following example.

    FolderWatcherService.exe -install
    

    After you install the service, it creates five folders inside the folder that you specified in the FolderWatcherService.exe.xml file:

    • Presets folder   Serves as the location where you put the presets that dictate how you want your files to be encoded. For more information about how to put presets into a specified folder, see the Expression Encoder User Guide.

    • Source folder   Serves as your watch folder. Any file placed in this folder is encoded according to the presets you put in the Presets folder.

    • Working folder   Contains the files that are currently being encoded.

    • Output folder   Contains all of the final encoded files.

    • Logs folder   Contains details about each encoding job.

To work with the FolderWatcher service

At a command prompt, do one of the following:

  • To start the service, run FolderWatcherService.exe with the "start" option, as shown in the following example.

    FolderWatcherService.exe -start
    
  • To determine the status of the service, run FolderWatcherService.exe with the "status" option, as shown in the following example.

    FolderWatcherService.exe -status
    
  • To stop the service, run FolderWatcherService.exe with the "stop" option, as shown in the following example.

    FolderWatcherService.exe -stop
    

To encode using the FolderWatcher service

  1. Make sure that the FolderWatcherService is started.

  2. Browse to the folder that you created to hold the FolderWatcherService folders, and open it.

  3. Put at least one preset in the Presets folder. For more information about how to put Expression Encoder presets in a specified folder, see the Expression Encoder User Guide. If you put more than one preset in the folder, the service creates a separate encoded file for each preset.

  4. Put at least one media file in the Source folder. The service now begins to encode the added media files.

To uninstall the FolderWatcher service

  • At a command prompt, run FolderWatcherService.exe with the "uninstall" option, as shown in the following example.

    FolderWatcherService.exe -uninstall
    

   © 2011 Microsoft Corporation. All rights reserved.

Community Additions

ADD
Show:
© 2015 Microsoft