Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

REGSVR32 for 3rd party DLL's

Status
Not open for further replies.

chelseatech

Instructor
Aug 25, 2001
1,812
0
0
NZ
I'm a developer and some of my applications need to be installed as a DLL in a specific Windows folder. On XP that involved copying the DLL and registering it with REGSVR32.

On Windows Vista, that doesn't seem to work at all.

Interesting using Installshield to biuld an install to put the DLL in the correct location, takes care of the registration nicely.

Why can't I do this manually? I'm running the command prompt under administrator, but that didn't help.

Editor and Publisher of Crystal Clear
 
The more... "mature" installers don't normally use an ActiveX library's DLLSelfRegister entrypoint for registration (which is what regsvr32 calls). They update the registry according to rules in the installer database through "Associations" mappings (which can include Document Type, MIME Type, COM Object, and Type Library associations).

They also run in a privileged installer context normally.

Even so, I can't see why you couldn't still invoke self registration using regsvr32. I was pretty sure the only requirement was to run elevated if you wanted the component registered in HKLM instead of HKCU.


When you say you are "running the command prompt under administrator" what do you mean? Just running under an admin account isn't good enough. The usual recommendation for this is to elevate a command prompt and then run regsvr32 from there.

If you're already doing this I'm not sure what the problem might be.


It isn't considered good practice to manually register components. Even invoking DLLSelfRegister within an installer is considered "bad form" because it defeats rollback and doesn't permit advertising:
Registering installed COM objects in a manner compliant with Windows installer requirements makes it possible for your users to rollback COM object installation and registration if the product installation fails. Windows installer registration of COM objects also facilitates advertising COM objects on the target machine. For these reasons, registering COM objects with the Windows installer is recommended over self-registering COM objects at installation. (Self-registering installed COM objects was a common strategy in traditional scripted setup procedures, but the advent of the Windows installer overrides the advantages of self-registration.)
That advice dates back to 2000 if not 1999.

Sometimes though "you gotta do what you gotta do."

If you don't have to support OSs prior to Win XP there is the registration-free COM option as well.
 
Thanks for replying so fast. My user account was running with Admin rights, but I was using the command prompt with elevated permissions. For some reason is working nicely now. Didn't before.

The DLL has to be registered or the package it works with can't see it.

Thanks for your help.

Editor and Publisher of Crystal Clear
 
When you wanna register DLLs in vista... create a txt file and create a *.bat script ..

REGSVR32 /s file.dll
REGSVR32 /s file2.dll

etc etc..

save it to desktop...
Right-click ... Run as Administrator...

This will work..

AlRo
System Administrator
Ottawa, Canada.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top