summaryrefslogtreecommitdiff
path: root/xmake/core/base/process.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2026-02-07 00:57:32 +0800
committerruki <[email protected]>2026-02-07 00:57:32 +0800
commitba898b75c5de008424bea5380977f05d364597b3 (patch)
tree266b092a9287c4d761ce92a98403d809be7b58f7 /xmake/core/base/process.lua
parent7cce7d28b459173ca174d7a5e4391d9194291a69 (diff)
fix missdll
Diffstat (limited to 'xmake/core/base/process.lua')
-rw-r--r--xmake/core/base/process.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/xmake/core/base/process.lua b/xmake/core/base/process.lua
index 031f02bb4..3466b9575 100644
--- a/xmake/core/base/process.lua
+++ b/xmake/core/base/process.lua
@@ -273,6 +273,10 @@ end
-- get missing dlls
function process._get_missing_dlls(program)
+ local missing = {}
+ if not os.isexec(program) then
+ return missing
+ end
-- get paths
local pathenv = os.getenv("PATH") or ""
@@ -280,7 +284,6 @@ function process._get_missing_dlls(program)
table.insert(paths, 1, path.directory(program))
-- find missing dlls
- local missing = {}
local sandbox_module = require("sandbox/modules/import/core/sandbox/module")
local get_depend_libraries = sandbox_module.import("utils.binary.deplibs", {anonymous = true})
local imports = get_depend_libraries(program, {recursive = true}) or {}
@@ -304,9 +307,9 @@ end
-- get process exit errors
function process.get_exit_errors(program, exitcode)
- if is_host("windows") then
+ if os.is_host("windows") then
-- DLL is missing, 0xC0000135
- if exitcode == -1073741515 and os.isexec(program) then
+ if exitcode == -1073741515 then
local missing_dlls = process._get_missing_dlls(program)
if #missing_dlls > 0 then
errors = string.format("system error 0xC0000135 (STATUS_DLL_NOT_FOUND).\nThe application failed to start because the following DLLs were not found:\n - %s\nPlease check your PATH environment variable or copy the missing DLLs to the executable directory.", table.concat(missing_dlls, "\n - "))