imageToday I was troubleshooting a Thinapped Visual Basic Application. The application halts with a Run-time error ‘372’ when trying to run a report:

Run-time error 372 Failed to load control 'CrystalActiveReportViewer' from crviewer.dll. Your version of crviewer.dll may be outdated. Make sure you are using the control that was provided with your application

Microsoft KB article kb942870 hints to an ActiveX component that is registered into HKCU instead of HKLM.

A trace with the ThinApp Log Monitor reveals that the application is looking for an ActiveX component under HKCU:

A registry trace shows that the component (Crystal Reports ActiveX Report Viewer) registers itself to HKLM but also creates a few keys under HKCU that are required to make the viewer run.

I decided to register the component from a VBScript inside the ThinApp package since this is easier and more fool proof than capturing all the registry keys and adding them to the package.ini.

The VBS Script simply calls RegSvr32.exe with the /s (silent) parameter:

Just save the VBS script with a name of choice in the same folder as the package.ini file.