diff options
Diffstat (limited to 'install.bat')
-rw-r--r-- | install.bat | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/install.bat b/install.bat index 28236707..5bed6bbd 100644 --- a/install.bat +++ b/install.bat | |||
@@ -264,8 +264,8 @@ local function look_for_headers (directory) | |||
264 | return false | 264 | return false |
265 | end | 265 | end |
266 | 266 | ||
267 | local function get_runtime() | 267 | local function get_file_runtime(p,f) -- path, filename |
268 | local infile = vars.LUA_BINDIR .."\\"..vars.LUA_INTERPRETER | 268 | local infile = p.."\\"..f |
269 | local outfile = "output.txt" | 269 | local outfile = "output.txt" |
270 | local content | 270 | local content |
271 | -- analyze binary | 271 | -- analyze binary |
@@ -279,7 +279,7 @@ local function get_runtime() | |||
279 | os.remove(outfile) | 279 | os.remove(outfile) |
280 | if not content then | 280 | if not content then |
281 | print(" Failed to analyze "..infile.." for the runtime used") | 281 | print(" Failed to analyze "..infile.." for the runtime used") |
282 | return false | 282 | return nil |
283 | end | 283 | end |
284 | 284 | ||
285 | -- lookup | 285 | -- lookup |
@@ -290,11 +290,21 @@ local function get_runtime() | |||
290 | end | 290 | end |
291 | 291 | ||
292 | if result then | 292 | if result then |
293 | vars.LUA_RUNTIME = result | 293 | print(" "..f.." uses "..tostring(result)..".DLL as runtime") |
294 | print(" "..vars.LUA_INTERPRETER.." uses "..tostring(result)..".DLL as runtime") | 294 | else |
295 | return true | 295 | print(" No runtime found for "..f) |
296 | end | 296 | end |
297 | return false | 297 | return result |
298 | end | ||
299 | |||
300 | local function get_runtime() | ||
301 | -- first check interpreter | ||
302 | vars.LUA_RUNTIME = get_file_runtime(vars.LUA_BINDIR, vars.LUA_INTERPRETER) | ||
303 | if not vars.LUA_RUNTIME then | ||
304 | -- not found, check link library | ||
305 | vars.LUA_RUNTIME = get_file_runtime(vars.LUA_LIBDIR, vars.LUA_LIBNAME) | ||
306 | end | ||
307 | return (vars.LUA_RUNTIME ~= nil) | ||
298 | end | 308 | end |
299 | 309 | ||
300 | local function look_for_lua_install () | 310 | local function look_for_lua_install () |