Rev | Line | |
---|
[1] | 1 | |
---|
| 2 | |
---|
| 3 | @echo off |
---|
| 4 | |
---|
| 5 | rem |
---|
| 6 | rem 1 absolute source directory |
---|
| 7 | rem 2 file name (a directory) |
---|
| 8 | rem 3 absolute installation directory |
---|
| 9 | rem 4 exclusion file |
---|
| 10 | rem |
---|
| 11 | |
---|
| 12 | set source_dir=%1% |
---|
| 13 | set dir_name=%2% |
---|
| 14 | set install_dir=%3% |
---|
| 15 | set exclusion_file=%4% |
---|
| 16 | |
---|
| 17 | set dest_file_path=%install_dir%\%dir_name% |
---|
| 18 | set ref_file=%dest_file_path%.cmtref |
---|
| 19 | set full_source_name=%source_dir%\%dir_name% |
---|
| 20 | |
---|
| 21 | if "%source_dir%"=="" exit /B 0 |
---|
| 22 | if "%dir_name%"=="" exit /B 0 |
---|
| 23 | if "%install_dir%"=="" exit /B 0 |
---|
| 24 | |
---|
| 25 | if NOT exist "%full_source_name%" exit /B 0 |
---|
| 26 | |
---|
| 27 | if NOT exist %install_dir% mkdir %install_dir% |
---|
| 28 | |
---|
| 29 | if NOT exist %install_dir% echo "Cannot install directory %dir_name%, no installation directory specified" & exit /B 0 |
---|
| 30 | |
---|
| 31 | echo Installing directory %dir_name% into %install_dir% |
---|
| 32 | |
---|
| 33 | if exist %dest_file_path% rmdir /S/Q %dest_file_path% |
---|
| 34 | |
---|
| 35 | if exist %ref_file% del %ref_file% |
---|
| 36 | |
---|
| 37 | mkdir %dest_file_path% |
---|
| 38 | xcopy /S/Y/Q/EXCLUDE:%exclude_file% %full_source_name% %dest_file_path% |
---|
| 39 | echo %full_source_name% >%ref_file% |
---|
Note: See
TracBrowser
for help on using the repository browser.