DSZip Exception: Unable to cast COM object...

Topics: Bugs, General Questions
Coordinator
May 15, 2007 at 2:02 PM
Edited May 15, 2007 at 2:14 PM
The DSZip utility is required to build the DocProject installer using the InstallPrep and Installer projects. This discussion applies to a fatal exception that occurs in the DSZip program when building the InstallPrep project on some operating systems.

Recently, it has been brought to my attention that the DSZip utility may not work on all versions of Windows (thanks, alipka). Since it was originally developed on XP, I assumed that it would at least work on XP, 2000, 2003 and Vista, which was tested for DSZip version 1.0.0.

Explanation

I rebuilt DSZip on my Vista machine to fix a bug and updated the version number to 1.1.0, which is the version that is available for download with 1.5.0 ReleaseCandidate. Apparently, building DSZip again on Vista caused the interop wrapper to be redefined with one or more Vista-specific Shell32 interfaces, without me knowing.

Information on the one interface in particular that seems to be causing the exception described in this discussion can be found here, although there may be others as well:

IShellDispatch5 Interface
http://msdn2.microsoft.com/en-us/library/aa360098.aspx

Solution

I just built a version of DSZip on Windows Server 2003 and uploaded it to the release page for 1.5.0 ReleaseCandidate. The Vista interface is not present in the interop wrapper and according to MSDN, IShellDispatch4, which is present in the new build, requires a minimum of Windows XP. (You have to view the documentation for each individual method to see the required OS.)

Please let me know if you still have trouble getting DSZip to work on Windows XP, Windows 2000 and Windows Server 2003.