修正windwos打包路径问题

(cherry picked from commit 88df41fe3fd2bb3b0293dc0df178b1e6f83dad07)
This commit is contained in:
2025-10-28 22:32:27 -07:00
committed by speakeloudest
parent 01ea786ef0
commit ee20cc93e2
2 changed files with 40 additions and 4 deletions
+34
View File
@@ -565,6 +565,40 @@ jobs:
run: |
flutter build windows --release
- name: 🔍 验证 Windows 文件结构
run: |
Write-Host "📋 检查 Release 目录文件结构..."
$releaseDir = "build\windows\x64\runner\Release"
if (Test-Path $releaseDir) {
Write-Host "✅ Release 目录存在"
Write-Host ""
Write-Host "📄 文件列表:"
Get-ChildItem $releaseDir | Format-Table Name, Length, LastWriteTime
# 检查关键文件
if (Test-Path "$releaseDir\BearVPN.exe") {
Write-Host "✅ BearVPN.exe 存在"
} else {
Write-Host "❌ BearVPN.exe 不存在"
}
if (Test-Path "$releaseDir\BearVPNCli.exe") {
Write-Host "✅ BearVPNCli.exe 存在"
} else {
Write-Host "⚠️ BearVPNCli.exe 不存在"
}
if (Test-Path "$releaseDir\libcore.dll") {
Write-Host "✅ libcore.dll 存在"
} else {
Write-Host "❌ libcore.dll 不存在"
}
} else {
Write-Host "❌ Release 目录不存在"
}
shell: pwsh
- name: 📦 打包 Windows
shell: bash
run: |
+6 -4
View File
@@ -84,6 +84,8 @@ endif()
set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")
set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}")
# CLI 工具目录(用于存放 BearVPNCli.exe
set(INSTALL_BUNDLE_CLI_DIR "${CMAKE_INSTALL_PREFIX}/cli")
install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"
COMPONENT Runtime)
@@ -94,15 +96,15 @@ install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}
install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime)
# 安装 libcore.dll 到可执行文件目录(使用相对路径
# 安装 libcore.dll 到可执行文件目录(与 BearVPN.exe 同级
install(FILES "../libcore/bin/libcore.dll"
DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime
OPTIONAL)
# 安装 BearVPNCli.exe 到可执行文件目录(使用相对路径
install(FILES "../libcore/bin/BearVPNCli.exe"
DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
# 安装 BearVPNCli.exe(保持原名
install(FILES "../libcore/bin/BearVPNCli.exe"
DESTINATION "${CMAKE_INSTALL_PREFIX}"
COMPONENT Runtime
OPTIONAL)