NSIS 检测 Win 7 x64 中的 32 位进程

发布于 2024-10-24 01:49:06 字数 221 浏览 1 评论 0原文

我的 NSIS 安装程序有一个相当常见的任务 - 在安装之前查明 Firefox 是否正在运行,并要求用户关闭它。但我还没有找到适用于 Windows 7 x64 的插件。我测试过 Processes、FindProcDll、nsProcess - 它们都未能检测到 32 位 Firefox。如果有任何关于下一步该去哪里的想法,我将不胜感激。

更新:实际上,我无法使用这些插件检测到 64 位 Firefox。

I have a rather common task for my NSIS installer - to find out if Firefox is running before the install, and ask the user to close it. But I haven't yet found a plugin that works for Windows 7 x64. I have tested Processes, FindProcDll, nsProcess - they all failed to detect the 32-bit firefox. I'd be grateful for any ideas where to look next.

Update: Actually, I couldn't detect the 64-bit firefox either with any of these plugins.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

秋日私语 2024-10-31 01:49:06

FindProcDLL 在 32 位和 64 位系统上对我来说工作得很好。

我尝试找到 32 位进程和 64 位进程,两者都很好。

FindProcDLL worked fine for me on 32 and 64bit systems.

I tried to find 32bit process and 64 bit processes and both were fine.

热鲨 2024-10-31 01:49:06

nsProcess 对我来说工作得很好。它似乎也是您列出的插件中最近更新的一个,所以这就是我使用该插件进行测试的原因。我使用的是 Win 7 x64 并在任务管理器中确认 Firefox 显示为“firefox.exe *32”

!include nsProcess.nsh
...
${nsProcess::FindProcess} "firefox.exe" $R0
${If} $R0 == "0"
    # it's running
${EndIf}

可能的返回代码:

0    Success
603  Process was not currently running
604  Unable to identify system type
605  Unsupported OS
606  Unable to load NTDLL.DLL
607  Unable to get procedure address from NTDLL.DLL
608  NtQuerySystemInformation failed
609  Unable to load KERNEL32.DLL
610  Unable to get procedure address from KERNEL32.DLL
611  CreateToolhelp32Snapshot failed

nsProcess works just fine for me. It also seems to be the most recently updated of the plug-ins you listed, so that's why I tested with that one. I'm using Win 7 x64 and confirmed in Task Manager that Firefox showed as "firefox.exe *32"

!include nsProcess.nsh
...
${nsProcess::FindProcess} "firefox.exe" $R0
${If} $R0 == "0"
    # it's running
${EndIf}

Possible return codes:

0    Success
603  Process was not currently running
604  Unable to identify system type
605  Unsupported OS
606  Unable to load NTDLL.DLL
607  Unable to get procedure address from NTDLL.DLL
608  NtQuerySystemInformation failed
609  Unable to load KERNEL32.DLL
610  Unable to get procedure address from KERNEL32.DLL
611  CreateToolhelp32Snapshot failed
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文