install_windows_extras.py 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #
  2. # Copyright (c) Contributors to the Open 3D Engine Project.
  3. # For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. #
  5. # SPDX-License-Identifier: Apache-2.0 OR MIT
  6. #
  7. #
  8. import os
  9. import urllib.request
  10. import zipfile
  11. # On Windows, we also need to install jom and ICU, so we will download them
  12. # and install them locally just for this build
  13. dependencies = {
  14. "jom": "http://download.qt.io/official_releases/jom/jom.zip",
  15. "icu": "https://github.com/unicode-org/icu/releases/download/release-65-1/icu4c-65_1-Win64-MSVC2017.zip"
  16. }
  17. for name in dependencies:
  18. print(f"Attempting to install {name}")
  19. installer_link = dependencies[name]
  20. file_name = os.path.basename(installer_link)
  21. # Download the zip (if we haven't already, so that this script can be run iteratively)
  22. if not os.path.exists(file_name):
  23. print(f"Downloading {name} from {installer_link}")
  24. urllib.request.urlretrieve(installer_link, file_name)
  25. print(f"Download of {name} complete => {os.path.abspath(file_name)}")
  26. # We will unzip the package into the local temp directory
  27. install_dir = os.path.abspath(os.path.join('temp', name))
  28. print(f"Installing {name} to {install_dir}")
  29. with zipfile.ZipFile(file_name, 'r') as dep_zip:
  30. dep_zip.extractall(install_dir)
  31. print(f"Successfully installed {name}")