Skip to content

Commit d8b3815

Browse files
committed
Removing references to legacy GUI.
1 parent 4dea349 commit d8b3815

3 files changed

Lines changed: 34 additions & 52 deletions

File tree

run-gui.bat

Lines changed: 0 additions & 31 deletions
This file was deleted.

run.bat

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,6 @@ cd /D "%~dp0"
66
@rem Make sure the environment variables are up-to-date. This is useful if the user installed python a moment ago.
77
call ./RefreshEnv.cmd
88

9-
setlocal EnableDelayedExpansion
10-
11-
@rem Run the is_safe_to_upgrade function and save the output to a temp file.
12-
python -c "from rlbot.utils import public_utils; print(public_utils.is_safe_to_upgrade());" > %temp%\is_safe_to_upgrade.txt
13-
14-
IF %ERRORLEVEL% NEQ 0 (
15-
@rem The python command failed, so rlbot is probably not installed at all. Safe to 'upgrade'.
16-
set is_safe_to_upgrade=True
17-
) ELSE (
18-
@rem read the file containing the python output.
19-
set /p is_safe_to_upgrade= < %temp%\is_safe_to_upgrade.txt
20-
)
21-
del %temp%\is_safe_to_upgrade.txt
22-
23-
IF "!is_safe_to_upgrade!"=="True" (
24-
python -m pip install -r requirements.txt --upgrade
25-
) ELSE (
26-
echo Will not attempt to upgrade rlbot because files are in use.
27-
)
28-
29-
python -c "from rlbot import runner; runner.main();"
9+
python run.py
3010

3111
pause

run.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import subprocess
2+
import sys
3+
4+
DEFAULT_LOGGER = 'rlbot'
5+
6+
if __name__ == '__main__':
7+
8+
try:
9+
from rlbot.utils import public_utils, logging_utils
10+
11+
logger = logging_utils.get_logger(DEFAULT_LOGGER)
12+
if not public_utils.have_internet():
13+
logger.log(logging_utils.logging_level,
14+
'Skipping upgrade check for now since it looks like you have no internet')
15+
elif public_utils.is_safe_to_upgrade():
16+
subprocess.call([sys.executable, "-m", "pip", "install", '-r', 'requirements.txt'])
17+
subprocess.call([sys.executable, "-m", "pip", "install", 'rlbot', '--upgrade'])
18+
19+
# https://stackoverflow.com/a/44401013
20+
rlbots = [module for module in sys.modules if module.startswith('rlbot')]
21+
for rlbot_module in rlbots:
22+
sys.modules.pop(rlbot_module)
23+
24+
except ImportError:
25+
subprocess.call([sys.executable, "-m", "pip", "install", '-r', 'requirements.txt', '--upgrade', '--upgrade-strategy=eager'])
26+
27+
try:
28+
from rlbot import runner
29+
runner.main()
30+
except Exception as e:
31+
print("Encountered exception: ", e)
32+
print("Press enter to close.")
33+
input()

0 commit comments

Comments
 (0)