cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Russell_Jones
Level 3

Register dll not working

I've got an installshield package that is installing a c++ dll. It used to be set to selfregister but for various reasons we now need to register this file at the end of the install.

If i call

LaunchAppAndWait(SUPPORTDIR ^ "regsvr32", WINSYSDIR ^ "mydll.dll", WAIT);




i get a loadlibrary failed error. While the error is on screen i open a command window and run "regsvr32 mydll.dll" and the registration succeeds.

So i thought maybe the path i'm giving it is wrong although the line above it registers a component in the samefolder and i've used the same format of command. So i run this:

    if(FindFile(WINSYSDIR , "mydll.dll",szSDKFileName)=0) then 
LaunchAppAndWait(SUPPORTDIR ^ "regsvr32", WINSYSDIR ^ szSDKFileName, WAIT);
else
MessageBox("Not found",SEVERE);
endif;




This code still fails with the LoadError Message and registration from the command line still succeeds at this point.

Any Ideas?

Russell
Labels (1)
0 Kudos
(1) Reply
MichaelU
Level 12 Flexeran
Level 12 Flexeran

Have you tried dependency walker on your DLL on the target machine? One other thing you could try would be making sure the current directory is set to WINSYSDIR as well.

I'm also a little unnerved by your use of a regsvr32 in SUPPORTDIR; it would probably be much better to use the one on the target machine.
0 Kudos