Page 1 of 1

Unable to register OCX library

Posted: Thu Apr 12, 2007 11:02 am
by mschiff
I have tried everything to register an OCX library, and nothing seems to work. I have read everything here related to doing it, and followed all the suggestions, but no matter what, it does not get registered. The file is installed properly, but the REGISTER LIBRARY command always fails no matter where I put it. After installation, if I use REGSVR32.EXE, the control registers with no problem at all.

I have inserted the following code at various places in the script, and it always fails:

Register Library $TARGETDIR$\\ImageViewer2.OCX (get result into variable SUCCESS)
if Variable SUCCESS Equals FALSE
MessageBox: ImageViewer2.OCX Failed to register, The ImageViewer2.OCX file failed to register with the operating system. Contact the developer.
end

I have tried putting the code immediately after the Apply Install line in the script, and even at the very end of the script after all processing is complete, but it always returns FALSE and the control does not get registered.

How can I overcome this problem?

-- Martin

Posted: Thu Apr 12, 2007 11:14 am
by MichaelNesmith
Well, you can try two more things -

1. Capture the self-reg information directly into the registry view,
2. Use the self-register option in the Install Files command.

If all else fails...you can always fall-back to Run Program, of course.

Posted: Thu Apr 12, 2007 1:26 pm
by mschiff
Michael,

I already tried checking the self register option. The OCX is not able to be self registered (though I am self registering others successfully).

How would I capture the self-reg information?

-- Martin

Posted: Fri Apr 13, 2007 8:53 am
by MichaelNesmith
Is self reg failing because a particular order is necessary for self registration, or is it something else that is going on? I'm wondering if its a control issue - maybe you need to set the working directory to the control folder?

I'd suggest running regsvr32 from a folder outside of the OCX's install folder. If that also fails, you'll know the control needs its working folder to be set before being registered; so you can use Register Library that way.

To import, try the Registry view, and choose Import.