Topic ID: 66
Since the release of Windows Vista, Microsoft has included UAC as part of their operating systems. UAC is enhanced security and when it is in place active, simply running RegSvr32 or
a standard installation .exe without elevating the privileges may fail
(sometimes with an error, sometimes without).
The recommended way to register individual control OCX files is to launch a Command Prompt by right clicking
the CommandPrompt shortcut, then selecting Run as Administrator. Run the
RegSvr32 ctComponent.ocx command from that prompt.
If you need to manually register multiple controls, you can create a small batch file that includes the commands for registering each of the required controls. That batch file can then either be executed directly (using the Run as Administrator option) or run from an elevated command prompt.
Additionally, if you have written an installer .exe for your product and it
registers the .ocx's make sure they right click and run the installation as
Administrator (even if they are logged in as Administrator, they still need to
do this.) or you build an elevation manifest for your .exe.
The short reason behind this is because the COM registries are written to the
HKEY local machine which is now protected under UAC. The right-click
run as Administrator tells the OS to prompt the user that something may happen as
opposed to just blocking that action. This only needs to be done once on client
machines, after the control is registered, the programs that use the ActiveX can
read from that location.
|