Files
zhangyu db5cc03fd2 Fix auto-reply duplication, message parsing and console stability
- dedupe by buyer message fingerprint and pending-message detection
- stop treating platform auto-reply and order/product cards as chat messages
- reply to buyer-sent product cards, inject card price and goods id
- add optional human-intervention fallback to debug mode
- configurable personal-order cache, block WebView2 new windows
- capture crash dumps, bump version to 1.1.2
2026-11-18 23:00:57 +08:00

48 lines
2.1 KiB
Batchfile

@echo off
setlocal
cd /d "%~dp0"
set "VCVARS=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat"
if not exist "%VCVARS%" goto :novcvars
call "%VCVARS%" x64 >nul
set WV2=%~dp0packages\Microsoft.Web.WebView2.1.0.2420.47\build\native
set OUT=%~dp0bin
if not exist "%OUT%" mkdir "%OUT%"
echo [1/3] 编译资源
rc /nologo /fo "%OUT%\app.res" res\app.rc
if errorlevel 1 goto :fail
echo [2/3] 编译源码
if exist "%OUT%\PddAI.exe" del /f /q "%OUT%\PddAI.exe" >nul 2>&1
set SUBSYS=WINDOWS
if /i "%1"=="console" set SUBSYS=CONSOLE
set SRCS=src\main.cpp src\Resources.cpp src\Log.cpp src\Util.cpp src\Config.cpp src\Server.cpp src\Pipeline.cpp src\Http.cpp src\Smtp.cpp src\Stats.cpp src\Cdp.cpp src\Browser.cpp src\WebConsole.cpp src\Auth.cpp src\Update.cpp
set CFLAGS=/nologo /std:c++17 /EHsc /O2 /MT /W3 /utf-8 /DUNICODE /D_UNICODE /DWIN32 /D_WINDOWS /D_CRT_SECURE_NO_WARNINGS
set INC=/I"src" /I"thirdparty" /I"%WV2%\include"
cl %CFLAGS% %INC% /Fo"%OUT%\\" /Fd"%OUT%\pddai.pdb" %SRCS% /link /OUT:"%OUT%\PddAI.exe" ^
/SUBSYSTEM:%SUBSYS% /MACHINE:X64 ^
"%OUT%\app.res" "%WV2%\x64\WebView2LoaderStatic.lib" ^
user32.lib gdi32.lib ole32.lib oleaut32.lib shell32.lib shlwapi.lib advapi32.lib comdlg32.lib version.lib ws2_32.lib iphlpapi.lib winhttp.lib secur32.lib bcrypt.lib windowscodecs.lib winmm.lib
if errorlevel 1 goto :fail
echo [3/4] 重命名为中文程序名
powershell -NoProfile -ExecutionPolicy Bypass -Command "$ErrorActionPreference = 'Stop'; $d = Join-Path (Get-Location) 'bin'; $n = [string][char]0x62FC + [char]0x591A + [char]0x591A + [char]0x5BA2 + [char]0x670D + [char]0x52A9 + [char]0x624B + '.exe'; $dst = Join-Path $d $n; if (Test-Path -LiteralPath $dst) { Remove-Item -LiteralPath $dst -Force }; Rename-Item -LiteralPath (Join-Path $d 'PddAI.exe') -NewName $n; $f = Get-Item -LiteralPath $dst; Write-Output ('OK ' + $f.FullName + ' ' + $f.Length)"
if errorlevel 1 goto :fail
echo [4/4] 完成
endlocal
exit /b 0
:fail
echo [x] 构建失败
endlocal
exit /b 1
:novcvars
echo [x] 找不到 vcvarsall.bat: %VCVARS%
endlocal
exit /b 1