To register a COM server, we run something like in elevated mode:
regsvr32.exe com.dll
To perform per-user registration, execute in user account:
regsvr32.exe /n /i:user com.dll
regsvr32.exe support these parameters:
/u - Unregister server
/i - Call DllInstall passing it an optional [cmdline]; when used with /u calls dll uninstall
/n - do not call DllRegisterServer; this option must be used with /i
/s – Silent; display no message boxes (added with Windows XP and Windows Vista)
When create a COM server in Delphi, these methods were exported:
exports
DllGetClassObject,
DllCanUnloadNow,
DllRegisterServer,
DllUnregisterServer,
DllInstall;
I notice these will happen:
- "regsvr32.exe com.dll" invoke DllRegisterServer.
- "regsvr32.exe /u com.dll" invoke DllUnregisterServer.
- "regsvr32.exe /n /i:user com.dll" invoke DllInstall.
- "regsvr32.exe /u /n /i:user com.dll" invoke DllInstall.
I am confuse with parameters /n and /i as well as DllUnregisterServer and DllInstall. Is there any different?
Also, why "/u /n /i:user" invoke Dllinstall? I notice the corresponding registry entry in "HKEY_CURRENT_USER\Software\Classes" was removed.