diff --git a/scripts/install.ps1 b/scripts/install.ps1 index 284633e1..eda5612f 100644 --- a/scripts/install.ps1 +++ b/scripts/install.ps1 @@ -6,12 +6,19 @@ pip install -r "$PSScriptRoot/requirements$dev.txt" --upgrade # Patch libraries so we don't have to install from git -# Prevent pyautogui from setting Process DPI Awareness, which Qt tries to do then throws warnings about it. +# Prevent pyautogui and pywinctl from setting Process DPI Awareness, which Qt tries to do then throws warnings about it. # The unittest workaround significantly increases build time, boot time and build size with PyInstaller. # https://github.com/asweigart/pyautogui/issues/663#issuecomment-1296719464 -$pyautoguiPath = python -c 'import pyautogui as _; print(_.__path__[0])' -(Get-Content "$pyautoguiPath/_pyautogui_win.py").replace('ctypes.windll.user32.SetProcessDPIAware()', 'pass') | - Set-Content "$pyautoguiPath/_pyautogui_win.py" +$libPath = python -c 'import pyautogui as _; print(_.__path__[0])' +(Get-Content "$libPath/_pyautogui_win.py").replace('ctypes.windll.user32.SetProcessDPIAware()', 'pass') | + Set-Content "$libPath/_pyautogui_win.py" +$libPath = python -c 'import pymonctl as _; print(_.__path__[0])' +(Get-Content "$libPath/_pymonctl_win.py").replace('ctypes.windll.shcore.SetProcessDpiAwareness(2)', 'pass') | + Set-Content "$libPath/_pymonctl_win.py" +$libPath = python -c 'import pywinbox as _; print(_.__path__[0])' +(Get-Content "$libPath/_pywinbox_win.py").replace('ctypes.windll.shcore.SetProcessDpiAwareness(2)', 'pass') | + Set-Content "$libPath/_pywinbox_win.py" +# Uninstall optional dependencies that PyInstaller picks up python -m pip uninstall pyscreeze mouseinfo pyperclip -y