Microsoft Producer for PowerPoint 2003 SDK banner art
PreviousNext

Adding E-services Using the Registry

You can add or change WebHost keys in the Windows system registry on the user's computer by creating a special script file with a .reg file name extension, which can be executed on the user's computer to make changes to the registry automatically.

Caution   Incorrectly editing the registry may severely damage your system. Before making changes to the registry, you should back up any valued data on the computer.

A .reg file is a plain text file that you can create using a text editor, such as Microsoft Notepad. You can simply write the script and save the file with the .reg file name extension or change the file name extension from .txt to .reg using Windows Explorer.

Each .reg file must begin with the same line. Use this text exactly as it appears:

Windows Registry Editor Version 5.00

Next, you can include lines of script to specify keys. If a specified key does not exist, one is created automatically, and any subkeys you specify are written to the registry as well. If the key already exists, then any existing subkeys are modified to match the new values specified in the script. To specify a key, enclose the key name in square brackets:

[HKEY_CURRENT_USER\Software\Microsoft\Producer\WebHosts\MyWebHost]

The previous example specifies a new key in the registry below the WebHosts key and gives it the name MyWebHost.

Following each key, you can specify subkeys and their values. Whether or not you specify subkeys in your script, a subkey with no value set, named (Default), is always added to the new key in the user's registry.

If you choose to modify the registry in this manner, be certain to provide a different GUID for each ID subkey you create. You can generate GUIDs by using a utility such as guidgen.exe, which is included with Microsoft Visual Studio.

The following example is a complete .reg file that adds a new e-service to Microsoft Producer that can be accessed from the Publish Wizard. The service (and therefore the key) is named MyNewWebHost and specifies the HTMLBasedUIURL subkey value as the Microsoft home page. It also adds a key named Profiles below the MyNewWebHost key.

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Producer\WebHosts\MyNewWebHost]
"DiscussionServerURL" = ""
"HTMLBasedUIURL" = "http://www.microsoft.com"
"ID" = "13003B9C-83ED-4c95-B950-D163C33B0C15"
"Password" = ""
"PlaybackLocation" = ""
"PublishDestination" = ""
"WindowsMediaPlaybackAddress" = ""
"WindowsMediaPublishDestination" = ""
"Username" = ""

When you specify a URL for the HTMLBasedUIURL subkey, Producer displays that Web page in the Publish Wizard when the user selects your e-service from the Web server list. You can also choose to specify values in the registry as default values for your e-service. For instance, you can specify default publish profiles for your e-service by adding a Profiles subkey below the associated WebHost key. The following example adds two profiles to the .reg file from the previous example by specifying an index (zero-based) and the GUID for each profile:

[HKEY_CURRENT_USER\Software\Microsoft\Producer\WebHosts\MyNewWebHost\Profiles]

"0" = "0072853c-d773-452c-b858-6de819043b1d"
"1" = "10aab034-119c-47f6-8930-e6e49601be49"

Once these values exist in the registry on the user's computer, your e-service will automatically publish for both profiles, unless the details change when your script code executes in the custom UI page. Similarly, you can specify other default values, such as the PlaybackLocation or PublishDestination.

For more information about profiles, see the Working with Profiles section.

When you add or change a service by directly modifying the registry on the user's computer, the addition or change takes effect for the next Producer session. This may require the user to close the current Producer session and restart the application. When Producer starts, a dialog box appears that informs the user that a change has occurred and allows the user to accept or reject the change.

PreviousNext


© 2001-2003 Microsoft Corporation. All rights reserved.