-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOpenMindAI-Setup.bat
More file actions
64 lines (57 loc) · 2.39 KB
/
Copy pathOpenMindAI-Setup.bat
File metadata and controls
64 lines (57 loc) · 2.39 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
@echo off
setlocal EnableExtensions
rem OpenMindAI universal Windows bootstrap launcher.
rem Version: 3.0.1
rem Kept intentionally small -- all real logic lives in
rem bootstrap\windows\bootstrap.ps1 (PowerShell). This file just locates
rem itself, finds/fetches that script, and hands off to it.
set "SCRIPT_DIR=%~dp0"
set "BOOTSTRAP_PS1=%SCRIPT_DIR%bootstrap\windows\bootstrap.ps1"
where powershell >nul 2>nul
if errorlevel 1 (
where pwsh >nul 2>nul
if errorlevel 1 (
echo.
echo [OpenMindAI Setup] PowerShell was not found on this system.
echo OpenMindAI Setup requires Windows PowerShell 5.1+ or PowerShell 7+,
echo which ships with Windows 10/11 by default.
echo.
pause
exit /b 1
)
set "PS_EXE=pwsh"
) else (
set "PS_EXE=powershell"
)
if not exist "%BOOTSTRAP_PS1%" (
echo.
echo [OpenMindAI Setup] bootstrap\windows\bootstrap.ps1 was not found next to this file.
echo This looks like a standalone copy of OpenMindAI-Setup.bat -- fetching
echo the bootstrap script from the official repository...
echo.
if not exist "%SCRIPT_DIR%bootstrap\windows" mkdir "%SCRIPT_DIR%bootstrap\windows" >nul 2>nul
"%PS_EXE%" -NoProfile -ExecutionPolicy Bypass -Command ^
"$ProgressPreference='SilentlyContinue'; try { Invoke-WebRequest -UseBasicParsing -Uri 'https://raw.githubusercontent.com/smshagor-dev/OpenMindAI/main/bootstrap/windows/bootstrap.ps1' -OutFile '%BOOTSTRAP_PS1%' } catch { exit 1 }"
if errorlevel 1 (
echo [OpenMindAI Setup] Could not download the bootstrap script. Check your
echo internet connection, or download the full OpenMindAI repository instead:
echo https://github.com/smshagor-dev/OpenMindAI
echo.
pause
exit /b 1
)
)
rem %SCRIPT_DIR% always ends in a backslash (from %~dp0) -- passed straight
rem into a quoted argument, a trailing \" is parsed by the C runtime as an
rem escaped literal quote, corrupting the argument. Appending "." keeps the
rem path pointing at the same directory while avoiding that trap.
"%PS_EXE%" -NoProfile -ExecutionPolicy Bypass -File "%BOOTSTRAP_PS1%" -LauncherRoot "%SCRIPT_DIR%." %*
set "EXITCODE=%ERRORLEVEL%"
if not "%EXITCODE%"=="0" (
echo.
echo [OpenMindAI Setup] Setup did not complete successfully ^(exit code %EXITCODE%^).
echo See the messages above for details.
echo.
pause
)
exit /b %EXITCODE%