@echo off
rem Oceans Reign - game client.
rem Opens the game in its own window. The game is loaded from the host every time it is opened,
rem so it is always the newest version: there is nothing to update by hand.
title Oceans Reign
set "GAME_URL=http://oceansreign.com/?client=1"
set "BROWSER="
if exist "%ProgramFiles(x86)%\Microsoft\Edge\Application\msedge.exe" set "BROWSER=%ProgramFiles(x86)%\Microsoft\Edge\Application\msedge.exe"
if not defined BROWSER if exist "%ProgramFiles%\Microsoft\Edge\Application\msedge.exe" set "BROWSER=%ProgramFiles%\Microsoft\Edge\Application\msedge.exe"
if not defined BROWSER if exist "%ProgramFiles%\Google\Chrome\Application\chrome.exe" set "BROWSER=%ProgramFiles%\Google\Chrome\Application\chrome.exe"
if not defined BROWSER if exist "%ProgramFiles(x86)%\Google\Chrome\Application\chrome.exe" set "BROWSER=%ProgramFiles(x86)%\Google\Chrome\Application\chrome.exe"
if not defined BROWSER if exist "%LOCALAPPDATA%\Google\Chrome\Application\chrome.exe" set "BROWSER=%LOCALAPPDATA%\Google\Chrome\Application\chrome.exe"
if not defined BROWSER goto no_app_browser
start "" "%BROWSER%" --app="%GAME_URL%"
exit /b
:no_app_browser
rem Neither Edge nor Chrome was found: open the game in the default browser instead.
start "" "%GAME_URL%"
