| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- # 快速获取最新构建的 exe 文件
- # 将 steamSH.exe 复制到当前目录或指定目录
- param(
- [string]$Destination = ".",
- [switch]$IncludeOpenSSL = $true
- )
- $ErrorActionPreference = "Stop"
- # 查找最新的 exe
- $releaseDir = "d:\code\steam\client-tauri\src-tauri\target\release"
- $exe = Get-ChildItem -Path $releaseDir -Filter "steamSH.exe" -File -ErrorAction SilentlyContinue
- if (-not $exe) {
- Write-Error "未找到 steamSH.exe,请先运行构建脚本"
- exit 1
- }
- Write-Host "找到可执行文件: $($exe.FullName)" -ForegroundColor Green
- Write-Host "文件大小: {0:N2} MB" -f ($exe.Length / 1MB)
- # 复制主 exe
- Copy-Item -Path $exe.FullName -Destination $Destination -Force
- Write-Host "已复制到: $Destination" -ForegroundColor Cyan
- if ($IncludeOpenSSL) {
- # 同时复制 OpenSSL DLL
- $dlls = @("libssl-3-x64.dll", "libcrypto-3-x64.dll")
- foreach ($dll in $dlls) {
- $dllPath = Join-Path $releaseDir $dll
- if (Test-Path $dllPath) {
- Copy-Item -Path $dllPath -Destination $Destination -Force
- Write-Host "已复制: $dll" -ForegroundColor Cyan
- } else {
- Write-Warning "未找到: $dll"
- }
- }
- }
- Write-Host ""
- Write-Host "完成!现在可以运行 steamSH.exe 了" -ForegroundColor Green
- Write-Host "注意:如果 exe 报错缺少 DLL,请确保三个文件(exe + 2个dll)在同一目录" -ForegroundColor Yellow
|