@echo off title uninstall loading started color 0a echo ===================================================================== echo uninstall loading started echo ===================================================================== echo %basePath% set DIR=%1 set basePath=%DIR%\ set FDMGEA_HOME=%basePath%\ set JAVA_HOME=%basePath%jdk1.8 set MYSQL_HOME=%basePath%mysql set REDIS_HOME=%basePath%redis set MONGODB_HOME=%basePath%mongodb set BIN_HOME=%basePath%bin set USER_DATA=%basePath%USER_DATA set bin=%MYSQL_HOME%\bin for /f "skip=3 tokens=4" %%i in ('sc query lasermongodb') do set "zt=%%i" &goto :next :next if /i "%zt%"=="RUNNING" ( echo lasermongodb pass ) else ( sc delete lasermongodb echo lasermongodb reinstall cd .> %MONGODB_HOME%\mongo.conf echo port=29031 >> %MONGODB_HOME%\mongo.conf echo dbpath=%MONGODB_HOME%\db >> %MONGODB_HOME%\mongo.conf echo logpath=%MONGODB_HOME%\logs\mongo.log >> %MONGODB_HOME%\mongo.conf echo logappend=true >> %MONGODB_HOME%\mongo.conf echo maxConns=1000 >> %MONGODB_HOME%\mongo.conf sc delete lasermongodb sc create lasermongodb binpath= "%MONGODB_HOME%\bin\mongod.exe --config %MONGODB_HOME%\mongo.conf --service" start= auto net start lasermongodb if exist %USER_DATA%\mon\ ( echo "file exists" %baseMongodbdir%\bin\mongorestore.exe --host 127.0.0.1 --port 29031 --gzip %USER_DATA%\mon rd /s /q %USER_DATA%\mon ) else ( echo "file no exists" %MONGODB_HOME%\bin\mongorestore.exe --host 127.0.0.1 --port 29031 --gzip %MONGODB_HOME%\script ) ) for /f "skip=3 tokens=4" %%i in ('sc query lasermysql') do set "zt=%%i" &goto :next :next if /i "%zt%"=="RUNNING" ( echo lasermysql pass ) else ( sc delete lasermysql echo lasermysql reinstall if exist %MYSQL_HOME%\bin\mysqld.exe ( >%MYSQL_HOME%\my.ini echo [mysqld] >>%MYSQL_HOME%\my.ini echo port=3307 >>%MYSQL_HOME%\my.ini echo basedir= %MYSQL_HOME:\=\\% >>%MYSQL_HOME%\my.ini echo datadir= %MYSQL_HOME:\=\\%\\data >>%MYSQL_HOME%\my.ini echo log-error=%MYSQL_HOME:\=\\%\\logs.log >>%MYSQL_HOME%\my.ini echo max_connections=200 >>%MYSQL_HOME%\my.ini echo max_connect_errors=10 >>%MYSQL_HOME%\my.ini echo character-set-server=utf8mb4 >>%MYSQL_HOME%\my.ini echo default-storage-engine=INNODB >>%MYSQL_HOME%\my.ini echo default_authentication_plugin=mysql_native_password >>%MYSQL_HOME%\my.ini echo local_infile=ON >>%MYSQL_HOME%\my.ini echo. >>%MYSQL_HOME%\my.ini echo [mysql] >>%MYSQL_HOME%\my.ini echo default-character-set=utf8mb4 >>%MYSQL_HOME%\my.ini echo local_infile=ON >>%MYSQL_HOME%\my.ini echo [client] >>%MYSQL_HOME%\my.ini echo port=3307 >>%MYSQL_HOME%\my.ini echo default-character-set=utf8mb4 >>%MYSQL_HOME%\my.ini echo. %MYSQL_HOME%\bin\mysqld --initialize-insecure --lower-case-table-names=1 echo start install mysql %MYSQL_HOME%\bin\mysqld --install lasermysql | find "successfully" && echo successfully mysql echo. echo start mysql service net start lasermysql echo. %MYSQL_HOME%\bin\mysql -P3307 -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'laser'"; %MYSQL_HOME%\bin\mysql -P3307 -u root -plaser -e "CREATE DATABASE IF NOT EXISTS `laser` CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci "; echo start db tables if exist %USER_DATA%\lite.sql ( echo "file exists" %MYSQL_HOME%\bin\mysql.exe -P3307 -u root -plaser laser < %USER_DATA%\lite.sql del %USER_DATA%\lite.sql ) else ( echo "file no exists" %MYSQL_HOME%\bin\mysql.exe -P3307 -u root -plaser laser < %MYSQL_HOME%\sqlfile\fdkk_laser.sql ) echo ---Installation mysql completed--- ) ) echo %REDIS_HOME%\resources\static\ for /f "skip=3 tokens=4" %%i in ('sc query laserredis') do set "zt=%%i" &goto :next :next if /i "%zt%"=="RUNNING" ( echo laserredis pass ) else ( sc delete laserredis echo laserredis reinstall %REDIS_HOME% echo ---Installation redis start--- "%REDIS_HOME%\redis-server.exe" --service-install "%REDIS_HOME%\redis.windows.conf" --service-name laserredis --loglevel verbose net start laserredis sc config laserredis start=auto net stop laserredis net start laserredis echo ---Installation redis completed--- ) cd .>%BIN_HOME%\resources\static\setting.json echo { > %BIN_HOME%\resources\static\setting.json echo "sceneConfig": "config.json", >> %BIN_HOME%\resources\static\setting.json echo "sceheKey": "id", >> %BIN_HOME%\resources\static\setting.json echo "sceneBundle": "./build.zip", >> %BIN_HOME%\resources\static\setting.json echo "sceneBundleDir": "capture", >> %BIN_HOME%\resources\static\setting.json echo "buildModelPath": "%basePath%4DKK_PROGRAM_DATA\", >> %BIN_HOME%\resources\static\setting.json echo "javaPort":9000, >> %BIN_HOME%\resources\static\setting.json echo "profilePath": "%basePath%4DKK_PROGRAM_STATIC\", >> %BIN_HOME%\resources\static\setting.json echo "buildCallPath": "%basePath%CGAII" , >> %BIN_HOME%\resources\static\setting.json echo "binPath": "%BIN_HOME%\resources\static" >> %BIN_HOME%\resources\static\setting.json echo } >> %BIN_HOME%\resources\static\setting.json set /a i=0 for /f "delims=" %%i in ('findstr /n .* %BIN_HOME%\resources\static\setting.json' ) do ( set "a=%%i" set "a=!a:*:=!" set "b=!a:\=\\!" echo.!b!>>%BIN_HOME%\resources\static\setting-b.json ) del %BIN_HOME%\resources\static\setting.json ren %BIN_HOME%\resources\static\setting-b.json setting.json echo ---Installation config completed--- rd /s /q %USER_DATA% ping -n 3 127.1>nul del %0