diff options
-rw-r--r-- | install.bat | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/install.bat b/install.bat index 47395831..280d361f 100644 --- a/install.bat +++ b/install.bat | |||
@@ -86,7 +86,7 @@ end | |||
86 | 86 | ||
87 | -- does the current user have admin priviledges ( = elevated) | 87 | -- does the current user have admin priviledges ( = elevated) |
88 | local function permission() | 88 | local function permission() |
89 | return exec("net session >nul 2>&1") -- fails if not admin | 89 | return exec("net session >NUL 2>&1") -- fails if not admin |
90 | end | 90 | end |
91 | 91 | ||
92 | -- rename file (full path) to backup (name only), appending number if required | 92 | -- rename file (full path) to backup (name only), appending number if required |
@@ -651,23 +651,26 @@ ENDLOCAL | |||
651 | f:close() | 651 | f:close() |
652 | print(S"Created LuaRocks command: $BINDIR\\"..c..".bat") | 652 | print(S"Created LuaRocks command: $BINDIR\\"..c..".bat") |
653 | end | 653 | end |
654 | -- configure 'scripts' directory | ||
655 | if vars.SCRIPTS_DIR then | ||
656 | mkdir(vars.SCRIPTS_DIR) | ||
657 | if not USE_MINGW then | ||
658 | -- definitly not for MinGW because of conflicting runtimes | ||
659 | -- but is it ok to do it for others??? | ||
660 | exec(S[[COPY lua5.1\bin\*.dll "$SCRIPTS_DIR" >NUL]]) | ||
661 | end | ||
662 | else | ||
663 | if not USE_MINGW then | ||
664 | mkdir(S[[$ROCKS_TREE\bin]]) | ||
665 | -- definitly not for MinGW because of conflicting runtimes | ||
666 | -- but is it ok to do it for others??? | ||
667 | exec(S[[COPY lua5.1\bin\*.dll "$ROCKS_TREE"\bin >NUL]]) | ||
668 | end | ||
669 | end | ||
670 | 654 | ||
655 | -- part below was commented out as its purpose was unclear | ||
656 | -- see https://github.com/keplerproject/luarocks/pull/197#issuecomment-30176548 | ||
657 | |||
658 | -- configure 'scripts' directory | ||
659 | -- if vars.SCRIPTS_DIR then | ||
660 | -- mkdir(vars.SCRIPTS_DIR) | ||
661 | -- if not USE_MINGW then | ||
662 | -- -- definitly not for MinGW because of conflicting runtimes | ||
663 | -- -- but is it ok to do it for others??? | ||
664 | -- exec(S[[COPY lua5.1\bin\*.dll "$SCRIPTS_DIR" >NUL]]) | ||
665 | -- end | ||
666 | -- else | ||
667 | -- if not USE_MINGW then | ||
668 | -- mkdir(S[[$ROCKS_TREE\bin]]) | ||
669 | -- -- definitly not for MinGW because of conflicting runtimes | ||
670 | -- -- but is it ok to do it for others??? | ||
671 | -- exec(S[[COPY lua5.1\bin\*.dll "$ROCKS_TREE"\bin >NUL]]) | ||
672 | -- end | ||
673 | -- end | ||
671 | 674 | ||
672 | -- *********************************************************** | 675 | -- *********************************************************** |
673 | -- Configure LuaRocks | 676 | -- Configure LuaRocks |
@@ -763,7 +766,8 @@ else | |||
763 | print(S[[System rocktree exists : "$ROCKS_TREE"]]) | 766 | print(S[[System rocktree exists : "$ROCKS_TREE"]]) |
764 | end | 767 | end |
765 | 768 | ||
766 | vars.LOCAL_TREE = os.getenv("APPDATA")..[[\LuaRocks]] | 769 | vars.APPDATA = os.getenv("APPDATA") |
770 | vars.LOCAL_TREE = vars.APPDATA..[[\LuaRocks]] | ||
767 | if not exists(vars.LOCAL_TREE) then | 771 | if not exists(vars.LOCAL_TREE) then |
768 | mkdir(vars.LOCAL_TREE) | 772 | mkdir(vars.LOCAL_TREE) |
769 | print(S[[Created local user rocktree: "$LOCAL_TREE"]]) | 773 | print(S[[Created local user rocktree: "$LOCAL_TREE"]]) |
@@ -784,9 +788,9 @@ end | |||
784 | -- Cleanup | 788 | -- Cleanup |
785 | -- *********************************************************** | 789 | -- *********************************************************** |
786 | -- remove regsitry related files, no longer needed | 790 | -- remove regsitry related files, no longer needed |
787 | exec( S[[del "$FULL_PREFIX\LuaRocks.reg.*" > nul]] ) | 791 | exec( S[[del "$FULL_PREFIX\LuaRocks.reg.*" >NUL]] ) |
788 | -- remove pe-parser module | 792 | -- remove pe-parser module |
789 | exec( S[[del "$FULL_PREFIX\pe-parser.lua" > nul]] ) | 793 | exec( S[[del "$FULL_PREFIX\pe-parser.lua" >NUL]] ) |
790 | 794 | ||
791 | -- *********************************************************** | 795 | -- *********************************************************** |
792 | -- Exit handlers | 796 | -- Exit handlers |
@@ -812,5 +816,8 @@ System rocktree | |||
812 | LUA_PATH : $ROCKS_TREE\share\lua\$LUA_VERSION\?.lua;$ROCKS_TREE\share\lua\$LUA_VERSION\?\init.lua | 816 | LUA_PATH : $ROCKS_TREE\share\lua\$LUA_VERSION\?.lua;$ROCKS_TREE\share\lua\$LUA_VERSION\?\init.lua |
813 | LUA_CPATH: $ROCKS_TREE\lib\lua\$LUA_VERSION\?.dll | 817 | LUA_CPATH: $ROCKS_TREE\lib\lua\$LUA_VERSION\?.dll |
814 | 818 | ||
819 | Note that the %APPDATA% element in the paths above is user specific and it MUST be replaced by its actual value. | ||
820 | For the current user that value is: $APPDATA. | ||
821 | |||
815 | ]]) | 822 | ]]) |
816 | os.exit(0) | 823 | os.exit(0) |