-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.bat
More file actions
51 lines (43 loc) · 1.7 KB
/
install.bat
File metadata and controls
51 lines (43 loc) · 1.7 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
@echo off
setlocal enabledelayedexpansion
echo.
echo [bold cyan]🌐 QUANTGRID: ASSIMILATION PROTOCOL v1.0[/bold cyan]
echo.
:: 1. Define Paths
set "INSTALL_DIR=%USERPROFILE%\.quantgrid\bin"
set "EXE_SOURCE=%~dp0dist\grid.exe"
:: 2. Create Directory
if not exist "%INSTALL_DIR%" mkdir "%INSTALL_DIR%"
:: 3. Copy Executable
if exist "%EXE_SOURCE%" (
echo [ ] Moving Grid to local bin...
copy /Y "%EXE_SOURCE%" "%INSTALL_DIR%\grid.exe" >nul
) else (
echo [!] dist\grid.exe not found. Build it first.
exit /b 1
)
:: 4. Add to User PATH (via registry to be permanent)
echo [ ] Synchronizing Environment Variables...
for /f "tokens=2*" %%A in ('reg query "HKCU\Environment" /v Path') do set "OLD_PATH=%%B"
echo !OLD_PATH! | find /i "%INSTALL_DIR%" >nul
if %errorlevel% neq 0 (
setx Path "%OLD_PATH%;%INSTALL_DIR%" >nul
)
:: 5. Create "Grid Bash Here" Context Menu
echo [ ] Injecting Context Menu (Registry)...
set "KEY=HKEY_CLASSES_ROOT\Directory\Background\shell\GridBash"
reg add "%KEY%" /ve /t REG_SZ /d "Grid Bash Here" /f >nul
reg add "%KEY%" /v "Icon" /t REG_SZ /d "%INSTALL_DIR%\grid.exe" /f >nul
reg add "%KEY%\command" /ve /t REG_SZ /d "cmd.exe /K \"cd /d %%V && grid\"" /f >nul
:: 6. Create Desktop Shortcut
echo [ ] Materializing Launcher...
powershell -Command "$s = (New-Object -ComObject WScript.Shell).CreateShortcut('%USERPROFILE%\Desktop\Grid Bash.lnk'); $s.TargetPath = '%INSTALL_DIR%\grid.exe'; $s.IconLocation = '%INSTALL_DIR%\grid.exe'; $s.Save()"
echo.
echo [bold green]✅ ASSIMILATION COMPLETE.[/bold green]
echo.
echo You can now:
echo 1. Type 'grid' in any terminal.
echo 2. Right-click any folder and select 'Grid Bash Here'.
echo 3. Launch 'Grid Bash' from your desktop.
echo.
pause