Merge #153: Include Windows UCRT in Windows build

f109365 Install Windoew Universal C++ Runtime from Windows 10 SDK in Windows build (Andrew Chow)

Pull request description:

  Older versions of Windows needs to have the Windows Universal C++ Runtime packaged with the binary to work. This PR adds to the `build_wine.sh` build script to download the DLLs for the UCRT and package them with the Windows build.

  Fixes #150

ACKs for commit f10936:

Tree-SHA512: 7b9b98cdc4e329cf228dc42a09aa434f984c4db90b09b2ca6cb3dd7d8c1957cd717f761e8a1eeadbd8662f74452141a4df583ab40d939c57e20f0b0f83625b47
This commit is contained in:
Andrew Chow 2019-04-21 18:07:46 -04:00
commit b5d74ec24c
No known key found for this signature in database
GPG Key ID: 17565732E08E5E41

View File

@ -12,6 +12,10 @@ PYTHON="wine $PYHOME/python.exe -OO -B"
LIBUSB_URL=https://github.com/libusb/libusb/releases/download/v1.0.22/libusb-1.0.22.7z
LIBUSB_HASH="671f1a420757b4480e7fadc8313d6fb3cbb75ca00934c417c1efa6e77fb8779b"
WINDOWS_SDK_URL=http://go.microsoft.com/fwlink/p/?LinkID=2033686
WINDOWS_SDK_HASH="016981259708e1afcab666c7c1ff44d1c4d63b5e778af8bc41b4f6db3d27961a"
WINDOWS_SDK_VERSION=10.0.17763.0
wine 'wineboot'
# Install Python
@ -36,6 +40,15 @@ echo "$LIBUSB_HASH libusb.7z" | sha256sum -c
cp libusb/MS64/dll/libusb-1.0.dll ~/.wine/drive_c/python3/
rm -r libusb*
# Get the Windows SDK
pushd `mktemp -d`
wget -O sdk.iso "$WINDOWS_SDK_URL"
echo "$WINDOWS_SDK_HASH sdk.iso" | sha256sum -c
7z e sdk.iso
wine msiexec /i "Universal CRT Redistributable-x86_en-us.msi"
cp ~/.wine/drive_c/Program\ Files\ \(x86\)/Windows\ Kits/10/Redist/${WINDOWS_SDK_VERSION}/ucrt/DLLs/x64/*.dll ~/.wine/drive_c/windows/system32/
popd
# Update pip
$PYTHON -m pip install -U pip
@ -46,9 +59,12 @@ $PYTHON -m pip install poetry
lib_dir=~/.wine/drive_c/python3/Lib
TZ=UTC find ${lib_dir} -name '*.py' -type f -execdir touch -t "201901010000.00" '{}' \;
# Do the build
# Install python dependencies
POETRY="wine $PYHOME/Scripts/poetry.exe"
sleep 5 # For some reason, pausing for a few seconds makes the next step work
$POETRY install -E windist
# Do the build
export PYTHONHASHSEED=42
$POETRY run pyinstaller hwi.spec
unset PYTHONHASHSEED