Skip to content

Commit

Permalink
Detect Windows 11
Browse files Browse the repository at this point in the history
  • Loading branch information
scottjsh committed Apr 8, 2024
1 parent 7c4ecba commit 586ef79
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/os.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import platform
import sys

# This function detects the OS the user is running and if Valorant is officially supported in said platform
# returns ["operating system" (string), "Runs Valorant" (bool)]
def get_os():
# Handles Windows operating systems
if platform.system() == "Windows":
if platform.system() == "Windows" and platform.win32_ver()[0] == '10':
return f"Windows {platform.win32_ver()[0]} {platform.win32_edition()} {platform.win32_ver()[1]}"

elif sys.getwindowsversion().build >= 22000:
return f"Windows 11 {platform.win32_edition()} {platform.win32_ver()[1]}"

# Handles other operating systems, such as Linux or Mac OS
else:
return "Non-Windows operating system"

0 comments on commit 586ef79

Please sign in to comment.