@echo off
rem Evie setup for Windows (from https://evie-assistant.pages.dev/guide).
rem It only makes two shortcuts named "Evie" - one on the Desktop, one in the Startup folder so she opens when
rem you sign in to Windows - that open Evie in her own window with Edge or Chrome. Nothing else is installed
rem or changed. To undo: delete the two "Evie" shortcuts (Startup folder: press Windows+R, type shell:startup).
title Evie setup
set "EVIE_URL=https://evie-assistant.pages.dev/"
set "EVIE_BROWSER="
for %%P in ("%ProgramFiles(x86)%\Microsoft\Edge\Application\msedge.exe" "%ProgramFiles%\Microsoft\Edge\Application\msedge.exe" "%ProgramFiles%\Google\Chrome\Application\chrome.exe" "%ProgramFiles(x86)%\Google\Chrome\Application\chrome.exe" "%LocalAppData%\Google\Chrome\Application\chrome.exe") do if not defined EVIE_BROWSER if exist %%P set "EVIE_BROWSER=%%~P"
if not defined EVIE_BROWSER goto nobrowser
echo.
echo   Setting up Evie on this laptop...
powershell -NoProfile -Command "$dir = Join-Path $env:LocalAppData 'Evie'; New-Item -ItemType Directory -Force -Path $dir | Out-Null; $ico = Join-Path $dir 'evie.ico'; try { Invoke-WebRequest -UseBasicParsing -Uri ($env:EVIE_URL + 'evie.ico') -OutFile $ico } catch { $ico = '' }; $sh = New-Object -ComObject WScript.Shell; foreach ($where in @([Environment]::GetFolderPath('Desktop'), [Environment]::GetFolderPath('Startup'))) { $lnk = $sh.CreateShortcut((Join-Path $where 'Evie.lnk')); $lnk.TargetPath = $env:EVIE_BROWSER; $lnk.Arguments = '--app=' + $env:EVIE_URL; $lnk.Description = 'Evie'; if ($ico -and (Test-Path $ico)) { $lnk.IconLocation = $ico }; $lnk.Save() }"
if errorlevel 1 goto failed
echo.
echo   Done. "Evie" is on your Desktop and will open by herself when you sign in to Windows.
echo   Opening her now - sign in with iBudi and allow the microphone the first time.
echo.
start "" "%EVIE_BROWSER%" --app=%EVIE_URL%
pause
exit /b 0
:nobrowser
echo.
echo   Microsoft Edge or Google Chrome was not found on this laptop. Install one of them and run this again.
echo.
pause
exit /b 1
:failed
echo.
echo   The shortcuts could not be made. You can still open Evie at %EVIE_URL%
echo.
pause
exit /b 1
