-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLaunch Windows.bat
More file actions
37 lines (30 loc) · 1.44 KB
/
Copy pathLaunch Windows.bat
File metadata and controls
37 lines (30 loc) · 1.44 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
@echo off
REM Net Worth Tracker — Windows launcher
REM Opens the HTML in Chrome's app mode (standalone window, no browser UI)
REM and uses a dedicated profile so data persists independently.
setlocal
set "DIR=%~dp0"
set "HTML=%DIR%NetWorthTracker.html"
set "PROFILE=%DIR%.app-profile"
if not exist "%HTML%" (
echo NetWorthTracker.html not found in this folder.
pause
exit /b 1
)
REM Convert backslashes to forward slashes for file:// URL
set "URL=file:///%HTML:\=/%"
REM Try Chrome first
set "BROWSER="
if exist "%ProgramFiles%\Google\Chrome\Application\chrome.exe" set "BROWSER=%ProgramFiles%\Google\Chrome\Application\chrome.exe"
if exist "%ProgramFiles(x86)%\Google\Chrome\Application\chrome.exe" set "BROWSER=%ProgramFiles(x86)%\Google\Chrome\Application\chrome.exe"
if exist "%LOCALAPPDATA%\Google\Chrome\Application\chrome.exe" set "BROWSER=%LOCALAPPDATA%\Google\Chrome\Application\chrome.exe"
REM Fall back to Edge
if "%BROWSER%"=="" if exist "%ProgramFiles(x86)%\Microsoft\Edge\Application\msedge.exe" set "BROWSER=%ProgramFiles(x86)%\Microsoft\Edge\Application\msedge.exe"
if "%BROWSER%"=="" if exist "%ProgramFiles%\Microsoft\Edge\Application\msedge.exe" set "BROWSER=%ProgramFiles%\Microsoft\Edge\Application\msedge.exe"
if "%BROWSER%"=="" (
REM No Chrome or Edge — open with default browser
start "" "%HTML%"
exit /b 0
)
start "" "%BROWSER%" --app="%URL%" --user-data-dir="%PROFILE%" --no-first-run --no-default-browser-check
endlocal