Skip to content

Commit ba7da0b

Browse files
author
CharmySoft
committed
Create the script and shortcut for Windows
1 parent 2abfd74 commit ba7da0b

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

Start Game.lnk

1.93 KB
Binary file not shown.

start-game.bat

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
@echo off
2+
3+
:: Copy the icon to the temp folder
4+
COPY RES\icon.ico %TEMP%\tic-tac-toe-icon.ico
5+
6+
:: Run 'pythonw --version' and put it into variable PYTHON_VERSION
7+
FOR /F "tokens=* USEBACKQ" %%F IN (`pythonw --version`) DO (
8+
SET PYTHON_VERSION=%%F
9+
)
10+
11+
:: Check if Python 3 is installed
12+
IF "%PYTHON_VERSION:~0,8%" == "Python 2" (
13+
:: If Python 2 is installed, show the message
14+
ECHO Your Python version is %PYTHON_VERSION%. You need to install Python 3 and set its path first.
15+
mshta javascript:alert^("Your Python version is %PYTHON_VERSION%. \nYou need to install Python 3 and set its path first."^);close^(^);
16+
start "" http://www.python.org/downloads/
17+
exit /b
18+
)
19+
IF NOT "%PYTHON_VERSION:~0,8%" == "Python 3" (
20+
:: If Python 3 is not installed, show the message
21+
ECHO You need to install Python 3 first.
22+
mshta javascript:alert^("You need to install Python 3 first."^);close^(^);
23+
start "" http://www.python.org/downloads/
24+
exit /b
25+
)
26+
27+
:: Run the GUI python script
28+
start "" pythonw ttt_client_gui.py

0 commit comments

Comments
 (0)