Merge remote-tracking branch 'upstream/dev' into dev
This commit is contained in:
commit
3dbb5431dc
3 changed files with 30 additions and 11 deletions
|
|
@ -11,6 +11,11 @@ BROWSER_PATHS = {
|
||||||
'Opera': 'Opera/launcher.exe',
|
'Opera': 'Opera/launcher.exe',
|
||||||
}
|
}
|
||||||
FAB_TIMEFRAME = 14 # If it's been at least this many days don't prompt for an AV scan
|
FAB_TIMEFRAME = 14 # If it's been at least this many days don't prompt for an AV scan
|
||||||
|
DISABLED_ENTRIES_WINDOWS_11 = {
|
||||||
|
# Group Name: Option Name
|
||||||
|
'Install Software': 'Open Shell',
|
||||||
|
'Configure System': 'Open Shell',
|
||||||
|
}
|
||||||
LIBREOFFICE_XCU_DATA = '''<?xml version="1.0" encoding="UTF-8"?>
|
LIBREOFFICE_XCU_DATA = '''<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<oor:items xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
<oor:items xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
<item oor:path="/org.openoffice.Setup/Office/Factories/org.openoffice.Setup:Factory['com.sun.star.presentation.PresentationDocument']"><prop oor:name="ooSetupFactoryDefaultFilter" oor:op="fuse"><value>Impress MS PowerPoint 2007 XML</value></prop></item>
|
<item oor:path="/org.openoffice.Setup/Office/Factories/org.openoffice.Setup:Factory['com.sun.star.presentation.PresentationDocument']"><prop oor:name="ooSetupFactoryDefaultFilter" oor:op="fuse"><value>Impress MS PowerPoint 2007 XML</value></prop></item>
|
||||||
|
|
|
||||||
|
|
@ -68,14 +68,24 @@ KNOWN_HIVE_NAMES = {
|
||||||
winreg.HKEY_LOCAL_MACHINE: 'HKLM',
|
winreg.HKEY_LOCAL_MACHINE: 'HKLM',
|
||||||
winreg.HKEY_USERS: 'HKU',
|
winreg.HKEY_USERS: 'HKU',
|
||||||
}
|
}
|
||||||
OS_VERSION = platform.win32_ver()[0]
|
|
||||||
OS_VERSION = 8.1 if OS_VERSION == '8.1' else int(OS_VERSION)
|
|
||||||
RAM_OK = 5.5 * 1024**3 # ~6 GiB assuming a bit of shared memory
|
RAM_OK = 5.5 * 1024**3 # ~6 GiB assuming a bit of shared memory
|
||||||
RAM_WARNING = 3.5 * 1024**3 # ~4 GiB assuming a bit of shared memory
|
RAM_WARNING = 3.5 * 1024**3 # ~4 GiB assuming a bit of shared memory
|
||||||
REG_MSISERVER = r'HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot\Network\MSIServer'
|
REG_MSISERVER = r'HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot\Network\MSIServer'
|
||||||
SLMGR = pathlib.Path(f'{os.environ.get("SYSTEMROOT")}/System32/slmgr.vbs')
|
SLMGR = pathlib.Path(f'{os.environ.get("SYSTEMROOT")}/System32/slmgr.vbs')
|
||||||
SYSTEMDRIVE = os.environ.get('SYSTEMDRIVE')
|
SYSTEMDRIVE = os.environ.get('SYSTEMDRIVE')
|
||||||
|
|
||||||
|
# STATIC OS VARIABLES
|
||||||
|
WIN32_VER = platform.win32_ver()
|
||||||
|
OS_BUILD_VERSION_FULL = WIN32_VER[1]
|
||||||
|
OS_BUILD_VERSION = int(OS_BUILD_VERSION_FULL.split('.')[2])
|
||||||
|
PLATFORM_VER = WIN32_VER[0]
|
||||||
|
if PLATFORM_VER == '8.1':
|
||||||
|
OS_VERSION = 8.1
|
||||||
|
elif OS_BUILD_VERSION >= 22000:
|
||||||
|
OS_VERSION = 11
|
||||||
|
else:
|
||||||
|
OS_VERSION = int(PLATFORM_VER)
|
||||||
|
|
||||||
|
|
||||||
# Activation Functions
|
# Activation Functions
|
||||||
def activate_with_bios():
|
def activate_with_bios():
|
||||||
|
|
@ -267,21 +277,19 @@ def get_os_name(as_list=False, check=True):
|
||||||
outdated or unsupported.
|
outdated or unsupported.
|
||||||
"""
|
"""
|
||||||
key = r'SOFTWARE\Microsoft\Windows NT\CurrentVersion'
|
key = r'SOFTWARE\Microsoft\Windows NT\CurrentVersion'
|
||||||
build_version = int(reg_read_value("HKLM", key, "CurrentBuild"))
|
details = WINDOWS_BUILDS.get(OS_BUILD_VERSION_FULL, f'Build {OS_BUILD_VERSION}')
|
||||||
build_version_full = platform.win32_ver()[1]
|
|
||||||
details = WINDOWS_BUILDS.get(build_version_full, f'Build {build_version}')
|
|
||||||
display_name = (
|
display_name = (
|
||||||
f'{reg_read_value("HKLM", key, "ProductName")} {ARCH}-bit {details}'
|
f'{reg_read_value("HKLM", key, "ProductName")} {ARCH}-bit {details}'
|
||||||
)
|
)
|
||||||
if build_version >= 22000:
|
if OS_BUILD_VERSION >= 22000:
|
||||||
display_name = display_name.replace('Windows 10', 'Windows 11')
|
display_name = display_name.replace('Windows 10', 'Windows 11')
|
||||||
|
|
||||||
# Check for support issues
|
# Check for support issues
|
||||||
if check:
|
if check:
|
||||||
if build_version in OUTDATED_BUILD_NUMBERS:
|
if OS_BUILD_VERSION in OUTDATED_BUILD_NUMBERS:
|
||||||
raise GenericWarning(f'{display_name} (outdated)')
|
raise GenericWarning(f'{display_name} (outdated)')
|
||||||
|
|
||||||
if build_version < OLDEST_SUPPORTED_BUILD:
|
if OS_BUILD_VERSION < OLDEST_SUPPORTED_BUILD:
|
||||||
raise GenericError(f'{display_name} (unsupported)')
|
raise GenericError(f'{display_name} (unsupported)')
|
||||||
|
|
||||||
# Done
|
# Done
|
||||||
|
|
|
||||||
|
|
@ -14,13 +14,14 @@ import webbrowser
|
||||||
from wk.cfg.main import KIT_NAME_FULL
|
from wk.cfg.main import KIT_NAME_FULL
|
||||||
from wk.cfg.setup import (
|
from wk.cfg.setup import (
|
||||||
BROWSER_PATHS,
|
BROWSER_PATHS,
|
||||||
|
DISABLED_ENTRIES_WINDOWS_11,
|
||||||
FAB_TIMEFRAME,
|
FAB_TIMEFRAME,
|
||||||
REG_ESET_NOD32_SETTINGS,
|
|
||||||
LIBREOFFICE_XCU_DATA,
|
LIBREOFFICE_XCU_DATA,
|
||||||
REG_CHROME_UBLOCK_ORIGIN,
|
REG_CHROME_UBLOCK_ORIGIN,
|
||||||
REG_WINDOWS_EXPLORER,
|
REG_ESET_NOD32_SETTINGS,
|
||||||
REG_OPEN_SHELL_SETTINGS,
|
|
||||||
REG_OPEN_SHELL_LOW_POWER_IDLE,
|
REG_OPEN_SHELL_LOW_POWER_IDLE,
|
||||||
|
REG_OPEN_SHELL_SETTINGS,
|
||||||
|
REG_WINDOWS_EXPLORER,
|
||||||
UBLOCK_ORIGIN_URLS,
|
UBLOCK_ORIGIN_URLS,
|
||||||
)
|
)
|
||||||
from wk.exe import kill_procs, run_program, popen_program
|
from wk.exe import kill_procs, run_program, popen_program
|
||||||
|
|
@ -167,6 +168,11 @@ def build_menus(base_menus, title, presets):
|
||||||
MENU_PRESETS.add_action('Quit')
|
MENU_PRESETS.add_action('Quit')
|
||||||
MENU_PRESETS.update()
|
MENU_PRESETS.update()
|
||||||
|
|
||||||
|
# Disable entries incompatible with Windows 11
|
||||||
|
if OS_VERSION == 11:
|
||||||
|
for group_name, entry_name in DISABLED_ENTRIES_WINDOWS_11.items():
|
||||||
|
menus[group_name].options[entry_name]['Disabled'] = True
|
||||||
|
|
||||||
# Done
|
# Done
|
||||||
return menus
|
return menus
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue