start.ps1 878 B

123456789101112131415161718192021222324252627282930
  1. # 检查环境依赖与打包文件,通过则启动 AndroidRemoteController.exe
  2. $ErrorActionPreference = 'Stop'
  3. $root = $PSScriptRoot
  4. $exe = Join-Path $root 'AndroidRemoteController.exe'
  5. # 1. 检查主程序
  6. if (-not (Test-Path $exe)) {
  7. Write-Host '[检查失败] 未找到 AndroidRemoteController.exe' -ForegroundColor Red
  8. exit 1
  9. }
  10. # 2. 检查关键打包目录/文件
  11. $required = @(
  12. (Join-Path $root 'resources')
  13. (Join-Path $root 'dist')
  14. )
  15. foreach ($p in $required) {
  16. if (-not (Test-Path $p)) {
  17. Write-Host "[检查失败] 缺少打包项: $p" -ForegroundColor Red
  18. exit 1
  19. }
  20. }
  21. # 3. 环境:当前为 64 位进程且可执行
  22. if ([Environment]::Is64BitProcess -eq $false) {
  23. Write-Host '[提示] 建议在 64 位环境中运行' -ForegroundColor Yellow
  24. }
  25. Write-Host '[检查通过] 启动应用...' -ForegroundColor Green
  26. & $exe