aboutsummaryrefslogtreecommitdiff
path: root/install.bat
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--install.bat32
1 files changed, 28 insertions, 4 deletions
diff --git a/install.bat b/install.bat
index 3fdaafa0..1bc58bd0 100644
--- a/install.bat
+++ b/install.bat
@@ -21,6 +21,8 @@ SET FORCE_CONFIG=
21SET USE_MINGW= 21SET USE_MINGW=
22SET MKDIR=.\bin\mkdir -p 22SET MKDIR=.\bin\mkdir -p
23SET LUA_LIB_NAMES=lua5.1.lib lua51.dll liblua.dll.a 23SET LUA_LIB_NAMES=lua5.1.lib lua51.dll liblua.dll.a
24SET REGISTRY=OFF
25SET P_SET=FALSE
24 26
25REM *********************************************************** 27REM ***********************************************************
26REM Option parser 28REM Option parser
@@ -33,9 +35,9 @@ IF [%1]==[] GOTO DONE_PARSING
33IF [%1]==[/?] ( 35IF [%1]==[/?] (
34 ECHO Installs LuaRocks. 36 ECHO Installs LuaRocks.
35 ECHO. 37 ECHO.
36 ECHO /P [dir] Where to install. 38 ECHO /P [dir] ^(REQUIRED^) Where to install.
37 ECHO Default is %PREFIX% ^(version; %VERSION%, will be 39 ECHO Note that version; %VERSION%, will be
38 ECHO appended to this path^) 40 ECHO appended to this path.
39 ECHO /CONFIG [dir] Location where the config file should be installed. 41 ECHO /CONFIG [dir] Location where the config file should be installed.
40 ECHO Default is same place of installation 42 ECHO Default is same place of installation
41 ECHO /TREE [dir] Root of the local tree of installed rocks. 43 ECHO /TREE [dir] Root of the local tree of installed rocks.
@@ -66,12 +68,16 @@ IF [%1]==[/?] (
66 ECHO. 68 ECHO.
67 ECHO /F Remove installation directory if it already exists. 69 ECHO /F Remove installation directory if it already exists.
68 ECHO. 70 ECHO.
71 ECHO /R Load registry information to register '.rockspec'
72 ECHO extension with LuaRocks commands ^(right-click^).
73 ECHO.
69 GOTO QUIT 74 GOTO QUIT
70) 75)
71IF /I [%1]==[/P] ( 76IF /I [%1]==[/P] (
72 SET PREFIX=%~2 77 SET PREFIX=%~2
73 SET SYSCONFDIR=%~2 78 SET SYSCONFDIR=%~2
74 SET ROCKS_TREE=%~2 79 SET ROCKS_TREE=%~2
80 SET P_SET=TRUE
75 SHIFT /1 81 SHIFT /1
76 SHIFT /1 82 SHIFT /1
77 GOTO PARSE_LOOP 83 GOTO PARSE_LOOP
@@ -138,11 +144,20 @@ IF /I [%1]==[/F] (
138 SHIFT /1 144 SHIFT /1
139 GOTO PARSE_LOOP 145 GOTO PARSE_LOOP
140) 146)
147IF /I [%1]==[/R] (
148 SET REGISTRY=ON
149 SHIFT /1
150 GOTO PARSE_LOOP
151)
141ECHO Unrecognized option: %1 152ECHO Unrecognized option: %1
142GOTO ERROR 153GOTO ERROR
143:DONE_PARSING 154:DONE_PARSING
144 155
145REM check for combination flags 156REM check for combination/required flags
157IF NOT [%P_SET%]==[TRUE] (
158 Echo Missing required parameter /P
159 GOTO ERROR
160)
146IF [%INSTALL_LUA%]==[ON] ( 161IF [%INSTALL_LUA%]==[ON] (
147 IF NOT [%LUA_INCDIR%%LUA_BINDIR%%LUA_LIBDIR%%LUA_PREFIX%]==[] ( 162 IF NOT [%LUA_INCDIR%%LUA_BINDIR%%LUA_LIBDIR%%LUA_PREFIX%]==[] (
148 ECHO Cannot combine option /L with any of /LUA /BIN /LIB /INC 163 ECHO Cannot combine option /L with any of /LUA /BIN /LIB /INC
@@ -424,6 +439,15 @@ IF NOT EXIST "%APPDATA%/luarocks" (
424 ECHO Rocktree exists: "%APPDATA%\luarocks" 439 ECHO Rocktree exists: "%APPDATA%\luarocks"
425) 440)
426 441
442REM Load registry information
443IF [%REGISTRY%]==[ON] (
444 REM expand template with correct path information
445 ECHO.
446 ECHO Loading registry information for ".rockspec" files
447 lua5.1\bin\lua5.1.exe "%FULL_PREFIX%\create_reg_file.lua" "%FULL_PREFIX%\LuaRocks.reg.template"
448 %FULL_PREFIX%\LuaRocks.reg
449)
450
427REM *********************************************************** 451REM ***********************************************************
428REM Exit handlers 452REM Exit handlers
429REM *********************************************************** 453REM ***********************************************************