-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.bat
More file actions
84 lines (72 loc) · 2.21 KB
/
install.bat
File metadata and controls
84 lines (72 loc) · 2.21 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
@echo off
title Tasky Installer
color 0B
echo.
echo ========================================
echo Tasky Installer
echo ========================================
echo.
:: Check for admin rights (needed for some systems)
net session >nul 2>&1
if %errorLevel% neq 0 (
echo Requesting administrator privileges...
powershell -Command "Start-Process '%~f0' -Verb RunAs"
exit /b
)
:: Get the directory where the script is located
set "SCRIPT_DIR=%~dp0"
set "INSTALL_DIR=%LOCALAPPDATA%\Tasky"
set "EXE_SOURCE=%SCRIPT_DIR%target\release\tasky.exe"
echo Installing Tasky to: %INSTALL_DIR%
echo.
:: Create install directory
if not exist "%INSTALL_DIR%" mkdir "%INSTALL_DIR%"
:: Build if exe doesn't exist
if not exist "%EXE_SOURCE%" (
echo Building Tasky... please wait...
echo.
cd /d "%SCRIPT_DIR%"
cargo build --release
echo.
)
:: Check again after build
if not exist "%EXE_SOURCE%" (
echo.
echo ERROR: Failed to build Tasky.
echo Make sure Rust is installed: https://rustup.rs
echo.
pause
exit /b 1
)
:: Copy executable
copy /Y "%EXE_SOURCE%" "%INSTALL_DIR%\tasky.exe" >nul
echo Copied tasky.exe
:: Copy widget executable
set "WIDGET_SOURCE=%SCRIPT_DIR%target\release\tasky-widget.exe"
if exist "%WIDGET_SOURCE%" (
copy /Y "%WIDGET_SOURCE%" "%INSTALL_DIR%\tasky-widget.exe" >nul
echo Copied tasky-widget.exe
)
:: Copy desktop app
set "APP_SOURCE=%SCRIPT_DIR%target\release\tasky-app.exe"
if exist "%APP_SOURCE%" (
copy /Y "%APP_SOURCE%" "%INSTALL_DIR%\tasky-app.exe" >nul
echo Copied tasky-app.exe (Desktop App)
)
:: Add to PATH using PowerShell
powershell -Command "$p = [Environment]::GetEnvironmentVariable('Path', 'User'); if ($p -notlike '*Tasky*') { [Environment]::SetEnvironmentVariable('Path', $p + ';%LOCALAPPDATA%\Tasky', 'User'); Write-Host ' Added to PATH' } else { Write-Host ' Already in PATH' }"
echo.
echo ========================================
echo Installation Complete!
echo ========================================
echo.
echo Tasky has been installed successfully!
echo.
echo NEXT STEPS:
echo 1. Close this window
echo 2. Open a NEW terminal (PowerShell or CMD)
echo 3. Type: tasky
echo.
echo To uninstall, run uninstall.bat
echo.
pause