Files
karuo-ai/01_卡资(金)/金仓_存储备份/脚本/handy_install_windows.ps1
2026-07-19 00:21:46 +08:00

38 lines
1.1 KiB
PowerShell
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Handy 0.8.3 Windows 安装x64 / arm64 自动选择)
$ErrorActionPreference = "Stop"
$Ver = "0.8.3"
$Base = "https://github.com/cjpais/Handy/releases/download/v$Ver"
$arch = $env:PROCESSOR_ARCHITECTURE
if ($arch -eq "ARM64") {
$Asset = "Handy_${Ver}_arm64-setup.exe"
} else {
$Asset = "Handy_${Ver}_x64-setup.exe"
}
$Url = "$Base/$Asset"
$Dest = Join-Path $env:TEMP $Asset
Write-Host "下载 $Asset"
Invoke-WebRequest -Uri $Url -OutFile $Dest -UseBasicParsing
Get-Process -Name "handy","Handy" -ErrorAction SilentlyContinue | Stop-Process -Force
Write-Host "安装 Handy静默"
$proc = Start-Process -FilePath $Dest -ArgumentList "/S" -Wait -PassThru
if ($proc.ExitCode -ne 0) {
Write-Warning "静默安装退出码 $($proc.ExitCode),尝试交互安装…"
Start-Process -FilePath $Dest -Wait
}
Start-Sleep -Seconds 3
$exe = "${env:ProgramFiles}\Handy\Handy.exe"
if (-not (Test-Path $exe)) {
$exe = "${env:LocalAppData}\Programs\Handy\Handy.exe"
}
if (Test-Path $exe) {
Write-Host "✓ 已安装: $exe"
} else {
Write-Warning "未在默认路径找到 Handy.exe请从开始菜单启动 Handy 一次"
}