From f6c6fbc223070aa85cf414b79e60a6ce0ebf4185 Mon Sep 17 00:00:00 2001 From: ed Date: Sun, 12 Mar 2023 18:54:16 +0000 Subject: [PATCH] fix exe builder --- scripts/pyinstaller/build.sh | 12 +++++++----- scripts/pyinstaller/loader.py | 3 +++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/scripts/pyinstaller/build.sh b/scripts/pyinstaller/build.sh index 21904daa..5691346b 100644 --- a/scripts/pyinstaller/build.sh +++ b/scripts/pyinstaller/build.sh @@ -9,11 +9,14 @@ tee build2.sh | cmp build.sh && rm build2.sh || { [[ $r =~ [yY] ]] && mv build{2,}.sh && exec ./build.sh } -./up2k.sh +[ -e up2k.sh ] && ./up2k.sh -uname -s | grep WOW64 && m= || m=32 +uname -s | grep WOW64 && m=64 || m=32 uname -s | grep NT-10 && w10=1 || w7=1 [ $w7 ] && pyv=37 || pyv=311 +esuf= +[ $w7 ] && [ $m = 32 ] && esuf=32 +[ $w7 ] && [ $m = 64 ] && esuf=-winpe64 appd=$(cygpath.exe "$APPDATA") spkgs=$appd/Python/Python$pyv/site-packages @@ -59,8 +62,7 @@ read a b c d _ < <( sed -r 's/[^0-9]+//;s/[" )]//g;s/[-,]/ /g;s/$/ 0/' ) sed -r 's/1,2,3,0/'$a,$b,$c,$d'/;s/1\.2\.3/'$a.$b.$c/ loader.rc2 -[ $m ] && - sed -ri 's/copyparty.exe/copyparty32.exe/' loader.rc2 +sed -ri s/copyparty.exe/copyparty$esuf.exe/ loader.rc2 excl=( copyparty.broker_mp @@ -105,4 +107,4 @@ base64 | head -c12 >> dist/copyparty.exe dist/copyparty.exe --version -curl -fkT dist/copyparty.exe -b cppwd=wark https://192.168.123.1:3923/copyparty$m.exe +curl -fkT dist/copyparty.exe -b cppwd=wark https://192.168.123.1:3923/copyparty$esuf.exe diff --git a/scripts/pyinstaller/loader.py b/scripts/pyinstaller/loader.py index 0f19cd0f..1fcf8c87 100644 --- a/scripts/pyinstaller/loader.py +++ b/scripts/pyinstaller/loader.py @@ -30,6 +30,9 @@ if possible, for performance and security reasons, please use this instead: https://github.com/9001/copyparty/releases/latest/download/copyparty-sfx.py """ +if sys.maxsize > 2 ** 32: + v = v.replace("32-bit", "64-bit") + try: print(v.replace("\n", "\nā–’ā–Œ ")[1:] + "\n") except: