From c4a1e4d10d411b6ae196de14ade9dbc1de0702c8 Mon Sep 17 00:00:00 2001 From: chrox Date: Thu, 25 Sep 2014 22:22:30 +0800 Subject: [PATCH] update PATH variable on startup for Windows --- reader.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/reader.lua b/reader.lua index a13fd11c4..ef59703fd 100755 --- a/reader.lua +++ b/reader.lua @@ -3,7 +3,17 @@ require "defaults" pcall(dofile, "defaults.persistent.lua") package.path = "?.lua;common/?.lua;frontend/?.lua" -package.cpath = "?.so;common/?.so;/usr/lib/lua/?.so" +package.cpath = "?.so;common/?.so;common/?.dll;/usr/lib/lua/?.so" + +local ffi = require("ffi") +if ffi.os == "Windows" then + ffi.cdef[[ + int _putenv(const char *envvar); + ]] + ffi.C._putenv("PATH=libs;common;") + --ffi.C._putenv("EMULATE_READER_W=480") + --ffi.C._putenv("EMULATE_READER_H=600") +end local DocSettings = require("docsettings") local _ = require("gettext")