-
-
Notifications
You must be signed in to change notification settings - Fork 47
/
_windows-start.bat
executable file
·44 lines (38 loc) · 1.44 KB
/
_windows-start.bat
1
2
3
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
44
@echo off
setlocal EnableExtensions
setlocal enabledelayedexpansion
rem set current working directory to the directory of this script
pushd %~dp0
rem This trick triggers an elevation of privileges. We want it to fail, but if it succeeds tell the user not to do so.
net session >nul 2>&1
if %errorlevel% == 0 (
echo This script is running with administrative privileges.
echo It is recommended to run this script without such privileges.
echo Press Ctrl+C to abort or any other key to continue.
pause >nul
)
rem Exit with nonzero exit code if anything fails
set "errorlevel="
set "CUSHY_RUN_MODE=dist"
rem --------------------------------------------------------------------------------
set "NODE_VERSION=v20.14.0"
set "NODE_ARCH=win-x64"
set "CWD=%CD%"
set "EXTRACT_DIR=%CWD%\.cushy\node\%NODE_VERSION%-%NODE_ARCH%"
set "NODE_INSTALL_DIR=%EXTRACT_DIR%\node-%NODE_VERSION%-%NODE_ARCH%"
set "URL=https://nodejs.org/dist/%NODE_VERSION%/node-%NODE_VERSION%-%NODE_ARCH%.zip"
set "PATH=%NODE_INSTALL_DIR%;%PATH%"
set "NPM_BIN_PATH=%NODE_INSTALL_DIR%\npm"
set "NODE_BIN_PATH=%NODE_INSTALL_DIR%\node"
rem ------------------------------------------------------------------------------
echo Starting Vite with Electron's Node...
set "PATH=%NODE_INSTALL_DIR%;%PATH%"
call .\node_modules\.bin\electron --no-sandbox -i src\shell
if not "%ERRORLEVEL%" == "0" (
echo Starting failed. Did you call install first ?
pause
popd
exit /B 1
)
popd
exit /B 0