InstallShield Tips and Techniques

August 23, 2010

Alternative method to extract COM Data

Filed under: Reference Materials — shieldmaster @ 11:58 pm

On a recent project, I was using the “tried and proven” method to extract COM Data by performing on-site registration using scripting (InstallScript).  With Windows 7 the Custom Action is not being elevated with the correct permissions and the registration was failing.

Since I did not want the project to use the InstallShield “KEY” file attributes (a subject of a later post), I reverted to manually extracting the COM Object by using this process:

  1. Right-click the file in the Component and selecting “Set Key File”
  2. Right-click the file again in the Component and selecting “Extract COM Data for key file”
  3. Right-click the file in the Component and selecting “Clear Key File”

The customer reported issues with the extracted COM Data being incomplete!  Apparently the CLSID entries were not being correctly extracted – as compared to running RegSvr32.

Now my research did find quite a few reported problems with COM Extraction – and they have been going back as far as IS 10.5!  Consequently,  I switched methods, and went to www.InstallSite.org and pulled down the utility “RegSpy.exe”  http://www.installsite.org/pages/en/msi/tips.htm .  This utility will manually extract the correct COM data.  I did not like the summation of how to extract to the registry – so I made these steps to accomplish this:

1.  Created a BAT file that will run RegSpy.exe and output a .REG file – here is a sample that I used:

ECHO ON

REM ***************************************************

REM **  Use RegSpy to extract COM Objects

REM **  Note:  Place RegSpy.exe in root of InstallPath!

REM ***************************************************

REM ***************************************************

REM **  Set base directory!

REM ***************************************************

SET InstallPath=E:\Project – OCXs Files\DeploymentFiles

REM ***************************************************

REM **  Set File to extract COM Objects

REM **  Set output registry file and Extract COM Object

REM ***************************************************

SET File=Cal32x30.ocx

SET RegOutputFile=%InstallPath%\%File%.reg”%InstallPath%\regspy.exe” “%InstallPath%\FarPoint\%File%” > “%RegOutputFile%”

2.  Edit each output .REG file created and substitute [INSTALLDIR] for the path statement – a sample shown here in the Before state:

[HKEY_CLASSES_ROOT\CLSID\{DEE22B42-FCA5-11D2-A05D-00A0C90DC755}\InprocServer32]

@=”E:\Project~1\DEPLOY~2\FarPoint\Cal32x30.ocx”

“ThreadingModel”=”Apartment”

3.  Since I used the input Deployment directory, this differs from the Installed directory, so I substituted [INSTALLDIR] for the path statement – a sample shown here in the After state:

[HKEY_CLASSES_ROOT\CLSID\{DEE22B42-FCA5-11D2-A05D-00A0C90DC755}\InprocServer32]

@=”[INSTALLDIR]Cal32x30.ocx”

“ThreadingModel”=”Apartment”

4.  Now go to the InstallShield project and navigate to the Component’s Registry section – and right-click on the center panel for the Destination Machine and select “Import Reg File”.  This will import all of the correct COM Data for the component.

Hope This Helps!

ShieldMaster

About these ads

1 Comment »

  1. [...] Alternative method to extract COM Data Shieldmaster Blog posted a workaround if the COM data extracted by InstallShield are incomplete [...]

    Pingback by Links of the week 36 - InstallSite Blog — September 13, 2010 @ 4:18 am


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Silver is the New Black Theme. Create a free website or blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 35 other followers

%d bloggers like this: