Поделиться через


Managing Versions of a Component

Microsoft Internet Explorer 3.0 and later provides Internet Component Download services that enable users to download software components from the Internet and intranets. The component's file version is used to control updates. This article explains how to manage the distribution of different versions of the same component.

  • Specifying Your Component's Version
  • Determining Your Component's Version
  • Version Information in Your Distribution Units
    • INF File
    • OSD File
  • Version Information on Your Web Pages
  • How #Version Works
    • Special case: #Version=-1,-1,-1,-1
  • Related topics

Specifying Your Component's Version

Specifying the version of a component incorrectly can cause the download to fail. Specify the version of your component by using a comma-delimited string of four unsigned integers, a,b,c,d, defined as follows:

a High-order word of the major version of the component available at the specified URL.
b Low-order word of the major version of the component available at the specified URL.
c High-order word of the minor version of the component available at the specified URL.
d Low-order word of the minor version of the component available at the specified URL.

 

Determining Your Component's Version

Determining the version of a file can be confusing, because the property sheet exposed by the context menu for a component might not be sufficient to identify the component's version. You can download a small executable file that enables you to obtain the necessary version information. This executable is called GetVers.exe.

To use GetVers.exe, enter the following command.

GetVers <filename>

Version Information in Your Distribution Units

In the distribution unit, the component's version can appear in the INF file and/or the Open Software Description (OSD) file, as well as the version resource of the component itself. To ensure successful downloads, the component's version must match in each of the places it appears. This section discusses how and where to specify version information in the distribution unit.

INF File

The FileVersion key specifies the component's version in the INF file. The syntax is as follows:

[MyComponent]
file-win32-x86=thiscab
clsid={F2E88901-1CF4-11d3-8DB7-00C04FB6E8F6}
FileVersion=1,0,2,0

The FileVersion key specifies the minimum required version of the file. If no value is specified, any version is acceptable.

OSD File

Use the VERSION attribute of the SOFTPKG element to specify the component's version in the OSD file. The syntax for this is as follows:

<SOFTPKG NAME="{F2E88901-1CF4-11d3-8DB7-00C04FB6E8F6}" 
  VERSION="1,0,2,0">
    <TITLE>My Component</TITLE>
    .
    .
    .
</SOFTPKG>

Version Information on Your Web Pages

You can specify the version of a component to use with a given Web page by appending the version to the end of the URL specified in the CODEBASE attribute of the OBJECT element on the Web page. The version fragment of the CODEBASE attribute must match the version information specified in the distribution unit.

When Windows Internet Explorer loads a page that references a component to download, the following scenarios are possible.

  • No version of the component is installed.
  • The specified version of the component is already installed on the client computer.
  • An earlier version of the component is installed.
  • A later version of the component is installed.

By specifying the version of a component to use, you have the ability to manage the actions Internet Explorer takes in response to each of these scenarios. Internet Explorer can perform the following actions.

  • Download the most recent version of the component.
  • Don't download anything. Use the component that is already installed.
  • Upgrade the existing version of the component to a later version.

How #Version Works

When you append the URL in the CODEBASE attribute with #Version, Internet Explorer 3.0 and later upgrades the control to a higher version if the version of the installed control is lower than the version requested. If no version of the component is installed on the user's computer, the component is downloaded and installed whether or not you specify #Version.

The following example shows the syntax for #Version.

<OBJECT CLASSID="clsid:F2E88901-1CF4-11d3-8DB7-00C04FB6E8F6"
CODEBASE="http://example.microsoft.com/myComponent.cab#Version=1,0,2,0"
HEIGHT=100 WIDTH=200>

Special case: #Version=-1,-1,-1,-1

This value instructs Internet Explorer 3.0 and later to download and install the latest version of a component. If the component is not installed on the client computer, Internet Explorer downloads and installs the component. If the component is installed on the client computer, Internet Explorer downloads the component if the release date is later than the installation date on the client computer. If the component is installed on the client computer and the release date is the same or earlier than the installation date, only an HTTP header transaction occurs.

Conceptual

About Distribution Units

Introduction to Internet Component Download

Introduction to Open Software Description

Introduction to Software Update Channels

Using INF Files

DHTML Reference

Microsoft Internet Component Download Reference

Open Software Description Element Reference

About URL Monikers

How to Automatically Update an ActiveX Control

How to Package Components for Internet Distribution

Publishing Application Updates on the Web