Skip to content

Commit

Permalink
✨ Optimize installation of startup scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
Maseshi committed May 8, 2024
1 parent 87a367f commit baa3eca
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 14 deletions.
30 changes: 23 additions & 7 deletions start.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@echo off
title Shioru
cls

echo ##################################################
Expand All @@ -19,23 +20,38 @@ echo.

@REM Check is in admin mode or not
net session >nul 2>&1
if %ERRORLEVEL% NEQ 0 powershell start -verb runas "%0" am_admin & exit /b
if ERRORLEVEL NEQ 0 powershell start -verb runas "%0" am_admin & exit /b

echo Verifying installation of package manager...
call choco --version >nul 2>&1

if %ERRORLEVEL% NEQ 0 (
echo Installing package manager...
if ERRORLEVEL NEQ 0 (
echo Updating and installing package manager...
powershell Set-ExecutionPolicy Bypass -Scope Process -Force
powershell [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
powershell iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
call choco upgrade -y chocolatey
)

echo Updating package manager and installing required components......
call choco upgrade -y chocolatey && choco upgrade -y git nodejs-lts openjdk python3 ffmpeg visualstudio2022buildtools
echo.
echo Updating NPM to the latest version and installing packages...
call npm install -g npm@latest && npm install

echo Updating and installing required components...
call choco list --local-only | findstr /C:"git" || call choco upgrade -y git
call choco list --local-only | findstr /C:"nodejs-lts" || (
call choco upgrade -y nodejs-lts
echo.
echo Updating NPM to the latest version...
call npm install -g npm@latest
)
call choco list --local-only | findstr /C:"openjdk" || call choco upgrade -y openjdk
call choco list --local-only | findstr /C:"python3" || call choco upgrade -y python3
call choco list --local-only | findstr /C:"ffmpeg" || call choco upgrade -y ffmpeg
call choco list --local-only | findstr /C:"visualstudio2022buildtools" || call choco upgrade -y visualstudio2022buildtools
echo.

echo Updating and installing depandancies...
call npm install
echo.

echo Starting up the system...
call npm start
28 changes: 21 additions & 7 deletions start.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,41 @@
#!/bin/sh -x
echo -e '\033]2;Shioru\007'
clear

echo ##################################################
echo # RUNNING VIA START.SH #
echo ##################################################
echo # #
echo # Running this script will automatically update #
echo # and install all necessary packages. If you #
echo # and install all necessary packages. If you #
echo # don't want to continue, you can Ctrl + C #
echo # or ^C. #
echo # #
echo # Will install: git, nodejs, default-jre, #
echo # python3, ffmpeg and build-essential #
echo # python3, ffmpeg and build-essential #
echo # #
echo ##################################################
echo

echo Updating system packages and installing required packages...
sudo apt-get update -y && sudo apt-get upgrade -y
sudo apt-get install curl && curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y git nodejs default-jre python3 ffmpeg build-essential
sudo apt-get update -y
dpkg -s git || sudo apt-get install git -y
dpkg -s nodejs || (
sudo apt-get install curl && curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install nodjs -y
echo
echo Updating NPM to the latest version...
sudo npm install -g npm@latest
)
dpkg -s default-jre || sudo apt-get install default-jre -y
dpkg -s python3 || sudo apt-get install python3 -y
dpkg -s ffmpeg || sudo apt-get install ffmpeg -y
dpkg -s build-essential || sudo apt-get install build-essential -y
echo
echo Updating NPM to the latest version and installing components...
sudo npm install -g npm@latest && sudo npm install

echo Updating and installing depandancies...
sudo npm install
echo

echo Starting up the system...
sudo npm start

0 comments on commit baa3eca

Please sign in to comment.