DCSOlympus/scripts/install.bat
2023-12-22 21:28:26 +01:00

79 lines
3.1 KiB
Batchfile
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@echo OFF
echo "*********************************************************************"
echo "* _____ _____ _____ ____ _ *"
echo "* | __ \ / ____|/ ____| / __ \| | *"
echo "* | | | | | | (___ | | | | |_ _ _ __ ___ _ __ _ _ ___ *"
echo "* | | | | | \___ \ | | | | | | | | '_ ` _ \| '_ \| | | / __| *"
echo "* | |__| | |____ ____) | | |__| | | |_| | | | | | | |_) | |_| \__ \ *"
echo "* |_____/ \_____|_____/ \____/|_|\__, |_| |_| |_| .__/ \__,_|___/ *"
echo "* __/ | | | *"
echo "* |___/ |_| *"
echo "*********************************************************************"
echo Welcome to the DCS Olympus {{OLYMPUS_VERSION_NUMBER}} installation script. Please wait while the necessary dependencies are installed!
echo:
WHERE /q powershell
if %ERRORLEVEL% NEQ 0 (
echo Powershell not installed in the system, no output log available.
) else (
echo The output of this script is also available in the file "%CD%\output.log". If you encounter any error, make sure to attach that file to your help request!
)
timeout /t 5
echo Checking if node.js framework is installed...
REM Check if node is installed
node -v 2> Nul
if "%errorlevel%" == "9009" (
echo node.js could not be found, installing it...
msiexec /i "%CD%\dependencies\node-v20.10.0-x64.msi" /passive
set "PATH=%PATH%;%programfiles%\nodejs"
) else (
echo node.js is already installed, continuing installation!
)
echo Installing node modules for client application...
cd .\client
call npm install --omit=dev
cd..
echo Installing node modules for manager application...
cd .\manager
call npm install --omit=dev
cd..
echo Generating shortcuts...
set SCRIPT="%TEMP%\%RANDOM%-%RANDOM%-%RANDOM%-%RANDOM%.vbs"
echo Set oWS = WScript.CreateObject("WScript.Shell") >> %SCRIPT%
echo sLinkFile = "%USERPROFILE%\Desktop\DCS Olympus Manager.lnk" >> %SCRIPT%
echo Set oLink = oWS.CreateShortcut(sLinkFile) >> %SCRIPT%
echo oLink.TargetPath = "%CD%\manager\manager.vbs" >> %SCRIPT%
echo oLink.WorkingDirectory = "%CD%\manager" >> %SCRIPT%
echo oLink.IconLocation = "%CD%\img\olympus_configurator.ico" >> %SCRIPT%
echo oLink.Save >> %SCRIPT%
cscript /nologo %SCRIPT%
del %SCRIPT%
set SCRIPT="%TEMP%\%RANDOM%-%RANDOM%-%RANDOM%-%RANDOM%.vbs"
echo Set oWS = WScript.CreateObject("WScript.Shell") >> %SCRIPT%
echo sLinkFile = "%CD%\DCS Olympus Manager.lnk" >> %SCRIPT%
echo Set oLink = oWS.CreateShortcut(sLinkFile) >> %SCRIPT%
echo oLink.TargetPath = "%CD%\manager\manager.vbs" >> %SCRIPT%
echo oLink.WorkingDirectory = "%CD%\manager" >> %SCRIPT%
echo oLink.IconLocation = "%CD%\img\olympus_configurator.ico" >> %SCRIPT%
echo oLink.Save >> %SCRIPT%
cscript /nologo %SCRIPT%
del %SCRIPT%
echo All done! This window will close in 5 seconds. It may take a couple of seconds for the Olympus Manager to start, please wait... 
timeout /t 5
cd manager
start cscript manager.vbs