Skip to content

DLL plugin update reports success but does not replace the file; elevated update then fails because the DLL is in use #78

Description

@buhuilida

Overview

我在使用 EarlyUpdateCheck 更新基于 DLL 的 KeePass 插件时遇到问题。
当我以普通模式运行 KeePass 执行更新时,插件会提示更新成功并要求重启,但重启后实际 DLL 文件
并没有被替换。
当我改为以管理员模式运行 KeePass 再次更新时,会弹出 UAC 提示,但随后又提示目标 DLL 文件正在
被使用,无法替换。
看起来 DLL 类插件的更新流程在“需要提权”和“文件被 KeePass 占用”这两种情况下会失效,或者至少
会给出误导性的成功提示。

I encountered a problem when using EarlyUpdateCheck to update DLL-based KeePass plugins.
When I run KeePass normally and perform the update, the plugin reports that the update
succeeded and asks for a restart, but after restarting the actual DLL file has not been
replaced.
When I run KeePass as administrator and try again, I get a UAC prompt, but then the update
reports that the target DLL file is in use and cannot be replaced.
It seems that the update flow for DLL-based plugins fails when elevation is required and/or
when the DLL is locked by KeePass, or at least reports success in a misleading way.

Steps to Reproduce

  1. 安装 KeePass(Setup 安装方式),安装 EarlyUpdateCheck,并安装一个 ZipExtractDll 更新模式分发的插件。
    Install KeePass (Setup installation), install EarlyUpdateCheck, and install a plugin
    distributed through DllDirect or ZipExtractDll update mode.

  2. 正常启动 KeePass,使用 EarlyUpdateCheck 对该 DLL 插件执行更新。
    Start KeePass normally and use EarlyUpdateCheck to update that DLL-based plugin.

  3. 观察到插件提示更新成功,并要求重启 KeePass。
    Observe that the plugin reports a successful update and asks to restart KeePass.

  4. 重启 KeePass 后,检查 Plugins 目录,发现目标 DLL 实际上没有被替换。
    After restarting KeePass, check the Plugins directory and see that the target DLL was
    not actually replaced.

  5. 然后以管理员模式运行 KeePass,再次尝试更新同一个 DLL 插件。
    Then run KeePass as administrator and try updating the same DLL-based plugin again.

  6. 此时会出现 UAC 提示,但随后更新过程提示 DLL 文件正在被使用,无法替换。
    At this point, a UAC prompt appears, but the update process then reports that the DLL
    file is in use and cannot be replaced.

Expected Behavior

对于 DLL 类插件,我期望 EarlyUpdateCheck 至少能够可靠地完成以下两者之一:

  1. 在重启后正确替换 DLL 文件;
  2. 如果由于文件锁定或权限原因无法更新,应明确报告更新失败,而不是提示更新成功。

For DLL-based plugins, I expect EarlyUpdateCheck to reliably do at least one of the
following:

  1. Replace the DLL correctly after restart;
  2. If the update cannot be completed because of file locking or permission issues, clearly
    report the update as failed instead of reporting success.

Actual Behavior

普通模式下,EarlyUpdateCheck 会提示 DLL 插件更新成功并要求重启,但实际 DLL 文件没有变化。
管理员模式下,会先出现 UAC 提示,但之后又提示 DLL 文件正在被使用,无法替换。
因此最终结果是:更新没有真正完成,但在某些情况下界面仍然显示成功。

In normal mode, EarlyUpdateCheck reports that the DLL plugin update succeeded and asks for
a restart, but the actual DLL file does not change.
In administrator mode, a UAC prompt appears first, but the update then reports that the DLL
file is in use and cannot be replaced.
So the end result is that the update is not actually completed, while in some cases the UI
still reports success.

Context

OS: Windows 11 Home Chinese, build 26200
操作系统:Windows 11 家庭版中文版,内部版本 26200

KeePass Version: 2.61.1
KeePass 版本:2.61.1

Plugin Version: EarlyUpdateCheck 4.4.2
插件版本:EarlyUpdateCheck 4.4.2

Additional information:
补充信息:

  • KeePass 安装类型在配置中显示为 Setup
    KeePass installation type is shown as Setup in the configuration.

  • One-click update 已启用。
    One-click update is enabled.

  • 问题只在 DLL 类型插件更新时出现;.plgx 插件更新通常可以正常工作。
    The problem appears when updating DLL-based plugins; .plgx plugin updates usually work
    correctly.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions