download.sh 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/bash
  2. # Download pywin32 for Python 3.5, 64 bit
  3. set -e
  4. if [ ! -f pywin32.exe ]; then
  5. wget -O pywin32.exe https://sourceforge.net/projects/pywin32/files/pywin32/Build%20220/pywin32-220.win-amd64-py3.5.exe
  6. fi
  7. # Comtypes (this is actually pure Python, but it's Windows only,
  8. # so it's easiest to get it like this)
  9. if [ ! -f comtypes.zip ]; then
  10. wget -O comtypes.zip https://github.com/enthought/comtypes/archive/1.1.3.zip
  11. fi
  12. rm -rf pynsist_pkgs
  13. mkdir pynsist_pkgs
  14. # Unpack pywin32
  15. td=$(mktemp -d)
  16. unzip pywin32.exe -d $td || true # Suppress some warning/error unzipping
  17. echo "Copying pywin32 files into pynsist_pkgs/"
  18. cp --recursive $td/PLATLIB/* pynsist_pkgs/
  19. rm -r $td
  20. # Unpack comtypes
  21. td=$(mktemp -d)
  22. unzip comtypes.zip -d $td
  23. # If comtypes.gen exists, it gets stuck trying to write there; if not, it
  24. # falls back to %APPDATA%.
  25. rm -r $td/comtypes-*/comtypes/gen/
  26. echo "Running 2to3 on comtypes"
  27. 2to3 -wn --no-diffs $td/comtypes-*/comtypes/
  28. echo "Copying comtypes files into pynsist_pkgs/"
  29. cp --recursive $td/comtypes-*/comtypes pynsist_pkgs/
  30. rm -r $td