Figure 2   ActiveX SDK Documents Related to Internet Component Download

File

Description

...\specs\CodeDwld.doc

Internet Component Download spec

...\specs\SftPubTP.doc

Software Publishing Trust Provider spec

...\specs\WinTrust.doc

Windows Trust Provider Services spec

Figure 4   DWLDTEST.HTM

 <HTML>
<HEAD><TITLE>Code Download Test Page</TITLE></HEAD>

<BODY>
<H1>Code Download Test Page</H1>

<TABLE>
   <TR>
      <TD ROWSPAN=2>
         <H2>Testing Executable</H2>
         <P>
         This section uses the WebImage sample control from the ActiveX SDK.
         If the control is not already installed, code will be downloaded
         from the URL specified in the CODEBASE attribute of the OBJECT tag.
         </P>
         <CENTER>
         <OBJECT ID = "Image1" 
            CLASSID="clsid:bd11a280-2e73-11cf-b6cf-00aa00a74daf"
    CODEBASE="http://bigcompany/littleteam/eng/more/marykir/codebase/wimg.ocx"
            HEIGHT=234 WIDTH=312>
            <PARAM NAME="Image" VALUE="winnet24.bmp">
         </OBJECT>
         </CENTER>
      </TD>
      <TD>
         <H2>Testing .CAB File</H2>
         <P>
         This section uses the Smile sample control from Visual C++ 4.x.
         If the control is not already installed, a CAB file will be 
         downloaded from the URL specified in the CODEBASE attribute of
         the OBJECT tag, and the control file will be extracted from 
         the CAB file so it can be installed.
         </P>
         <OBJECT ID="Smile1"
            CLASSID="CLSID:175CB003-BEED-11CE-9611-00AA004A75CF"
   CODEBASE="http://bigcompany/littleteam/eng/more/marykir/codebase/smile.cab"
            HEIGHT=80 WIDTH=80>
         </OBJECT>
      </TD>
   </TR>
   <TR>
      <TD>
         <H2>Testing .INF File</H2>
         <P>
         This section uses the Button sample control from Visual C++ 4.x.
         If the control is not already installed, an INF file will be 
         downloaded from the URL specified in the CODEBASE attribute of
         the OBJECT tag. Information in the INF file will be used to
         determine what other files need to be downloaded and installed. 
         </P>
         <OBJECT ID="Button1"
            CLASSID="CLSID:4A8C998F-7713-101B-A5A1-04021C009402"
 CODEBASE="http://bigcompany/littleteam/eng/more/marykir/codebase/ button.inf"
            HEIGHT=50 WIDTH=80>
         </OBJECT>
      </TD>
   </TR>
</TABLE>

</BODY>

</HTML>

Figure 6   ActiveX SDK Tools for Signing Code

File

Description

bin\makecert.exe

Issues a test certificate

bin\cert2spc.exe

Generates a signature block from your certificate

bin\signcode.exe

Inserts the signature block into your code

bin\pesigmgr.exe

Manages certificates-can be used to determine whether code includes any certificates

bin\chktrust.exe

Checks whether code is successfully signed

Figure 7   Characteristics of Code Download Packaging Methods

Number of Files

Selective Installation?

Compression?

Platform Independent?

PE File

One

No

No

Only via HTTP format negotiation

CAB File

One or more

No*

Yes

Only via HTTP format negotiation

INF File

Zero or more

Yes

No

Yes

* The entire CAB file will be downloaded. It is possible to specify additional URLs for optional files in the INF file.

Figure 8   INF Syntax Understood by Internet Component Download

The Add.Code section lists all the files to be installed, including optional files:

[Add.Code]
filename1=section-name1
filename2=section-name2

Each file section is identified by the section name in brackets, followed by all the key values, just like in an INI file:

[section-name1]
key1=value1
key2
=value2

The following keys are valid in a file section:

File=[url | thiscab]

Figure 9   SMILE.INF

 ; INF file for Smile.ocx
;

[Add.Code]
Smile.OCX=Smile.OCX
MFC40.DLL=MFC40.DLL

[Smile.OCX]
File=thiscab
Clsid={175cb003-beed-11ce-9611-00aa004a75cf}
FileVersion=1,0,0,1

[MFC40.DLL]
File=http://bigcompany/littleteam/eng/more/marykir/codebase/mfc40.dll
FileVersion=4,0,0,5

Figure 10   A Multi-platform INF File

 [Add.Code]
circ3.ocx=circ3.ocx

[circ3.ocx]
; lines below specify that the specified circ3.ocx (clsid, version) needs to be installed on
; the system. If doesn't exist already, can be downloaded from the given location (a .CAB)
file-win32-x86=file://products/release/circ3/x86/circ3.cab
file-win32-mips=file://products/release/circ3/mips/circ3.cab
file-mac-ppc=ignore
    ; the 'ignore' keyword means that this file is not needed for this platform 
clsid={9DBAFCCF-592F-101B-85CE-00608CEC297B}
FileVersion=1,0,0,143