diff options
Diffstat (limited to '')
-rw-r--r-- | install.bat | 32 |
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= | |||
21 | SET USE_MINGW= | 21 | SET USE_MINGW= |
22 | SET MKDIR=.\bin\mkdir -p | 22 | SET MKDIR=.\bin\mkdir -p |
23 | SET LUA_LIB_NAMES=lua5.1.lib lua51.dll liblua.dll.a | 23 | SET LUA_LIB_NAMES=lua5.1.lib lua51.dll liblua.dll.a |
24 | SET REGISTRY=OFF | ||
25 | SET P_SET=FALSE | ||
24 | 26 | ||
25 | REM *********************************************************** | 27 | REM *********************************************************** |
26 | REM Option parser | 28 | REM Option parser |
@@ -33,9 +35,9 @@ IF [%1]==[] GOTO DONE_PARSING | |||
33 | IF [%1]==[/?] ( | 35 | IF [%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 | ) |
71 | IF /I [%1]==[/P] ( | 76 | IF /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 | ) |
147 | IF /I [%1]==[/R] ( | ||
148 | SET REGISTRY=ON | ||
149 | SHIFT /1 | ||
150 | GOTO PARSE_LOOP | ||
151 | ) | ||
141 | ECHO Unrecognized option: %1 | 152 | ECHO Unrecognized option: %1 |
142 | GOTO ERROR | 153 | GOTO ERROR |
143 | :DONE_PARSING | 154 | :DONE_PARSING |
144 | 155 | ||
145 | REM check for combination flags | 156 | REM check for combination/required flags |
157 | IF NOT [%P_SET%]==[TRUE] ( | ||
158 | Echo Missing required parameter /P | ||
159 | GOTO ERROR | ||
160 | ) | ||
146 | IF [%INSTALL_LUA%]==[ON] ( | 161 | IF [%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 | ||
442 | REM Load registry information | ||
443 | IF [%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 | |||
427 | REM *********************************************************** | 451 | REM *********************************************************** |
428 | REM Exit handlers | 452 | REM Exit handlers |
429 | REM *********************************************************** | 453 | REM *********************************************************** |