dcsimg

8.7d Service Pack 1 technical specifications

Products

Webtrends Analytics 8.7d

Cause

When run, the 8.7d Service Pack 1 stops the required services, replaces files, restarts the services and modifies the wt_Sched database to note that the service pack has been applied. Along the way, it will preserve the original files – just in case the patch must be uninstalled in the future. It can be run by double-clicking the executable and should be run on a user interface server first, in the case of distributed installations. At the end of the installation a pop-up will display all of the servers in the installation which still require the service pack. The remainder of the machines may be patched in any order. Should you need to remove the service pack, run the installer again and select uninstall.

Note: Although the original files will be restored, the database will not be restored to its original state.

You can query the database to determine where the service pack has been applied. The relevant information is stored in two tables. The first, wt_Patch, contains information on the patch itself:

select * from wt_Patch

The second, WT_ComponentInstallation, contains a mapping of all components (or “roles”) installed on all machines. There is a column called “PatchID” which will give the most recently applied patch (or NULL if none has been applied). This column contains an index into wt_Patch.

select * from WT_ComponentInstallation

Join other tables to display human readable results. Examples follow.

To list all hosts, their versions, and any patches installed:

select distinct h.HostName, p.Name, ci.Version, ci.Build from WT_Host h
inner join WT_ComponentInstallation ci on h.HostID = ci.HostID
inner join wt_Patch p on ci.PatchID = p.PatchID

To list all hosts which currently have ‘WebTrends 8.7d Patch 1’ installed:

select distinct h.HostName from WT_Host h
inner join WT_ComponentInstallation ci on h.HostID = ci.HostID
inner join wt_Patch p on ci.PatchID = p.PatchID
where p.Name = ‘WebTrends 8.7d Patch 1’

To list all hosts which require installation of ‘WebTrends 8.7d Patch 1’:

Note: You must know the patch ID number for this one (see above). ComponentIDs 1, 21, and 25 are the three components affected by this patch.

SELECT DISTINCT h.HostName FROM WT_Host h
INNER JOIN WT_ComponentInstallation ci ON ci.HostID = h.HostID
WHERE ci.ComponentID IN (1, 21, 25) AND (ci.PatchID IS NULL OR ci.PatchID<>1)

The remainder of the document will walk through the technical details of how the installer functions.

Note: The patch depends upon the wtliveglue.ini file for its database connection information. If this file does not exist on the host, the patch will fail to install. Installation tasks which access the database must not run in “system context” (the default for InstallShield). This must be manually changed when adding new Custom Actions.
When using the built-in InstallShield “SQL Scripts” feature, InstallShield will automatically insert a dialog box to collect database connection information. Manually edit the dialog sequence tables to remove this, and be sure to call GetInstalledRoles before ISSQLServerInitialize. The latter depends upon properties set up in the former.


Custom Actions

GetInstalledRoles

  • In both the User Interface and Execute sequences
  • Queries the database and sets properties based upon what components are installed on the host
  • Sets properties containing database connection information
PostProcess
  • Adds the patch information to the database
  • Restarts any stopped services
  • Shows the results of the installation and gives a list of hosts still in needi of the patch
  • Runs as a deferred action in USER context
PreserveOriginalFilesCopies all files to be replaced to a known location within the installation directory (to be used if removed)

RestoreOriginalFiles – Runs only during removal

SetPropertiesForPostProcess – Because PostProcess runs in deferred mode, we must package up all of the properties it will need here

StopWebtrendsServices – Stops the services which might be touching the files to be replaced.

InstallShield Fuctionality Used
SQL Scripts runner – Used to run CreatePatchTable.sql, which modifies the DB schema to support patch information