From 68d8e292cca960b4622f2f0fa4d0f9f11966f23b Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sat, 25 Sep 2021 20:37:39 -0600 Subject: [PATCH] Restrict OpenShell installs to Windows 10 --- scripts/wk/setup/win.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/wk/setup/win.py b/scripts/wk/setup/win.py index 0747cf8d..c5311ad0 100644 --- a/scripts/wk/setup/win.py +++ b/scripts/wk/setup/win.py @@ -96,7 +96,9 @@ LIBREOFFICE_XCU_DATA = ''' ''' MENU_PRESETS = Menu() -OS_VERSION = float(platform.win32_ver()[0]) +OS_VERSION = -1 +if platform.system() == 'Windows': + OS_VERSION = float(platform.win32_ver()[0]) PROGRAMFILES_32 = os.environ.get( 'PROGRAMFILES(X86)', os.environ.get( 'PROGRAMFILES', r'C:\Program Files (x86)', @@ -579,6 +581,12 @@ def install_libreoffice( def install_open_shell(): """Install Open Shell (just the Start Menu).""" installer = get_tool_path('OpenShell', 'OpenShell', check=False) + + # Bail early + if OS_VERSION != 10: + raise GenericWarning('Unsupported OS') + + # Install OpenShell download_tool('OpenShell', 'OpenShell') download_tool('OpenShell', 'Fluent-Metro', suffix='zip') cmd = [installer, '/qn', 'ADDLOCAL=StartMenu']