Ticket #122 (closed defect: fixed)
charhook.dll cannot be overwritten during reinstallation process
| Reported by: | vtsaran | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 2009.1 |
| Component: | Installer | Version: | development |
| Keywords: | Cc: | ||
| Operating system: | Blocked by: | ||
| Blocking: |
Description (last modified by jteh) (diff)
During reinstallation of NVDA, i.e. when overwriting existing installation, the installer is unable to update charhook.dll because it is write-protected, thus causing "abort/ignore/retry" error during the installer. Even if NVDA is forcefully shut down, charhook.dll still stays in memory and does not unlink until the next restart of the computer.
Change History
comment:1 Changed 4 years ago by vtsaran
- Summary changed from charhook.dll cannot be unregistered during reinstallation process if NVDA is running to charhook.dll cannot be unregistered during reinstallation process
comment:2 Changed 4 years ago by vtsaran
- Priority changed from major to critical
Small correction (since there seems to be no way to edit actual description): the dialog produced by the installer when the write-protected file is encountered is "abort/ignore/retry".
comment:3 Changed 4 years ago by jteh
- Priority changed from critical to major
We have investigated this and found the following:
- This library does not always fail to unload. On my system, it does seem to be unloaded most of the time.
- We do this using a global hook installed using SetWindowsHookEx. Using this mechanism, the system loads the library into other processes; we do not explicitly load it. Thus, we can't explicitly unload it. The documentation notes that the library is not explicitly and immediately unloaded, so one assumes the system does it at its leisure.
- We may be able to get around this by hooking individual threads instead of setting a global hook. In this case, the documentation notes that the system is supposed to explicitly unload the library when the hook is removed.
- Nevertheless, we're not certain this will fix the problem in all cases.
- We really should be using the InstallLib macro in NSIS to install libraries. Among other things, this handles dll versioning, handles reboots if required and allows us to bypass Windows file protection. This should be done for all dlls we install.
- This will require that these dlls be installed separately from the rest of the package.
comment:5 Changed 4 years ago by jteh
I have made the appropriate changes to use InstallLib. Shall commit later today.
comment:6 Changed 4 years ago by jteh
- Component changed from Core to Installer
- Description modified (diff)
- Summary changed from charhook.dll cannot be unregistered during reinstallation process to charhook.dll cannot be overwritten during reinstallation process
We now use InstallLib and UninstallLib as of r2161. This means that the installer will now request a reboot if required when handling libraries. Please test and comment.

