x32/x64-agnostic exe builder

This commit is contained in:
ed 2022-10-30 18:35:27 +00:00
parent cebac523dc
commit b9a504fd3a
4 changed files with 88 additions and 26 deletions

View file

@ -1,13 +1,15 @@
#!/bin/bash
set -e
curl http://192.168.123.1:3923/cpp/scripts/pyinstaller/build.sh |
curl -k https://192.168.123.1:3923/cpp/scripts/pyinstaller/build.sh |
tee build2.sh | cmp build.sh && rm build2.sh || {
echo "new build script; upgrade y/n:"
while true; do read -u1 -n1 -r r; [[ $r =~ [yYnN] ]] && break; done
[[ $r =~ [yY] ]] && mv build{2,}.sh && exec ./build.sh
}
uname -s | grep WOW64 && m=64 || m=
dl() { curl -fkLO "$1"; }
cd ~/Downloads
@ -62,4 +64,4 @@ $APPDATA/python/python37/scripts/pyinstaller \
# ./upx.exe --best --ultra-brute --lzma -k dist/copyparty.exe
curl -fkT dist/copyparty.exe -b cppwd=wark https://192.168.123.1:3923/
curl -fkT dist/copyparty.exe -b cppwd=wark https://192.168.123.1:3923/copyparty$m.exe

View file

@ -0,0 +1,17 @@
d5510a24cb5e15d6d30677335bbc7624c319b371c0513981843dc51d9b3a1e027661096dfcfc540634222bb2634be6db55bf95185b30133cb884f1e47652cf53 altgraph-0.17.3-py2.py3-none-any.whl
91c025f7d94bcdf93df838fab67053165a414fc84e8496f92ecbb910dd55f6b6af5e360bbd051444066880c5a6877e75157bd95e150ead46e5c605930dfc50f2 future-0.18.2.tar.gz
fd8ebead3572a924cd7a256efa67d9a63f49fe30a8890a82d8899c21b7b2411c6761460f334757411c9bf050d8485641e928ccb52455346bf0b5c2d5f89857bc Git-2.38.1-32-bit.exe
c06b3295d1d0b0f0a6f9a6cd0be861b9b643b4a5ea37857f0bd41c45deaf27bb927b71922dab74e633e43d75d04a9bd0d1c4ad875569740b0f2a98dd2bfa5113 importlib_metadata-5.0.0-py3-none-any.whl
18f8070bfb13fe9b7005ed55c9d040465d1e4c0ddcc1e8adca9127070f8db7b32272fbe50622c1d5c937d9be3bb110167b6a55502e232e26d7da881a5342a9e3 pefile-2022.5.30.tar.gz
4e71295da5d1a26c71a0baa8905fdccb522bb16d56bc964db636de68688c5bf703f3b2880cdeea07138789e0eb4506e06f9ccd0da906c89d2cb6d55ad64659ea pip-22.3-py3-none-any.whl
30aa0f3b15d17867f5d8a35e2c86462fa90cfefd3fde5733570a1f86ee75ee1b08550cce9fb34c94d9bb68efeaba26217e99b8b0769bb179c20f61c856057f07 pyinstaller-5.6.1-py3-none-win32.whl
15319328d3ba5aee43e0b830fdf8030213622bc06e5959c0abf579a92061723b100b66325fea0b540de61b90acbbf3985c6ad6eacfc8ccd1c212d282d4e332ca pyinstaller-5.6.1-py3-none-win_amd64.whl
d2534bcf4b8ecc6708d02c6cc6b3c4d8dc3430db5d9a7d350b63239af097a84a325c3f9c3feddf9ebd82ceb8350d9239f79f8c9378fb5164c857f82b0fa25eb8 pyinstaller_hooks_contrib-2022.11-py2.py3-none-any.whl
6bb73cc2db795c59c92f2115727f5c173cacc9465af7710db9ff2f2aec2d73130d0992d0f16dcb3fac222dc15c0916562d0813b2337401022020673a4461df3d python-3.7.9-amd64.exe
500747651c87f59f2436c5ab91207b5b657856e43d10083f3ce27efb196a2580fadd199a4209519b409920c562aaaa7dcbdfb83ed2072a43eaccae6e2d056f31 python-3.7.9.exe
132a5380f33a245f2e744413a0e1090bc42b7356376de5121397cec5976b04b79f7c9ebe28af222c9c7b01461f7d7920810d220e337694727e0d7cd9e91fa667 pywin32_ctypes-0.2.0-py2.py3-none-any.whl
3c5adf0a36516d284a2ede363051edc1bcc9df925c5a8a9fa2e03cab579dd8d847fdad42f7fd5ba35992e08234c97d2dbfec40a9d12eec61c8dc03758f2bd88e typing_extensions-4.4.0-py3-none-any.whl
58d50f3639373e3e2adad3c52328a234a0ca527f8a520731c0f03911074610a9c90dbb9bfa93d1f9cbeab3245ec9e45527128f0295e4b7085b97d288a0b4a2fd upx-4.0.0-win32.zip
68e1b618d988be56aaae4e2eb92bc0093627a00441c1074ebe680c41aa98a6161e52733ad0c59888c643a33fe56884e4f935178b2557fbbdd105e92e0d993df6 windows6.1-kb2533623-x64.msu
479a63e14586ab2f2228208116fc149ed8ee7b1e4ff360754f5bda4bf765c61af2e04b5ef123976623d04df4976b7886e0445647269da81436bd0a7b5671d361 windows6.1-kb2533623-x86.msu
ba91ab0518c61eff13e5612d9e6b532940813f6b56e6ed81ea6c7c4d45acee4d98136a383a25067512b8f75538c67c987cf3944bfa0229e3cb677e2fb81e763e zipp-3.10.0-py3-none-any.whl

View file

@ -0,0 +1,25 @@
# links to download pages for each dep
https://pypi.org/project/altgraph/#files
https://pypi.org/project/future/#files
https://pypi.org/project/importlib-metadata/#files
https://pypi.org/project/pefile/#files
https://pypi.org/project/pip/#files
https://pypi.org/project/pyinstaller/#files
https://pypi.org/project/pyinstaller-hooks-contrib/#files
https://pypi.org/project/pywin32-ctypes/#files
https://pypi.org/project/typing-extensions/#files
https://pypi.org/project/zipp/#files
https://github.com/git-for-windows/git/releases/latest
https://github.com/upx/upx/releases/latest
https://support.microsoft.com/en-us/topic/microsoft-security-advisory-insecure-library-loading-could-allow-remote-code-execution-486ea436-2d47-27e5-6cb9-26ab7230c704
http://www.microsoft.com/download/details.aspx?familyid=c79c41b0-fbfb-4d61-b5d8-cadbe184b9fc
http://www.microsoft.com/download/details.aspx?familyid=146ed6f7-b605-4270-8ec4-b9f0f284bb9e
https://www.microsoft.com/en-us/download/details.aspx?id=26767
https://www.microsoft.com/en-us/download/details.aspx?id=26764
see web.archive.org links below
# direct links to version-frozen deps
https://www.python.org/ftp/python/3.7.9/python-3.7.9-amd64.exe
https://www.python.org/ftp/python/3.7.9/python-3.7.9.exe
https://web.archive.org/web/20200412130846if_/https://download.microsoft.com/download/2/D/7/2D78D0DD-2802-41F5-88D6-DC1D559F206D/Windows6.1-KB2533623-x86.msu
https://web.archive.org/web/20200203192654if_/https://download.microsoft.com/download/f/1/0/f106e158-89a1-41e3-a9b5-32feb2a99a0b/windows6.1-kb2533623-x64.msu

View file

@ -5,37 +5,55 @@ run ./build.sh in git-bash to build + upload the exe
## first-time setup on a stock win7x32sp1 vm:
##
download + install git:
http://192.168.123.1:3923/ro/pyi/Git-2.37.3-32-bit.exe
to obtain the files referenced below, see ./deps.txt
<git-bash>
dl() { curl -fkLOC- "$1"; }
download + install git (32bit OK on 64):
http://192.168.123.1:3923/ro/pyi/Git-2.38.1-32-bit.exe
===[ copy-paste into git-bash ]================================
fns=(
upx-4.0.0-win32.zip
pip-22.3-py3-none-any.whl
altgraph-0.17.3-py2.py3-none-any.whl
future-0.18.2.tar.gz
importlib_metadata-5.0.0-py3-none-any.whl
pefile-2022.5.30.tar.gz
pyinstaller_hooks_contrib-2022.11-py2.py3-none-any.whl
pywin32_ctypes-0.2.0-py2.py3-none-any.whl
typing_extensions-4.4.0-py3-none-any.whl
zipp-3.10.0-py3-none-any.whl
)
uname -s | grep WOW64 && fns+=(
windows6.1-kb2533623-x64.msu
pyinstaller-5.6.1-py3-none-win_amd64.whl
python-3.7.9-amd64.exe
) || fns+=(
windows6.1-kb2533623-x86.msu
pyinstaller-5.6.1-py3-none-win32.whl
python-3.7.9.exe
)
dl() { curl -fkLOC- "$1" && return 0; echo "$1"; return 1; }
cd ~/Downloads &&
dl https://192.168.123.1:3923/ro/pyi/upx-3.96-win32.zip &&
dl https://192.168.123.1:3923/ro/pyi/KB2533623/Windows6.1-KB2533623-x86.msu &&
dl https://192.168.123.1:3923/ro/pyi/python-3.7.9.exe &&
dl https://192.168.123.1:3923/ro/pyi/pip-22.2.2-py3-none-any.whl &&
dl https://192.168.123.1:3923/ro/pyi/altgraph-0.17.2-py2.py3-none-any.whl &&
dl https://192.168.123.1:3923/ro/pyi/future-0.18.2.tar.gz &&
dl https://192.168.123.1:3923/ro/pyi/importlib_metadata-4.12.0-py3-none-any.whl &&
dl https://192.168.123.1:3923/ro/pyi/pefile-2022.5.30.tar.gz &&
dl https://192.168.123.1:3923/ro/pyi/pyinstaller-5.4.1-py3-none-win32.whl &&
dl https://192.168.123.1:3923/ro/pyi/pyinstaller_hooks_contrib-2022.10-py2.py3-none-any.whl &&
dl https://192.168.123.1:3923/ro/pyi/pywin32_ctypes-0.2.0-py2.py3-none-any.whl &&
dl https://192.168.123.1:3923/ro/pyi/typing_extensions-4.3.0-py3-none-any.whl &&
dl https://192.168.123.1:3923/ro/pyi/zipp-3.8.1-py3-none-any.whl &&
echo ok
for fn in "${fns[@]}"; do
dl "https://192.168.123.1:3923/ro/pyi/$fn" || {
echo ERROR; ok=; break
}
done
manually install:
windows6.1-kb2533623-x86.msu + reboot
python-3.7.9.exe
windows6.1-kb2533623 + reboot
python-3.7.9
<git-bash>
===[ copy-paste into git-bash ]================================
cd ~/Downloads &&
unzip -j upx-3.96-win32.zip upx-3.96-win32/upx.exe &&
unzip upx-*-win32.zip &&
mv upx-*/upx.exe . &&
python -m ensurepip &&
python -m pip install --user -U pip-22.2.2-py3-none-any.whl &&
python -m pip install --user -U pyinstaller-5.4.1-py3-none-win32.whl pefile-2022.5.30.tar.gz pywin32_ctypes-0.2.0-py2.py3-none-any.whl pyinstaller_hooks_contrib-2022.10-py2.py3-none-any.whl altgraph-0.17.2-py2.py3-none-any.whl future-0.18.2.tar.gz importlib_metadata-4.12.0-py3-none-any.whl typing_extensions-4.3.0-py3-none-any.whl zipp-3.8.1-py3-none-any.whl &&
python -m pip install --user -U pip-*.whl &&
python -m pip install --user -U pyinstaller-*.whl pefile-*.tar.gz pywin32_ctypes-*.whl pyinstaller_hooks_contrib-*.whl altgraph-*.whl future-*.tar.gz importlib_metadata-*.whl typing_extensions-*.whl zipp-*.whl &&
cd &&
rm -f build.sh &&
curl -fkLO https://192.168.123.1:3923/cpp/scripts/pyinstaller/build.sh &&
echo ok
# python -m pip install --user -U Pillow-9.2.0-cp37-cp37m-win32.whl
# sed -ri 's/, bestopt, /]+bestopt+[/' $APPDATA/Python/Python37/site-packages/pyinstaller/building/utils.py