From 11c66d0314c20db41476d091ddd7747a0c5649d8 Mon Sep 17 00:00:00 2001 From: Rust Date: Wed, 29 Oct 2025 13:00:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3windows=E6=89=93=E5=8C=85?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 3db9d86bcd6f85cf6b81ee27e79a0d2a0f9287ab) --- .github/workflows/build-multiplatform.yml | 26 +++++++++++++++++++++++ windows/CMakeLists.txt | 14 ++++++------ 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-multiplatform.yml b/.github/workflows/build-multiplatform.yml index 00dc8cb..bcc7de4 100644 --- a/.github/workflows/build-multiplatform.yml +++ b/.github/workflows/build-multiplatform.yml @@ -489,6 +489,32 @@ jobs: } shell: pwsh + - name: 🔧 验证 libcore 文件存在 + run: | + Write-Host "📋 验证 libcore 文件是否存在..." + + if (Test-Path "libcore\bin\libcore.dll") { + $dllInfo = Get-Item "libcore\bin\libcore.dll" + Write-Host "✅ libcore.dll 存在: $($dllInfo.FullName) - 大小: $($dllInfo.Length) bytes" + } else { + Write-Host "❌ libcore.dll 不存在" + Write-Host "当前 libcore\bin 目录内容:" + if (Test-Path "libcore\bin") { + Get-ChildItem "libcore\bin" | Format-Table Name, FullName, Length + } else { + Write-Host "libcore\bin 目录不存在" + } + exit 1 + } + + if (Test-Path "libcore\bin\BearVPNCli.exe") { + $exeInfo = Get-Item "libcore\bin\BearVPNCli.exe" + Write-Host "✅ BearVPNCli.exe 存在: $($exeInfo.FullName) - 大小: $($exeInfo.Length) bytes" + } else { + Write-Host "⚠️ BearVPNCli.exe 不存在" + } + shell: pwsh + - name: 🔨 构建 Windows (Release) run: | flutter build windows --release diff --git a/windows/CMakeLists.txt b/windows/CMakeLists.txt index 13a8818..7cfa544 100755 --- a/windows/CMakeLists.txt +++ b/windows/CMakeLists.txt @@ -94,15 +94,17 @@ install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR} install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) -# 安装 libcore.dll 到可执行文件目录 -install(FILES "${CMAKE_SOURCE_DIR}/libcore/bin/libcore.dll" +# 安装 libcore.dll 到可执行文件目录(使用相对路径) +install(FILES "../libcore/bin/libcore.dll" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) + COMPONENT Runtime + OPTIONAL) -# 安装 BearVPNCli.exe 到可执行文件目录 -install(FILES "${CMAKE_SOURCE_DIR}/libcore/bin/BearVPNCli.exe" +# 安装 BearVPNCli.exe 到可执行文件目录(使用相对路径) +install(FILES "../libcore/bin/BearVPNCli.exe" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) + COMPONENT Runtime + OPTIONAL) if(PLUGIN_BUNDLED_LIBRARIES)