run ./build.sh in git-bash to build + upload the exe ## ============================================================ ## first-time setup on a stock win7x32sp1 and/or win10x64 vm: ## to obtain the files referenced below, see ./deps.txt download + install git (32bit OK on 64): http://192.168.123.1:3923/ro/pyi/Git-2.39.1-32-bit.exe ===[ copy-paste into git-bash ]================================ uname -s | grep NT-10 && w10=1 || { w7=1; uname -s | grep WOW64 && w7x64=1 || w7x32=1 } fns=( altgraph-0.17.4-py2.py3-none-any.whl pefile-2023.2.7-py3-none-any.whl pyinstaller_hooks_contrib-2023.10-py2.py3-none-any.whl pywin32_ctypes-0.2.2-py3-none-any.whl setuptools-68.2.2-py3-none-any.whl upx-4.1.0-win32.zip ) [ $w10 ] && fns+=( pyinstaller-6.1.0-py3-none-win_amd64.whl Jinja2-3.1.2-py3-none-any.whl MarkupSafe-2.1.3-cp311-cp311-win_amd64.whl mutagen-1.47.0-py3-none-any.whl packaging-23.2-py3-none-any.whl Pillow-10.1.0-cp311-cp311-win_amd64.whl python-3.11.7-amd64.exe ) [ $w7 ] && fns+=( pyinstaller-5.13.2-py3-none-win32.whl certifi-2023.11.17-py3-none-any.whl chardet-5.1.0-py3-none-any.whl idna-3.4-py3-none-any.whl requests-2.28.2-py3-none-any.whl urllib3-1.26.14-py2.py3-none-any.whl ) [ $w7 ] && fns+=( future-0.18.2.tar.gz importlib_metadata-5.0.0-py3-none-any.whl pip-23.2.1-py3-none-any.whl typing_extensions-4.4.0-py3-none-any.whl zipp-3.10.0-py3-none-any.whl ) [ $w7x64 ] && fns+=( windows6.1-kb2533623-x64.msu python-3.7.9-amd64.exe ) [ $w7x32 ] && fns+=( windows6.1-kb2533623-x86.msu pyinstaller-5.13.2-py3-none-win32.whl python-3.7.9.exe ) dl() { curl -fkLOC- "$1" && return 0; echo "$1"; return 1; } cd ~/Downloads && 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 + reboot python-3.7.9 ===[ copy-paste into git-bash ]================================ uname -s | grep NT-10 && w10=1 || w7=1 [ $w7 ] && pyv=37 || pyv=311 appd=$(cygpath.exe "$APPDATA") cd ~/Downloads && yes | unzip upx-*-win32.zip && mv upx-*/upx.exe . && python -m ensurepip && { [ $w10 ] || python -m pip install --user -U pip-*.whl; } && { [ $w7 ] || python -m pip install --user -U {packaging,setuptools,mutagen,Pillow,Jinja2,MarkupSafe}-*.whl; } && { [ $w10 ] || python -m pip install --user -U {requests,urllib3,charset_normalizer,certifi,idna}-*.whl; } && { [ $w10 ] || python -m pip install --user -U future-*.tar.gz importlib_metadata-*.whl typing_extensions-*.whl zipp-*.whl; } && python -m pip install --user -U pyinstaller-*.whl pefile-*.whl pywin32_ctypes-*.whl pyinstaller_hooks_contrib-*.whl altgraph-*.whl && sed -ri 's/--lzma/--best/' $appd/Python/Python$pyv/site-packages/pyinstaller/building/utils.py && curl -fkLO https://192.168.123.1:3923/cpp/scripts/uncomment.py && python uncomment.py 1 $(for d in $appd/Python/Python$pyv/site-packages/{requests,urllib3,charset_normalizer,certifi,idna,mutagen,PIL,jinja2,markupsafe}; do find $d -name \*.py; done) && cd && rm -f build.sh && curl -fkLO https://192.168.123.1:3923/cpp/scripts/pyinstaller/build.sh && { [ $w10 ] || curl -fkLO https://192.168.123.1:3923/cpp/scripts/pyinstaller/up2k.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 # sed -ri 's/(^\s+bestopt = ).*/\1["--best","--lzma","--ultra-brute"]/' $APPDATA/Python/Python37/site-packages/pyinstaller/building/utils.py ## ============================================================ ## notes ## size t-unpack virustotal cmnt 8059k 0m0.375s 5/70 generic-only, sandbox-ok no-upx 7095k 0m0.563s 4/70 generic-only, sandbox-ok standard-upx 6958k 0m0.578s 7/70 generic-only, sandbox-ok upx+upx use python 3.7 since 3.8 onwards requires KB2533623 on target generate loader.rc template: %appdata%\python\python37\scripts\pyi-grab_version C:\Users\ed\AppData\Local\Programs\Python\Python37\python.exe