-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.bat
More file actions
30 lines (23 loc) · 814 Bytes
/
install.bat
File metadata and controls
30 lines (23 loc) · 814 Bytes
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
@echo off
echo Installing Measuring Stick...
set "INSTALL_DIR=%LOCALAPPDATA%\MeasuringStick"
set "EXE_NAME=MeasuringStick.exe"
:: Create install directory
if not exist "%INSTALL_DIR%" mkdir "%INSTALL_DIR%"
:: Copy the exe to install directory
copy /Y "%~dp0publish\%EXE_NAME%" "%INSTALL_DIR%\%EXE_NAME%"
if %ERRORLEVEL% neq 0 (
echo Failed to copy executable. Make sure you ran 'publish.bat' first.
pause
exit /b 1
)
:: Add to startup registry
reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "MeasuringStick" /t REG_SZ /d "\"%INSTALL_DIR%\%EXE_NAME%\"" /f
echo.
echo Installation complete!
echo The app has been installed to: %INSTALL_DIR%
echo It will start automatically when Windows starts.
echo.
echo Starting the application now...
start "" "%INSTALL_DIR%\%EXE_NAME%"
pause