get-latest-exe.ps1 1.4 KB

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