This documentation is archived and is not being maintained.

Walkthrough: Creating a Cab File

Visual Studio .NET 2003

The following walkthrough demonstrates creating a Cab file for an ActiveX control and deploying it to a Web site for download to the end-user's browser.

Note   Cab Projects are not available in the Standard Edition of Visual Basic .NET. For more information, see Visual Basic Standard Edition Features.

To create a Cab project for an ActiveX control

  1. On the File menu, point to New, and then choose Project.
  2. In the New Project dialog box, select Setup and Deployment Projects in the Project Type pane, and then choose Cab Project in the Templates pane. In the Name box, type AXControl.
  3. Click OK to close the dialog box.
  4. In Solution Explorer, select the AXControl project. On the Project menu, choose Add, File.
  5. In the Add Files dialog box, browse to find an ActiveX control (.ocx), then click OK to close the dialog box.
    Note   You can use an ActiveX control that you have created using Visual Studio .NET, or you can use any .ocx file in the System directory.
  6. On the Project menu, choose Properties.
  7. In the Project Properties dialog box, check the Authenticode Signing check box, and enter the Certificate file, Private key file, and Timestamp server URL. Click OK to close the dialog box.
    Note   This step is optional; however, if Authenticode Signing is not used, you will be unable to download the Cab file to a browser unless the browser's security settings allow the download of unsigned ActiveX controls.
  8. On the Build menu, choose Build AXControl.

To create a Web application

  1. On the File menu, choose Add Project, New Project.
  2. In the Add New Project dialog box, select Visual Basic Projects in the Project Type pane, and then choose ASP.NET Web Application in the Templates pane. In the Location box, type http://localhost/AXControlWeb.
  3. Click OK to close the dialog box.
  4. Select the Toolbox window. On the Tools menu, choose Add/Remove Toolbox Items.
  5. In the Customize Toolbox dialog box, select the same ActiveX control that was used in the previous procedure.
  6. Click OK to close the dialog box.
  7. In the Toolbox, select the ActiveX control and drag it onto the Webform1.aspx designer.
  8. On the Project menu, choose Add Existing Item.
  9. In the Add Existing Item dialog box, navigate to your project directory and find the built Cab file. The default path will be \documents and settings\yourloginname\AXControl\project configuration\AXControl.Cab. The default project configuration is Debug. Click OK to close the dialog box.
    Note   You may need to type the name of the file (AXControl.Cab) into the File name field.
  10. Select the ActiveX control in the Webform1.aspx designer.
  11. In the Properties window, select the codebase property and click the Ellipsis () button.
  12. In the Create URL dialog box, select AXControl.Cab from the Contents pane, then click OK to close the dialog box.
    Note   If you make changes to the Cab file project, you will need to rebuild the Cab file project, delete the old Cab file from the Web project, and repeat steps 6 and 7. This is necessary because the Cab file in the Web project is actually a copy of the built Cab file.
  13. On the Build menu, choose Build Solution.

To test the installation

  • Browse to the Web page (http://computername/AXControlWeb/Webform1.aspx) from a machine that does not have the ActiveX control registered. Confirm that the control is installed on the machine and the Authenticode dialog is displayed.

See Also

Cab File Projects | Deployment and Authenticode Signing

Show: