Are /RegServer
and /RegSvr
the same or different, if different why/how?
For example I have seen (example from a 32-bit OS) this style:
RegSvr32 COM.exe
or
RegSvr32 COM.dll
Or as an alternative (which was on a 64-bit OS):
COM.exe /RegServer
COM.exe /RegSvr
Are these different approaches doing the same thing?
COM servers are registered the same way in 32- bit 64-bit operating systems. The question is related to self-registration, the most straightforward way to register COM server - by asking the server to update HKLM/HKCR registry respectively.
As you cannot run a DLL directly, you use a helper
regsvr32
application. To cut long story short it looks whether DLL is 32- or 64-bit and uses respective version of the application. Then it loads the DLL and passes control to do registration.EXE COM servers can be run directly, so this is what you do passing them /regserver or /unregserver parameters.
The methods are valid for 32- and 64-bit COM servers, for 32- and 64-bit operating systems.
Further reading - Self-Registration: