aboutsummaryrefslogtreecommitdiff
path: root/install.bat
diff options
context:
space:
mode:
Diffstat (limited to 'install.bat')
-rw-r--r--install.bat25
1 files changed, 21 insertions, 4 deletions
diff --git a/install.bat b/install.bat
index 5bed6bbd..e1e7cb76 100644
--- a/install.bat
+++ b/install.bat
@@ -264,6 +264,9 @@ local function look_for_headers (directory)
264 return false 264 return false
265end 265end
266 266
267-- Checks a binary file for the runtime dll used by it. If nu runtime is found, it returns an
268-- array of dll's is depends upon.
269-- result: string = runtime used, table = list of dll's depended upon, nil = nothing found.
267local function get_file_runtime(p,f) -- path, filename 270local function get_file_runtime(p,f) -- path, filename
268 local infile = p.."\\"..f 271 local infile = p.."\\"..f
269 local outfile = "output.txt" 272 local outfile = "output.txt"
@@ -293,6 +296,12 @@ local function get_file_runtime(p,f) -- path, filename
293 print(" "..f.." uses "..tostring(result)..".DLL as runtime") 296 print(" "..f.." uses "..tostring(result)..".DLL as runtime")
294 else 297 else
295 print(" No runtime found for "..f) 298 print(" No runtime found for "..f)
299 -- so; create a list of dll's this file is depending upon, next level of the tree
300 result = {}
301 for name in content:gmatch("DLL NAME%: (.-%.DLL)") do
302 --print("found dll:", name)
303 table.insert(result, name)
304 end
296 end 305 end
297 return result 306 return result
298end 307end
@@ -300,11 +309,19 @@ end
300local function get_runtime() 309local function get_runtime()
301 -- first check interpreter 310 -- first check interpreter
302 vars.LUA_RUNTIME = get_file_runtime(vars.LUA_BINDIR, vars.LUA_INTERPRETER) 311 vars.LUA_RUNTIME = get_file_runtime(vars.LUA_BINDIR, vars.LUA_INTERPRETER)
303 if not vars.LUA_RUNTIME then 312 if type(vars.LUA_RUNTIME) == "table" then
304 -- not found, check link library 313 -- a table with dll's depended upon was returned, check this list
305 vars.LUA_RUNTIME = get_file_runtime(vars.LUA_LIBDIR, vars.LUA_LIBNAME) 314 -- note: we only check 1 level deep
315 for _,dll in ipairs(vars.LUA_RUNTIME) do
316 local t = get_file_runtime(vars.LUA_BINDIR, dll)
317 if type(t) == "string" then
318 -- found it
319 vars.LUA_RUNTIME = t
320 break
321 end
322 end
306 end 323 end
307 return (vars.LUA_RUNTIME ~= nil) 324 return (type(vars.LUA_RUNTIME) == "string")
308end 325end
309 326
310local function look_for_lua_install () 327local function look_for_lua_install ()