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