N1 Grid Service Provisioning System 5.0 User's Guide for the Windows 2000 Plug-In

Chapter 3 Using the Windows 2000 Plug-In

This chapter explains how to capture and deploy Windows 2000 applications and files. The chapter includes the following information:

Capturing and Deploying Files and Applications

The Windows common tasks page enables you to view and create components for the following Windows 2000 entities:

ProcedureHow to Capture a Windows 2000 File or Application

Before you can deploy a file or application across systems, you have to make the file or application known to the N1 Grid Service Provisioning System software and wrap it into a component.


Note –

Although the general approach that you follow is the same for all component types, details differ depending on the actual types that you need to use.


Steps
  1. Select the Windows icon under the Common Tasks section of the left control panel.

  2. Click the Create New link next to the component type you need to create.

    For example, to create a component that contains a batch file, follow these steps:

    1. Go to the Additional Windows Tasks section.

    2. Click Create New next to Windows Batch File.

  3. On the Components Details Edit page, fill in the appropriate information.

    For example, for a batch file, fill in this information:

    1. Type a name for the component

    2. Choose the host from which to procure the batch file.

    3. Navigate through the file system hierarchy on the host, and choose the batch file.

  4. Click Check in Selected Item.

Using the Command Line

You can also create a component through the command line. For more information about commands, see cdb.rsrc: Managing Components in N1 Grid Service Provisioning System 5.0 Command-Line Interface Reference Manual.

ProcedureHow to Deploy a Windows 2000 File or Application

Steps
  1. Capture the component as described above.

  2. Go to the Components section of the N1 Grid Service Provisioning System application.

  3. Choose the component to deploy.

    Depending on the type of component that you choose to deploy, you might have to define variables or to perform other steps. At a minimum, you perform the rest of the steps listed here.

  4. Click Run in the Actions column next to the Default:Install procedure.

    A plan details page appears for running the installation procedure.

  5. Choose a target host.

    The target host should be a host for which the component that you are deploying applies. For example, deploying a Microsoft Windows IIS application to a non-Windows host would not be appropriate.

  6. Click Run Plan.

Component Types

To reflect the browser interface, the component types for this plug-in are grouped into three areas:

Windows Applications Component Types

Windows application component types consist of three types:

COM+ Application Component Type

A component of this type represents a COM+ application. COM+ applications are treated as a unit. The settings and content are installed as a group.

Browsing for a COM+ Application

When you browse for a COM+ application, the browser provides an alphabetical list of COM+ applications on the target system.

You can select a single COM+ application to be checked in. COM+ applications have no children and cannot be expanded..

Exported/Internal File Format

COM+ applications are exported into a Microsoft Windows Installer (MSI) file using the COM+ Admin SDK.

Component Differences

The COM+ Application is re-exported on the target system as an MSI file and compared against the MSI file used to install the application. The software will only indicate that there were differences, but will not indicate the details of the differences.

Installing a COM+ Application

Uninstalling a COM+ Application

The COM+ application is uninstalled using the COM+ Admin SDK.

Error Conditions

Table 3–1 COM+ Application Error Conditions

Action 

Condition 

Result 

Install 

COM+ Application already exists with the same name and either cannot be stopped or dependent services cannot be stopped. 

Installation fails 

Uninstall 

MSI file used for installation is no longer available 

Uninstallion fails 

Install or Uninstall 

Remote Agent does not have administrator privileges  

Installation or Uninstallation fails 

Extended Control Procedures

Table 3–2 COM+ Application Extended Control Procedures

Name 

Parameters 

Description 

startApp

appName – Full name of the COM+ application.

Starts the COM+ application if it is run as a service 

stopApp

appName – Fill name of the COM+ application to stop.

Stops the COM+ application and all dependent services 

stopRouter

N/A 

Stops the COM+ Routing services 

startRouter

N/A 

Starts the COM+ Routing services 

installAsUser

rsrcSrcPath – Name of the COM+ application

rsrcInstallPath – Path to the *.msi file representing the application

userID – User who is going to run the application

password – Password of the user

Enables installation of a COM+ application that runs as a particular user 

COM Component Component Type

This component type represents a COM file.

Browsing

To choose a file for this component type, select a *.ocx or *.dll file from the file browser.

Component Differences

The COM component is compared as a binary file against the file used during installation. The software indicates when there are differences, but does not provide details about the differences.

Installing a COM Component

The Regsvr32 utility is called to register the COM components in the DLL using the following command line:


regsvr32.exe /s file path

Uninstalling a COM Component

The Regsvr32 utility is called to unregister the COM components in the DLL using the following command line:


regsvr32.exe /s /u <file path>    

After the DLL is unregistered, it is removed from the target system.

Error Conditions

Table 3–3 COM Component Error Conditions

Action 

Condition 

Result 

Install 

The supplied .dll or .ocx file does not contain COM components

Installation fails 

Uninstall 

The supplied .dll or .ocx file does not contain COM components

Uninstallation fails 

Microsoft Windows Installer File (*.msi) Component Type

A component of this component type includes a silent Microsoft Installer (MSI) file.

Browsing

To choose a file for this component type, select a *.msi file from the file browser.

Installing an MSI File

The Microsoft Windows installer service is called on the MSI file to import it into the target system with the following command:


misexec /qn /i file path

Uninstalling an MSI File

The Microsoft Windows installer service uninstall is called on the MSI file used during installation to uninstall the package using the following command:


msiexec /qn /x file path

After msiexec finishes, the MSI file is removed.

Error Conditions

Table 3–4 Microsoft Windows Installer File Error Conditions

Action 

Condition 

Result 

Install 

The supplied *.msi file is not a proper Microsoft Windows installer file.

Installation fails. 

Install 

The agent does not have proper permissions to run installations 

Installation fails. 

Uninstall 

The package has already been uninstalled 

Uninstall fails 

IIS Component Types

IIS component types share some common information and consist of several component types:

Common IIS Component Type Formats, Errors, and Functions

The IIS component types share a common implementation. All IIS component types enable you to export, install, and delete data stored in the IIS metabase. To enable the common behaviors, these component types share a set of functions, formats, and errors.

Common IIS Browsing

When you browse for an IIS component, the browser provides a list of web sites and virtual directories on the target system. These items appear in the order that they occur in the metabase. This corresponds to the order in which the items appear in the IIS Control panel. This list is not alphabetical.

You can select a single web site or virtual directory. Selecting a web site is considered recursive. Double-clicking a web site displays a list of the virtual directories in the web site.

Exported/Internal File Format

All IIS types use an XML format to store their section of the metabase. The present XML format does not support metabase properties of type NTACL (such as AdminACL). Any properties of this type that are encountered while reading from or writing to the metabase are ignored. Also, properties of type IPSec (such as IPSecurity) are written out as serialized objects. Those objects are not human-readable during either direct examination, or as difference results.

Differences

During a snapshot, the current state of the metabase is exported into an XML file. During an M-I difference, the metabase is re-exported and compared against the original XML file. The standard XML differentiator is used to generate differences between these files.

Error Conditions

Table 3–5 IIS Types Common Error Conditions

Action 

Condition 

Result 

Install/Export 

IIS Does not exist or is the improper version  

Install/Export fails 

Install/Uninstall 

Remote Agent does not have administrator privileges  

Install/Uninstall fails 

IIS Web Site or Virtual Directory Settings

Represents the settings for an IIS web site or virtual directory. Please note that this component type only contains the settings for a web site or virtual directory. The content on the web site must be checked in as a separate resource.

Installing an IIS Web Site or Virtual Directory

Installation occurs by reading the XML file and importing the file into the target system metabase. If a web site with the same name exists, the old web site is overwritten. If multiple web sites have the same name on the system, the first matching web site is removed and overwritten.

Special cases include untyped keys or nodes, and SSL certificates, which are not deployed. The relevant settings for SSL certificates in IIS (SSLCertHash and SSLStoreName) are preserved during a deployment if they exist on the target system. If relevant SSL settings do not exist, settings are not added.

To bring up a secure site after the site is deployed or redeployed, you must restart IIS.

Uninstalling an IIS Web Site or Virtual Directory

The entire web site is removed on the target system. All virtual directories in the web site are removed regardless of whether they were installed by the provisioning software. If the settings are just for a virtual directory, only that directory is removed, not its containing site. The matching for uninstall is done by name, so the first web site with the same name found on the system will be uninstalled. Once this process is complete, the XML file used during installation is removed.

IIS Global Filter Settings Component Type

This component type is used to represent global IIS filter settings. This component type only contains the settings for an IIS Global Filter. You must install separately the actual DLL that implements the filter.

Browsing for an IIS Global Filter

When you browse for an IIS global filter settings component, the browser provides a list of global filters on the target system. These filters appear in the order that they occur in the metabase. This corresponds to the order in which the items appear in the IIS Control panel. This list is not alphabetical.

You can select a single filter. Filters cannot be expanded.

Installing an IIS Global Filter

Installation occurs by reading the XML file and importing the file into the target system metabase. If a filter setting with the same name exists on the target machine, the existing filter setting is overwritten.

Uninstalling an IIS Global Filter

The filter settings are removed on the target system. Once the settings are removed, the XML file used during installation is removed.

IIS Web Site Filter Settings Component Type

This component type contains the settings for a web site filter. You must install separately the actual DLL file that implements the filter.

Browsing for Web Site Filter Settings

When you browse for an IIS web site filter settings component, the browser provides a list of web site filters on the target system. These filters appear in the order that they occur in the metabase. This corresponds to the order in which the items appear in the IIS Control panel. This list is not alphabetical.

To see a list of filters for a web site, you must expand the web site. You can select all web site filters or an individual filter to be checked in.

Installing Web Site Filter Settings

Installation occurs by reading the XML file and importing the file into the target system metabase. If a filter setting with the same name exists on the target machine, the existing filter setting is overwritten.

Uninstalling Web Site Filter Settings

The filter settings are removed on the target system. Once the settings are removed, the XML file used during installation is removed.

IIS Global Settings Component Type

This component type is used to represent global IIS settings.

Browsing for Global Settings

When you browse for an IIS global settings component, the browser provides a list of settings on the target system. These settings appear in the order that they occur in the metabase.

You can select a single setting to be checked in. Settings have no children and cannot be expanded.

Installing Global Settings

Installation occurs by reading the XML file and importing the file into the target system metabase. The setting on the target system is overwritten if the setting exists.

Uninstalling Global Settings

Global settings cannot be uninstalled. Uninstalls will have no affect on the target system except to remove the XML file used during install.

IIS Website (IIS Virtual Directory) Component Type

The IIS Website (IIS Virtual Directory) component type is a composite component type that includes four components:

IIS Website Filter Component Type

The IIS Website Filter component type is a composite type that includes two components:

Additional Windows Component Types

The Windows 2000 Plug-In also provides several additional component types:

Registry Keys Component Type

This component type is used to represent registry keys and their associated values.

Browsing

When you browse for a registry key component, the browser provides a list of registry keys from the main registry roots on the target system. The main registry roots include HKEY_LOCAL_MACHINE, HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, HKEY_USERS, and HKEY_CURRENT_CONFIG. These items appear in the order that they are presented in the registry.

You can select an individual key for check in. Selecting a key will check in that key and all of its children. Double clicking on a key will recursively check down the registry until a value is found. The name of the value is displayed but not its contents. Values can be individually exported.

Exported/Internal File Format

Registry keys are exported into an XML file.

Differences Between Registry Key Versions

During a snapshot, the current state of registry key (and its children) is exported into an XML file. During a difference check, the registry key is re-exported and compared against the original XML file. The standard XML difference comparator is used to generate differences between these files.

Installing a Registry Key

The XML file that represents the registry is read and imported into the target system using an execJava step. Any keys for which values already exist in the target system are overwritten.

Uninstalling a Registry Key

The execJava implementation takes the root of the exported key, and deletes all keys and values beneath it. If the root is a value, it will be deleted.

Error Conditions

Table 3–6 Registry Keys Error Conditions

Action 

Condition 

Result 

Install or Uninstall 

Remote agent does not have administrator privileges 

Installation or uninstallation fails 

Registry File Component Type

A component of this component type contains a registry file (*.reg). Registry files are text files that specify the key and values to add or remove from the registry metabase.


Note –

The provisioning software does not compare versions of a registry file for differences. To be able to view differences between registry files, use the Registry Keys component type instead.


Browsing for a Registry File

To choose a file for this component type, select a *.reg file from the file browser.

Installing a Registry File

Regedit /s file path is called on the *.reg file to write its changes to the registry.

Uninstalling a Registry File

During uninstallation, only the *.reg file used during installation is removed. The registry keys inside the registry file are unaffected. Use the Registry Keys type to enable registry uninstallation.

Error Conditions

Table 3–7 Registry File Error Conditions

Action 

Condition 

Result 

Install 

The supplied *.reg file is not in the proper format for regedit.

Installation fails 

Install 

The agent does not have proper permissions to write into the registry sections designated by the *.reg file.

Installation fails 

Data Source Name Component Type

A component of this component type represents ODBC settings for connecting to a database. You can modify these settings through the Data Source Administrator control panel on the system. The actual settings are stored in specific places in the registry. As a result, the Data Source Name (DSN) resource type is built on top of the Registry Keys resource type. The DSN installation, export, and uninstallation functions directly use the facilities provided by the Registry Key resource handler. The DSN browser mimics the Registry browser to provide an experience closer to the “Data Source Administrator” control panel.

Browsing for a DSN File

When you browse for a DSN component, the browser provides a list of DSN files from the main registry roots on the target system. The DSN roots include User and System. DSN files are displayed in alphabetical order.

You can select an individual DSN file for check in. Double-click on the System and User roots to list the contained DSN entries.

Exported/Internal File Format

On export, the browser exports the key that contains all the DSN settings, as well as the value of the same name in the “ODBC Data Sources” key at the same level in the registry hierarchy.

Uninstalling a DSN File

The DSN uninstallation is based on the registry uninstallation, with the caveat that the path being deleted is the key that contains the DSN settings but not the key that the DSN user interface uses to display the available DSN settings. Special logic exists to delete this key as well. The semantics of this process differ slightly from the registry uninstallation semantics, although both processes use the same executor.

Error Conditions

The DSN system component directly calls the Install method of the registry system component. See Registry Keys Component TypeRegistry Keys Component Type for further information on implementation and possible errors.

Microsoft Windows Batch File Component Type

A component of this component type contains a Windows batch *.bat or command *.cmd file.

Browsing

When you create a component for this component type, you can request that the file browser show only that files that have *.bat or *.cmd extensions.

Error Conditions

Table 3–8 Microsoft Windows Batch File Error Conditions

Action 

Condition 

Result 

Install 

The supplied batch file is not a valid batch file or contains errors. 

Installation fails 

Microsoft Windows Scripting Host Script Component Type

A component of this component type contains Microsoft Windows scripting host (WSH) scripts. These files are text files that are created by either vbscript (*.vbs) or jscript (*.js). These files may also be contained in an XML project file (*.wsf).

Browsing for a Scripting Host Script

When you create a component for this component type, you can request that the file browser show only that files that have *.js, *.vbs, or *.wsf extensions.

Uninstalling a Scripting Host Script

When you uninstall a component of this component type, the script file is removed from the target host. However, any actions that the script performed are not undone.

Error Conditions

Table 3–9 Microsoft Windows Scripting Host Script Error Conditions

Action 

Condition 

Result 

Install 

The supplied file is not a valid *.wsf file or contains errors.

Installation fails 

Microsoft Windows System Services

The Microsoft Windows System Component provides utilities for interacting with different windows systems, beyond those related to any specific component types. The plug-in includes five Windows-specific system services:

Extended Control Services

Extended control services are procedures that perform a software operation related to a resource or component. These services include services for starting and stop the Microsoft IIS Web Server and for starting and stopping specific Microsoft Windows services. The provisioning software includes two sets of extended control services that are not specific to individual resource types:

General purpose control services include the ability to start or stop Microsoft Windows services. These control services can be called by any component or plan.

An example of a resource-type-specific control service is the startRouter procedure included with the COM+ Application resource type. This procedure starts COM+ routing services. It works only with resources that are of the COM+ Application resource type.

Extended Control Services for IIS

The following table lists the procedures for controlling IIS.

Table 3–10 Built-in Procedures for Controlling IIS

Name 

Parameters 

Description 

stopIIS

None 

Shuts down the IIS process 

startIIS

None 

Restarts IIS if it is not running 

Extended Control Services for Microsoft Windows Services

A component or plan may include steps to start or stop specific Microsoft Windows Services.

The following table describes procedures for controlling Microsoft Windows Services.

Table 3–11 Built-in Procedures for Controlling Microsoft Windows Services

Name 

Parameters 

Description 

stopService

serviceName – Name of the service to stop.

Shuts down the service 

startService

serviceName – Name of the service to start.

Starts the Microsoft Windows service