make_install.bat 1.8 KB
Newer Older
wafwerar's avatar
wafwerar 已提交
1 2 3
@echo off
goto %1
:needAdmin
wafwerar's avatar
wafwerar 已提交
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43

if exist C:\\TDengine\\data\\dnode\\dnodeCfg.json (
  echo The default data directory C:/TDengine/data contains old data of tdengine 2.x, please clear it before installing!
)
set source_dir=%2
set source_dir=%source_dir:/=\\%
set binary_dir=%3
set binary_dir=%binary_dir:/=\\%
set osType=%4
set verNumber=%5
set tagert_dir=C:\\TDengine

if not exist %tagert_dir% (
    mkdir %tagert_dir%
)
if not exist %tagert_dir%\\cfg (
    mkdir %tagert_dir%\\cfg
)
if not exist %tagert_dir%\\include (
    mkdir %tagert_dir%\\include
)
if not exist %tagert_dir%\\driver (
    mkdir %tagert_dir%\\driver
)
if not exist C:\\TDengine\\cfg\\taos.cfg (
    copy %source_dir%\\packaging\\cfg\\taos.cfg %tagert_dir%\\cfg\\taos.cfg > nul
)
copy %source_dir%\\include\\client\\taos.h %tagert_dir%\\include > nul
copy %source_dir%\\include\\util\\taoserror.h %tagert_dir%\\include > nul
copy %source_dir%\\include\\libs\\function\\taosudf.h %tagert_dir%\\include > nul
copy %binary_dir%\\build\\lib\\taos.lib %tagert_dir%\\driver > nul
copy %binary_dir%\\build\\lib\\taos_static.lib %tagert_dir%\\driver > nul
copy %binary_dir%\\build\\lib\\taos.dll %tagert_dir%\\driver > nul
copy %binary_dir%\\build\\bin\\taos.exe %tagert_dir% > nul
copy %binary_dir%\\build\\bin\\taosd.exe %tagert_dir% > nul
copy %binary_dir%\\build\\bin\\udfd.exe %tagert_dir% > nul
if exist %binary_dir%\\build\\bin\\taosBenchmark.exe (
    copy %binary_dir%\\build\\bin\\taosBenchmark.exe %tagert_dir% > nul
)

wafwerar's avatar
wafwerar 已提交
44
mshta vbscript:createobject("shell.application").shellexecute("%~s0",":hasAdmin","","runas",1)(window.close)&& echo To start/stop TDengine with administrator privileges: sc start/stop taosd &goto :eof
wafwerar's avatar
wafwerar 已提交
45
:hasAdmin
wafwerar's avatar
wafwerar 已提交
46
copy /y C:\\TDengine\\driver\\taos.dll C:\\Windows\\System32 > nul
wafwerar's avatar
wafwerar 已提交
47
sc query "taosd" >nul || sc create "taosd" binPath= "C:\\TDengine\\taosd.exe --win_service" start= DEMAND