aboutsummaryrefslogtreecommitdiff
path: root/install.bat
diff options
context:
space:
mode:
Diffstat (limited to 'install.bat')
-rw-r--r--install.bat13
1 files changed, 11 insertions, 2 deletions
diff --git a/install.bat b/install.bat
index a98b32fd..43b18e1d 100644
--- a/install.bat
+++ b/install.bat
@@ -67,8 +67,17 @@ local function exec(cmd)
67end 67end
68 68
69local function exists(filename) 69local function exists(filename)
70 local cmd = [[.\win32\tools\test -e "]]..filename..[["]] 70 local fd, _, code = io.open(filename, "r")
71 return exec(cmd) 71 if code == 13 then
72 -- code 13 means "Permission denied" on both Unix and Windows
73 -- io.open on folders always fails with code 13 on Windows
74 return true
75 end
76 if fd then
77 fd:close()
78 return true
79 end
80 return false
72end 81end
73 82
74local function mkdir (dir) 83local function mkdir (dir)