diff options
Diffstat (limited to 'install.bat')
-rw-r--r-- | install.bat | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/install.bat b/install.bat index 6dc8cd02..85ef73f6 100644 --- a/install.bat +++ b/install.bat | |||
@@ -1,6 +1,6 @@ | |||
1 | rem=rem --[[ | 1 | rem=rem --[[ |
2 | @setlocal& set luafile="%~f0" & if exist "%~f0.bat" set luafile="%~f0.bat" | 2 | @setlocal& set luafile="%~f0" & if exist "%~f0.bat" set luafile="%~f0.bat" |
3 | @lua5.1\bin\lua5.1.exe %luafile% %*& exit /b ]] | 3 | @win32\lua5.1\bin\lua5.1.exe %luafile% %*& exit /b ]] |
4 | 4 | ||
5 | local vars = {} | 5 | local vars = {} |
6 | 6 | ||
@@ -38,7 +38,7 @@ local SELFCONTAINED = false | |||
38 | -- Some helpers | 38 | -- Some helpers |
39 | -- | 39 | -- |
40 | 40 | ||
41 | local pe = assert(loadfile(".\\bin\\pe-parser.lua"))() | 41 | local pe = assert(loadfile(".\\win32\\pe-parser.lua"))() |
42 | 42 | ||
43 | local function die(message) | 43 | local function die(message) |
44 | if message then print(message) end | 44 | if message then print(message) end |
@@ -80,12 +80,12 @@ local function exec(cmd) | |||
80 | end | 80 | end |
81 | 81 | ||
82 | local function exists(filename) | 82 | local function exists(filename) |
83 | local cmd = [[.\bin\bin\test -e "]]..filename..[["]] | 83 | local cmd = [[.\win32\tools\test -e "]]..filename..[["]] |
84 | return exec(cmd) | 84 | return exec(cmd) |
85 | end | 85 | end |
86 | 86 | ||
87 | local function mkdir (dir) | 87 | local function mkdir (dir) |
88 | return exec([[.\bin\bin\mkdir -p "]]..dir..[[" >NUL]]) | 88 | return exec([[.\win32\tools\mkdir -p "]]..dir..[[" >NUL]]) |
89 | end | 89 | end |
90 | 90 | ||
91 | -- does the current user have admin priviledges ( = elevated) | 91 | -- does the current user have admin priviledges ( = elevated) |
@@ -666,13 +666,22 @@ if INSTALL_LUA then | |||
666 | if not exists(vars.LUA_INCDIR) then | 666 | if not exists(vars.LUA_INCDIR) then |
667 | mkdir(vars.LUA_INCDIR) | 667 | mkdir(vars.LUA_INCDIR) |
668 | end | 668 | end |
669 | exec(S[[COPY lua5.1\bin\*.* "$LUA_BINDIR" >NUL]]) | 669 | exec(S[[COPY win32\lua5.1\bin\*.* "$LUA_BINDIR" >NUL]]) |
670 | exec(S[[COPY lua5.1\include\*.* "$LUA_INCDIR" >NUL]]) | 670 | exec(S[[COPY win32\lua5.1\include\*.* "$LUA_INCDIR" >NUL]]) |
671 | print(S"Installed the LuaRocks bundled Lua interpreter in $LUA_BINDIR") | 671 | print(S"Installed the LuaRocks bundled Lua interpreter in $LUA_BINDIR") |
672 | end | 672 | end |
673 | 673 | ||
674 | -- Copy the LuaRocks binaries | 674 | -- Copy the LuaRocks binaries |
675 | if not exec(S[[XCOPY /S bin\*.* "$BINDIR" >NUL]]) then | 675 | if not exists(S[[$BINDIR\tools]]) then |
676 | if not mkdir(S[[$BINDIR\tools]]) then | ||
677 | die() | ||
678 | end | ||
679 | end | ||
680 | if not exec(S[[COPY win32\tools\*.* "$BINDIR\tools" >NUL]]) then | ||
681 | die() | ||
682 | end | ||
683 | -- Copy LR bin helper files | ||
684 | if not exec(S[[COPY win32\*.* "$BINDIR" >NUL]]) then | ||
676 | die() | 685 | die() |
677 | end | 686 | end |
678 | -- Copy the LuaRocks lua source files | 687 | -- Copy the LuaRocks lua source files |
@@ -870,7 +879,7 @@ if REGISTRY then | |||
870 | -- expand template with correct path information | 879 | -- expand template with correct path information |
871 | print() | 880 | print() |
872 | print([[Loading registry information for ".rockspec" files]]) | 881 | print([[Loading registry information for ".rockspec" files]]) |
873 | exec( S[[lua5.1\bin\lua5.1.exe "$FULL_PREFIX\LuaRocks.reg.lua" "$FULL_PREFIX\LuaRocks.reg.template"]] ) | 882 | exec( S[[win32\lua5.1\bin\lua5.1.exe "$FULL_PREFIX\LuaRocks.reg.lua" "$FULL_PREFIX\LuaRocks.reg.template"]] ) |
874 | exec( S[[regedit /S "$FULL_PREFIX\\LuaRocks.reg"]] ) | 883 | exec( S[[regedit /S "$FULL_PREFIX\\LuaRocks.reg"]] ) |
875 | end | 884 | end |
876 | 885 | ||