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).
Attachments
For Gerrit Dashboard: QTBUG-76269 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
264390,5 | Move registry key add/delete to a new UpdateRegistryKeys function | dev | qt/qtactiveqt | Status: MERGED | +2 | 0 |
264583,7 | Remove fallback to per-user registration | dev | qt/qtactiveqt | Status: MERGED | +2 | 0 |
264584,9 | Implement explicit support for per-user registration | dev | qt/qtactiveqt | Status: MERGED | +2 | 0 |
264990,2 | Change UpdateRegistry argument type from BOOL to bool | dev | qt/qtactiveqt | Status: MERGED | +2 | 0 |
265516,2 | Introduce qScopeGuard for UpdateRegistry() cleanup | dev | qt/qtactiveqt | Status: MERGED | +2 | 0 |
265942,3 | Document per-user registration | dev | qt/qtactiveqt | Status: MERGED | +2 | 0 |
286642,7 | Add per-user registration support to IDC tool | 5.14 | qt/qtactiveqt | Status: MERGED | +2 | 0 |