mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Refactoring of building scripts
This commit is contained in:
25
scripts/batch/build.bat
Normal file
25
scripts/batch/build.bat
Normal file
@@ -0,0 +1,25 @@
|
||||
cd backend
|
||||
msbuild olympus.sln /t:Build /p:Configuration=Release
|
||||
cd ..
|
||||
|
||||
cd client
|
||||
rmdir /s /q hgt
|
||||
call npm install
|
||||
call npm run emit-declarations
|
||||
call npm run build-release
|
||||
|
||||
cd plugins\controltips
|
||||
call npm install
|
||||
call npm run build-release
|
||||
cd ..\..
|
||||
|
||||
cd plugins\databasemanager
|
||||
call npm install
|
||||
call npm run build-release
|
||||
cd ..\..
|
||||
|
||||
cd ..
|
||||
|
||||
cd manager
|
||||
call npm run build-release
|
||||
cd ..
|
||||
79
scripts/batch/install.bat
Normal file
79
scripts/batch/install.bat
Normal file
@@ -0,0 +1,79 @@
|
||||
@echo OFF
|
||||
echo [36m"*********************************************************************"[0m
|
||||
echo [36m"* _____ _____ _____ ____ _ *"[0m
|
||||
echo [36m"* | __ \ / ____|/ ____| / __ \| | *"[0m
|
||||
echo [36m"* | | | | | | (___ | | | | |_ _ _ __ ___ _ __ _ _ ___ *"[0m
|
||||
echo [36m"* | | | | | \___ \ | | | | | | | | '_ ` _ \| '_ \| | | / __| *"[0m
|
||||
echo [36m"* | |__| | |____ ____) | | |__| | | |_| | | | | | | |_) | |_| \__ \ *"[0m
|
||||
echo [36m"* |_____/ \_____|_____/ \____/|_|\__, |_| |_| |_| .__/ \__,_|___/ *"[0m
|
||||
echo [36m"* __/ | | | *"[0m
|
||||
echo [36m"* |___/ |_| *"[0m
|
||||
echo [36m"*********************************************************************"[0m
|
||||
echo [36mWelcome to the DCS Olympus {{OLYMPUS_VERSION_NUMBER}} installation script. Please wait while the necessary dependencies are installed![0m
|
||||
echo:
|
||||
|
||||
|
||||
WHERE /q powershell
|
||||
if %ERRORLEVEL% NEQ 0 (
|
||||
echo [30m[106mPowershell not installed in the system, no output log available.[0m
|
||||
) else (
|
||||
echo [30m[106mThe 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![0m
|
||||
)
|
||||
|
||||
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 [32mAll done! This window will close in 5 seconds. It may take a couple of seconds for the Olympus Manager to start, please wait... [0m
|
||||
|
||||
timeout /t 5
|
||||
|
||||
cd manager
|
||||
start cscript manager.vbs
|
||||
11
scripts/batch/installer.bat
Normal file
11
scripts/batch/installer.bat
Normal file
@@ -0,0 +1,11 @@
|
||||
@echo OFF
|
||||
|
||||
SET PATH=%PATH%;%WINDIR%\System32;%WINDIR%\System32\WindowsPowerShell\v1.0;
|
||||
|
||||
WHERE /q powershell
|
||||
if %ERRORLEVEL% NEQ 0 (
|
||||
.\scripts\install.bat
|
||||
) else (
|
||||
powershell ".\scripts\install.bat | tee output.log"
|
||||
)
|
||||
|
||||
39
scripts/batch/package.bat
Normal file
39
scripts/batch/package.bat
Normal file
@@ -0,0 +1,39 @@
|
||||
rmdir /s /q package
|
||||
mkdir package
|
||||
|
||||
REM copy the main configuration file
|
||||
echo F|xcopy /Y .\olympus.json .\package\olympus.json
|
||||
|
||||
REM copy the installation scripts
|
||||
echo F|xcopy /Y .\scripts\batch\install.bat .\package\Scripts\install.bat
|
||||
echo F|xcopy /Y .\scripts\batch\installer.bat .\package\installer.bat
|
||||
|
||||
REM copy the hooks script
|
||||
echo F|xcopy /Y .\scripts\lua\hooks\OlympusHook.lua .\package\Scripts\OlympusHook.lua
|
||||
|
||||
REM copy the lua scripts
|
||||
echo F|xcopy /Y .\scripts\lua\backend .\package\mod\scripts
|
||||
|
||||
REM copy the mod folder
|
||||
echo D|xcopy /Y /S /E .\mod .\package\mod
|
||||
|
||||
REM copy the backend dll
|
||||
echo F|xcopy /Y /I .\build\backend\bin\*.dll .\package\mod\bin
|
||||
|
||||
REM copy the client
|
||||
echo D|xcopy /Y /S /E .\build\client .\package\client
|
||||
|
||||
REM copy the manager
|
||||
echo D|xcopy /Y /S /E .\build\manager .\package\manager
|
||||
|
||||
REM copy the images folder
|
||||
echo D|xcopy /Y /S /E .\img\ .\package\img
|
||||
|
||||
REM copy the instructions and text files
|
||||
echo F|xcopy /Y .\LEGAL.txt .\package\LEGAL.txt
|
||||
echo F|xcopy /Y .\INSTRUCTIONS.txt .\package\INSTRUCTIONS.txt
|
||||
echo F|xcopy /Y .\notes.txt .\package\notes.txt
|
||||
|
||||
REM copy the dependencies
|
||||
echo D|xcopy /Y /S /E .\dependencies .\package\dependencies
|
||||
|
||||
Reference in New Issue
Block a user