diff --git a/copyparty/__init__.py b/copyparty/__init__.py index aeda2bb7..c03f5519 100644 --- a/copyparty/__init__.py +++ b/copyparty/__init__.py @@ -34,6 +34,8 @@ ANYWIN = WINDOWS or sys.platform in ["msys", "cygwin"] MACOS = platform.system() == "Darwin" +EXE = bool(getattr(sys, "frozen", False)) + try: CORES = len(os.sched_getaffinity(0)) except: diff --git a/copyparty/__main__.py b/copyparty/__main__.py index 2f91986a..4491e5d4 100755 --- a/copyparty/__main__.py +++ b/copyparty/__main__.py @@ -23,7 +23,7 @@ import traceback import uuid from textwrap import dedent -from .__init__ import ANYWIN, CORES, PY2, VT100, WINDOWS, E, EnvParams, unicode +from .__init__ import ANYWIN, CORES, EXE, PY2, VT100, WINDOWS, E, EnvParams, unicode from .__version__ import CODENAME, S_BUILD_DT, S_VERSION from .authsrv import expand_config_file, re_vol, split_cfg_ln, upgrade_cfg_fmt from .cfg import flagcats, onedash @@ -36,7 +36,6 @@ from .util import ( UNPLICATIONS, align_tab, ansi_re, - is_exe, min_ex, py_desc, pybin, @@ -1067,7 +1066,7 @@ def main(argv: Optional[list[str]] = None) -> None: showlic() sys.exit(0) - if is_exe: + if EXE: print("pybin: {}\n".format(pybin), end="") ensure_locale() diff --git a/copyparty/httpsrv.py b/copyparty/httpsrv.py index d80c92f5..239e2ea7 100644 --- a/copyparty/httpsrv.py +++ b/copyparty/httpsrv.py @@ -11,9 +11,14 @@ import time import queue +from .__init__ import ANYWIN, EXE, MACOS, TYPE_CHECKING, EnvParams + try: import jinja2 except ImportError: + if EXE: + raise + print( """\033[1;31m you do not have jinja2 installed,\033[33m @@ -28,7 +33,6 @@ except ImportError: ) sys.exit(1) -from .__init__ import ANYWIN, MACOS, TYPE_CHECKING, EnvParams from .bos import bos from .httpconn import HttpConn from .util import ( diff --git a/copyparty/mtag.py b/copyparty/mtag.py index 7f4a5d1b..4a025b86 100644 --- a/copyparty/mtag.py +++ b/copyparty/mtag.py @@ -8,13 +8,12 @@ import shutil import subprocess as sp import sys -from .__init__ import PY2, WINDOWS, E, unicode +from .__init__ import EXE, PY2, WINDOWS, E, unicode from .bos import bos from .util import ( FFMPEG_URL, REKOBO_LKEY, fsenc, - is_exe, min_ex, pybin, retchk, @@ -270,7 +269,9 @@ class MTag(object): self.args = args self.usable = True self.prefer_mt = not args.no_mtag_ff - self.backend = "ffprobe" if args.no_mutagen else "mutagen" + self.backend = ( + "ffprobe" if args.no_mutagen or (HAVE_FFPROBE and EXE) else "mutagen" + ) self.can_ffprobe = HAVE_FFPROBE and not args.no_mtag_ff mappings = args.mtm or_ffprobe = " or FFprobe" @@ -296,7 +297,7 @@ class MTag(object): self.log(msg, c=3) if not self.usable: - if is_exe: + if EXE: t = "copyparty.exe cannot use mutagen; need ffprobe.exe to read media tags: " self.log(t + FFMPEG_URL) return @@ -472,7 +473,10 @@ class MTag(object): self.log("mutagen: {}\033[0m".format(" ".join(zl)), "90") if not md.info.length and not md.info.codec: raise Exception() - except: + except Exception as ex: + if self.args.mtag_v: + self.log("mutagen-err [{}] @ [{}]".format(ex, abspath), "90") + return self.get_ffprobe(abspath) if self.can_ffprobe else {} sz = bos.path.getsize(abspath) @@ -535,7 +539,7 @@ class MTag(object): env = os.environ.copy() try: - if is_exe: + if EXE: raise Exception() pypath = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) @@ -543,7 +547,7 @@ class MTag(object): pypath = str(os.pathsep.join(zsl)) env["PYTHONPATH"] = pypath except: - if not E.ox and not is_exe: + if not E.ox and not EXE: raise ret: dict[str, Any] = {} diff --git a/copyparty/smbd.py b/copyparty/smbd.py index bad6e540..94e8529b 100644 --- a/copyparty/smbd.py +++ b/copyparty/smbd.py @@ -9,10 +9,10 @@ import sys import time from types import SimpleNamespace -from .__init__ import ANYWIN, TYPE_CHECKING +from .__init__ import ANYWIN, EXE, TYPE_CHECKING from .authsrv import LEELOO_DALLAS, VFS from .bos import bos -from .util import Daemon, is_exe, min_ex, pybin +from .util import Daemon, min_ex, pybin if True: # pylint: disable=using-constant-test from typing import Any @@ -42,7 +42,7 @@ class SMB(object): from impacket import smbserver from impacket.ntlm import compute_lmhash, compute_nthash except ImportError: - if is_exe: + if EXE: print("copyparty.exe cannot do SMB") sys.exit(1) diff --git a/copyparty/svchub.py b/copyparty/svchub.py index 139ac12e..70b6f166 100644 --- a/copyparty/svchub.py +++ b/copyparty/svchub.py @@ -28,7 +28,7 @@ if True: # pylint: disable=using-constant-test import typing from typing import Any, Optional, Union -from .__init__ import ANYWIN, MACOS, TYPE_CHECKING, VT100, EnvParams, unicode +from .__init__ import ANYWIN, EXE, MACOS, TYPE_CHECKING, VT100, EnvParams, unicode from .authsrv import AuthSrv from .mtag import HAVE_FFMPEG, HAVE_FFPROBE from .tcpsrv import TcpSrv @@ -43,7 +43,6 @@ from .util import ( HMaccas, alltrace, ansi_re, - is_exe, min_ex, mp, pybin, @@ -212,7 +211,7 @@ class SvcHub(object): want_ff = True msg = "need either Pillow, pyvips, or FFmpeg to create thumbnails; for example:\n{0}{1} -m pip install --user Pillow\n{0}{1} -m pip install --user pyvips\n{0}apt install ffmpeg" msg = msg.format(" " * 37, os.path.basename(pybin)) - if is_exe: + if EXE: msg = "copyparty.exe cannot use Pillow or pyvips; need ffprobe.exe and ffmpeg.exe to create thumbnails" self.log("thumb", msg, c=3) diff --git a/copyparty/th_srv.py b/copyparty/th_srv.py index 4b828173..b579c559 100644 --- a/copyparty/th_srv.py +++ b/copyparty/th_srv.py @@ -135,7 +135,7 @@ class ThumbSrv(object): msg = "cannot create audio/video thumbnails because some of the required programs are not available: " msg += ", ".join(missing) self.log(msg, c=3) - if ANYWIN and not self.args.no_acode: + if ANYWIN and self.args.no_acode: self.log("download FFmpeg to fix it:\033[0m " + FFMPEG_URL, 3) if self.args.th_clean: diff --git a/copyparty/util.py b/copyparty/util.py index 01ad4e6a..f048bc56 100644 --- a/copyparty/util.py +++ b/copyparty/util.py @@ -31,7 +31,7 @@ from email.utils import formatdate from ipaddress import IPv4Address, IPv4Network, IPv6Address, IPv6Network from queue import Queue -from .__init__ import ANYWIN, MACOS, PY2, TYPE_CHECKING, VT100, WINDOWS +from .__init__ import ANYWIN, EXE, MACOS, PY2, TYPE_CHECKING, VT100, WINDOWS from .__version__ import S_BUILD_DT, S_VERSION from .stolen import surrogateescape @@ -294,8 +294,7 @@ REKOBO_LKEY = {k.lower(): v for k, v in REKOBO_KEY.items()} pybin = sys.executable or "" -is_exe = bool(getattr(sys, "frozen", False)) -if is_exe: +if EXE: pybin = "" for p in "python3 python".split(): try: @@ -2555,7 +2554,7 @@ def _runhook( env = os.environ.copy() try: - if is_exe: + if EXE: raise Exception() pypath = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) @@ -2563,7 +2562,7 @@ def _runhook( pypath = str(os.pathsep.join(zsl)) env["PYTHONPATH"] = pypath except: - if not is_exe: + if not EXE: raise ka = { diff --git a/scripts/make-sfx.sh b/scripts/make-sfx.sh index c1aaf440..807e90c3 100755 --- a/scripts/make-sfx.sh +++ b/scripts/make-sfx.sh @@ -184,9 +184,9 @@ necho() { mv {markupsafe,jinja2} j2/ necho collecting pyftpdlib - f="../build/pyftpdlib-1.5.6.tar.gz" + f="../build/pyftpdlib-1.5.7.tar.gz" [ -e "$f" ] || - (url=https://github.com/giampaolo/pyftpdlib/archive/refs/tags/release-1.5.6.tar.gz; + (url=https://github.com/giampaolo/pyftpdlib/archive/refs/tags/release-1.5.7.tar.gz; wget -O$f "$url" || curl -L "$url" >$f) tar -zxf $f diff --git a/scripts/pyinstaller/build.sh b/scripts/pyinstaller/build.sh index 8359acc2..071b923f 100644 --- a/scripts/pyinstaller/build.sh +++ b/scripts/pyinstaller/build.sh @@ -10,6 +10,11 @@ tee build2.sh | cmp build.sh && rm build2.sh || { } uname -s | grep WOW64 && m=64 || m= +uname -s | grep NT-10 && w10=1 || w7=1 +[ $w7 ] && pyv=37 || pyv=311 + +appd=$(cygpath.exe "$APPDATA") +spkgs=$appd/Python/Python$pyv/site-packages dl() { curl -fkLO "$1"; } @@ -25,14 +30,23 @@ python copyparty-sfx.py --version rm -rf mods; mkdir mods cp -pR $TEMP/pe-copyparty/copyparty/ $TEMP/pe-copyparty/{ftp,j2}/* mods/ +[ $w10 ] && rm -rf mods/{jinja2,markupsafe} af() { awk "$1" <$2 >tf; mv tf "$2"; } rm -rf mods/magic/ -sed -ri /pickle/d mods/jinja2/_compat.py -sed -ri '/(bccache|PackageLoader)/d' mods/jinja2/__init__.py -af '/^class/{s=0}/^class PackageLoader/{s=1}!s' mods/jinja2/loaders.py +[ $w7 ] && { + sed -ri /pickle/d mods/jinja2/_compat.py + sed -ri '/(bccache|PackageLoader)/d' mods/jinja2/__init__.py + af '/^class/{s=0}/^class PackageLoader/{s=1}!s' mods/jinja2/loaders.py +} +[ $w10 ] && { + sed -ri '/(bccache|PackageLoader)/d' $spkgs/jinja2/__init__.py + for f in nodes async_utils; do + sed -ri 's/\binspect\b/os/' $spkgs/jinja2/$f.py + done +} sed -ri /fork_process/d mods/pyftpdlib/servers.py af '/^class _Base/{s=1}!s' mods/pyftpdlib/authorizers.py @@ -59,7 +73,12 @@ excl=( urllib.robotparser zipfile ) -false || excl+=( +[ $w10 ] && excl+=( + PIL.ImageQt + PIL.ImageShow + PIL.ImageTk + PIL.ImageWin +) || excl+=( PIL PIL.ExifTags PIL.Image @@ -68,7 +87,7 @@ false || excl+=( ) excl=( "${excl[@]/#/--exclude-module }" ) -$APPDATA/python/python37/scripts/pyinstaller \ +$APPDATA/python/python$pyv/scripts/pyinstaller \ -y --clean -p mods --upx-dir=. \ ${excl[*]} \ --version-file loader.rc2 -i loader.ico -n copyparty -c -F loader.py \ diff --git a/scripts/pyinstaller/deps.sha512 b/scripts/pyinstaller/deps.sha512 index f9e7fb41..11248a60 100644 --- a/scripts/pyinstaller/deps.sha512 +++ b/scripts/pyinstaller/deps.sha512 @@ -1,17 +1,24 @@ 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 +eda6c38fc4d813fee897e969ff9ecc5acc613df755ae63df0392217bbd67408b5c1f6c676f2bf5497b772a3eb4e1a360e1245e1c16ee83f0af555f1ab82c3977 Git-2.39.1-32-bit.exe +17ce52ba50692a9d964f57a23ac163fb74c77fdeb2ca988a6d439ae1fe91955ff43730c073af97a7b3223093ffea3479a996b9b50ee7fba0869247a56f74baa6 pefile-2023.2.7-py3-none-any.whl +85a041cc95cf493f5e2ebc2ca406d2718735e43951988810dc448d29e9ee0bcdb1ca19e0c22243441f45633969af8027469f29f6288f6830c724a3fa38886e5c pyinstaller-5.8.0-py3-none-win32.whl +adf0d23a98da38056de25e07e68921739173efc70fb9bf3f68d8c7c3d0d092e09efa69d35c0c9ecc990bc3c5fa62038227ef480ed06ddfaf05353f6e468f5dca pyinstaller-5.8.0-py3-none-win_amd64.whl +01d7f8125966ed30389a879ba69d2c1fd3212bafad3fb485317580bcb9f489e8b901c4d325f6cb8a52986838ba6d44d3852e62b27c1f1d5a576899821cc0ae02 pyinstaller_hooks_contrib-2023.0-py2.py3-none-any.whl 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 +4b6e9ae967a769fe32be8cf0bc0d5a213b138d1e0344e97656d08a3d15578d81c06c45b334c872009db2db8f39db0c77c94ff6c35168d5e13801917667c08678 upx-4.0.2-win32.zip +# win7 +91c025f7d94bcdf93df838fab67053165a414fc84e8496f92ecbb910dd55f6b6af5e360bbd051444066880c5a6877e75157bd95e150ead46e5c605930dfc50f2 future-0.18.2.tar.gz +c06b3295d1d0b0f0a6f9a6cd0be861b9b643b4a5ea37857f0bd41c45deaf27bb927b71922dab74e633e43d75d04a9bd0d1c4ad875569740b0f2a98dd2bfa5113 importlib_metadata-5.0.0-py3-none-any.whl +4e71295da5d1a26c71a0baa8905fdccb522bb16d56bc964db636de68688c5bf703f3b2880cdeea07138789e0eb4506e06f9ccd0da906c89d2cb6d55ad64659ea pip-22.3-py3-none-any.whl +6bb73cc2db795c59c92f2115727f5c173cacc9465af7710db9ff2f2aec2d73130d0992d0f16dcb3fac222dc15c0916562d0813b2337401022020673a4461df3d python-3.7.9-amd64.exe +500747651c87f59f2436c5ab91207b5b657856e43d10083f3ce27efb196a2580fadd199a4209519b409920c562aaaa7dcbdfb83ed2072a43eaccae6e2d056f31 python-3.7.9.exe 68e1b618d988be56aaae4e2eb92bc0093627a00441c1074ebe680c41aa98a6161e52733ad0c59888c643a33fe56884e4f935178b2557fbbdd105e92e0d993df6 windows6.1-kb2533623-x64.msu 479a63e14586ab2f2228208116fc149ed8ee7b1e4ff360754f5bda4bf765c61af2e04b5ef123976623d04df4976b7886e0445647269da81436bd0a7b5671d361 windows6.1-kb2533623-x86.msu ba91ab0518c61eff13e5612d9e6b532940813f6b56e6ed81ea6c7c4d45acee4d98136a383a25067512b8f75538c67c987cf3944bfa0229e3cb677e2fb81e763e zipp-3.10.0-py3-none-any.whl +# win10 +00558cca2e0ac813d404252f6e5aeacb50546822ecb5d0570228b8ddd29d94e059fbeb6b90393dee5abcddaca1370aca784dc9b095cbb74e980b3c024767fb24 Jinja2-3.1.2-py3-none-any.whl +b1db6f5a79fc15391547643e5973cf5946c0acfa6febb68bc90fc3f66369681100cc100f32dd04256dcefa510e7864c718515a436a4af3a10fe205c413c7e693 MarkupSafe-2.1.2-cp311-cp311-win_amd64.whl +4a20aeb52d4fde6aabcba05ee261595eeb5482c72ee27332690f34dd6e7a49c0b3ba3813202ac15c9d21e29f1cd803f2e79ccc1c45ec314fcd0a937016bcbc56 mutagen-1.46.0-py3-none-any.whl +ea152624499966615ee74f2aefed27da528785e1215f46d61e79c5290bb8105fd98e9948938efbca9cd19e2f1dd48c9e712b4f30a4148a0ed5d1ff2dff77106e Pillow-9.4.0-cp311-cp311-win_amd64.whl +2b04b196f1115f42375e623a35edeb71565dfd090416b22510ec0270fefe86f7d397a98aabbe9ebfe3f6a355fe25c487a4875d4252027d0a61ccb64cacd7631d python-3.11.2-amd64.exe diff --git a/scripts/pyinstaller/deps.txt b/scripts/pyinstaller/deps.txt index 265012cf..b7200279 100644 --- a/scripts/pyinstaller/deps.txt +++ b/scripts/pyinstaller/deps.txt @@ -1,16 +1,24 @@ # 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 + +# win10 additionals +https://pypi.org/project/Jinja2/#files +https://pypi.org/project/MarkupSafe/#files +https://pypi.org/project/mutagen/#files +https://pypi.org/project/Pillow/#files + +# win7 additionals +https://pypi.org/project/future/#files +https://pypi.org/project/importlib-metadata/#files +https://pypi.org/project/pip/#files +https://pypi.org/project/typing-extensions/#files +https://pypi.org/project/zipp/#files 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 diff --git a/scripts/pyinstaller/loader.py b/scripts/pyinstaller/loader.py index 89ace661..28f88e9c 100644 --- a/scripts/pyinstaller/loader.py +++ b/scripts/pyinstaller/loader.py @@ -1,10 +1,28 @@ # coding: utf-8 +import os +import re +import shutil +import subprocess as sp +import sys +import traceback + v = r""" -this is the EXE edition of copyparty, compatible with Windows7-SP1 -and later. To make this possible, the EXE was compiled with Python -3.7.9, which is EOL and does not receive security patches anymore. +this 32-bit copyparty.exe is compatible with Windows7-SP1 and later. +To make this possible, the EXE was compiled with Python 3.7.9, +which is EOL and does not receive security patches anymore. + +if possible, for performance and security reasons, please use this instead: +https://github.com/9001/copyparty/releases/latest/download/copyparty-sfx.py +""" + +if sys.version_info > (3, 10): + v = r""" + +this 64-bit copyparty.exe is compatible with Windows 8 and later. +No security issues were known to affect this EXE at build time, +however that may have changed since then. if possible, for performance and security reasons, please use this instead: https://github.com/9001/copyparty/releases/latest/download/copyparty-sfx.py @@ -16,14 +34,6 @@ except: print(v.replace("\n", "\n|| ")[1:] + "\n") -import re -import os -import sys -import shutil -import traceback -import subprocess as sp - - def confirm(rv): print() print("retcode", rv if rv else traceback.format_exc()) diff --git a/scripts/pyinstaller/notes.txt b/scripts/pyinstaller/notes.txt index 46083214..be94d024 100644 --- a/scripts/pyinstaller/notes.txt +++ b/scripts/pyinstaller/notes.txt @@ -2,34 +2,46 @@ run ./build.sh in git-bash to build + upload the exe ## ============================================================ -## first-time setup on a stock win7x32sp1 vm: +## 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.38.1-32-bit.exe +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=( - upx-4.0.0-win32.zip - pip-22.3-py3-none-any.whl altgraph-0.17.3-py2.py3-none-any.whl + pefile-2023.2.7-py3-none-any.whl + pyinstaller-5.8.0-py3-none-win_amd64.whl + pyinstaller_hooks_contrib-2023.0-py2.py3-none-any.whl + pywin32_ctypes-0.2.0-py2.py3-none-any.whl + upx-4.0.2-win32.zip +) +[ $w10 ] && fns+=( + mutagen-1.46.0-py3-none-any.whl + Pillow-9.4.0-cp311-cp311-win_amd64.whl + python-3.11.2-amd64.exe +} +[ $w7 ] && fns+=( 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 + pip-22.3-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+=( +[ $w7x64 ] && fns+=( windows6.1-kb2533623-x64.msu - pyinstaller-5.6.1-py3-none-win_amd64.whl + pyinstaller-5.8.0-py3-none-win_amd64.whl python-3.7.9-amd64.exe -) || fns+=( +) +[ $w7x32 ] && fns+=( windows6.1-kb2533623-x86.msu - pyinstaller-5.6.1-py3-none-win32.whl + pyinstaller-5.8.0-py3-none-win32.whl python-3.7.9.exe ) dl() { curl -fkLOC- "$1" && return 0; echo "$1"; return 1; } @@ -45,12 +57,15 @@ manually install: python-3.7.9 ===[ copy-paste into git-bash ]================================ +uname -s | grep NT-10 && w10=1 || w7=1 cd ~/Downloads && unzip upx-*-win32.zip && mv upx-*/upx.exe . && python -m ensurepip && 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 && +{ [ $w7 ] || python -m pip install --user -U mutagen-*.whl Pillow-*.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 && cd && rm -f build.sh && curl -fkLO https://192.168.123.1:3923/cpp/scripts/pyinstaller/build.sh && @@ -59,6 +74,14 @@ echo ok # 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 +===[ win10: copy-paste into git-bash ]========================= +appd=$(cygpath.exe "$APPDATA") +curl -fkLO https://192.168.123.1:3923/cpp/scripts/uncomment.py && +#for f in $appd/Python/Python311/site-packages/mutagen/*.py; do awk -i inplace '/^\s*def _?(save|write)/{sub(/d.*/," ");s=$0;ns=length(s)} ns&&/[^ ]/&&substr($0,0,ns)!=s{ns=0} !ns' "$f"; done && +python uncomment.py $appd/Python/Python311/site-packages/{mutagen,PIL,jinja2,markupsafe}/*.py && +sed -ri 's/--lzma/--best/' $APPDATA/Python/Python311/site-packages/pyinstaller/building/utils.py && +echo ok + ## ============================================================ ## notes