Home   Notes   Contact Me

Deployment through .CAB files

Local

External


Signing

  1. Make the .pvk file and the .cer file, using makecert (see below for example)
  2. Make an .spc file using cert2spc
  3. Sign the .cab file with signcode.

Visual Studio, how to have it generate a cab file automatically.

Note: I found the built in .cab creation to be too limited, so I came up with this proceedure to automate it.

Current Method

  1. You need to modify the Properties of the project you want to have make the .CAB file
  2. Bring up the projects properties on the project name
    Solution Explorer | context menu (right click) | Properties | Build Events | Post-Build Event
  3. Add something like the following to make the .CAB file:
    cd .\Release\
    cabarc.exe n Name.cab $(ProjectDir)Name-debug.inf Name.dll "%SystemRoot%\system32\msvcr71.dll" Other.dll
  4. Replacing Name with your ActiveX controls name, and replacing Other with a list of other dll's that are needed to be in the cab file. Note that the microsoft file is just an example you don't necissarily need it.

Old Method

  1. Add a new project to your solution choose Visual C++ Projects | Win32 Project and set to be console and an empty project.
  2. Make one by hand to verify it all works (see: How to make one that works)
  3. Add the .inf file you made for the test above to the project using 'Add Existing Item' to the project
  4. Add a custom command to the .inf that runs the cabarc.exe command you used for the test
  5. Make sure to set the target of the custom command to the output file.
  6. Done. That should do it.

How to make one that works

Object Tag Example

INF file Example

Example cabarc.exe command line


Object tag, html

CaseExample
Full URLCODEBASE=http://www.this.com/controls/myControl.cab#version=...

.cab file info


Where is cabarc.exe

 "c:\Program Files\Microsoft Visual Studio 8\Common7\Tools\Bin\CabArc.Exe"  [link to that dir]

Debugging .CAB file deployment

From: Microsoft Knowledge Base Article 252937 "How To Find More Information About Why Code Download Failed"

Stand alone debugging

  1. Try to use the .CAB file to download the component(s)
  2. After it fails in Internet Explorer goto  Tools | Internet Options | General | "Temporary Internet files" | Settings | View Files 
  3. Sort alphabetically
  4. Near the top look for something like:  ?CodeDownloadErrorLog!name={9485EC2E-75BD-490B-8D1C-278AB3F5E46E}  [the GUID will be the value for the ActiveX control]
  5. open that file in an Internet Explorer window by openning one and dragging it into it.
  6. Close the View Files window and the Internet Options dialog

Code Download Error Log Viewer