Details
-
Suggestion
-
Resolution: Done
-
Not Evaluated
-
5.12.0
-
None
Description
ActiveQt currently has a very permissive behavior when attempting to register a COM DLL/EXE server in the registry. It first attempts to register in the machine-wide part of the registry, will automatically fallback to the per-user part. The implementation is found in the UpdateRegistry function in src/activeqt/control/qaxserver.cpp.
This sounds nice in theory, but can easily lead to situations where SW is accidentally installed only for the current user, whereas the intent was a machine-wide installation. User Account Control (UAC) in recent versions of Windows triggers this behavior by default, unless the user explicitly selects "run as administrator". This problem quickly becomes a mess if the per-user registration is not unregistered before doing a machine-wide registration. The computer will then contain a mix of per-user (for only one users) and machine-wide registration (for all users) of the same SW. This might work nicely for a while, but will cause problems if the COM registration is somehow changed in the next SW update.
To mitigate this problem, I'm proposing to change ActiveQt to only perform machine-wide registration by default. Per-user registration can instead be opted in manually by calling regsvr32 /n /i:user for DLLs and RegServerPerUser/UnregServerPerUser arguments for EXE (same as ATL implements in atlmfc\include\atlbase.h).