fix(kimi): скрытый запускатель и запасной путь установки
- Зачем: при повторном запуске через ярлык Kimi цеплялся к консоли pwsh и удерживал окно терминала открытым ради своих логов. - Что: ярлык переведён на скрытый VBS-запускатель (как у Claude Proxy); добавлен запасной путь %ProgramFiles%\Kimi для установки на всех пользователей. - Проверка: синтаксис скриптов проверен парсером PowerShell, tests/test_proxy_env_sync.py зелёный.
This commit is contained in:
1 parent
5b2eef4881
commit
b36ce50e12
4 files changed
+55
-21
No files matched your search
@@ -5,6 +5,7 @@ if (-not ($IsWindows -or $PSVersionTable.PSEdition -eq 'Desktop')) {
|
||||
}
|
||||
|
||||
$LauncherPath = Join-Path $HOME '.local\bin\start-kimi-proxy.ps1'
|
||||
$LauncherHostPath = Join-Path $HOME '.local\bin\start-kimi-proxy.vbs'
|
||||
$ProgramsPath = [Environment]::GetFolderPath('Programs')
|
||||
if ([string]::IsNullOrWhiteSpace($ProgramsPath)) {
|
||||
Write-Warning 'Start Menu Programs folder was not found.'
|
||||
@@ -12,23 +13,18 @@ if ([string]::IsNullOrWhiteSpace($ProgramsPath)) {
|
||||
}
|
||||
|
||||
$ShortcutPath = Join-Path $ProgramsPath 'Kimi Proxy.lnk'
|
||||
$PwshAliasPath = Join-Path $env:LOCALAPPDATA 'Microsoft\WindowsApps\pwsh.exe'
|
||||
$PwshCommand = Get-Command pwsh -ErrorAction SilentlyContinue
|
||||
if (Test-Path -LiteralPath $PwshAliasPath) {
|
||||
$TargetPath = $PwshAliasPath
|
||||
} elseif ($null -ne $PwshCommand) {
|
||||
$TargetPath = $PwshCommand.Source
|
||||
} else {
|
||||
$TargetPath = 'pwsh.exe'
|
||||
}
|
||||
|
||||
$Arguments = "-NoLogo -NoProfile -ExecutionPolicy Bypass -File `"$LauncherPath`""
|
||||
$TargetPath = Join-Path $env:WINDIR 'System32\wscript.exe'
|
||||
$Arguments = "//NoLogo `"$LauncherHostPath`""
|
||||
$WorkingDirectory = $env:USERPROFILE
|
||||
$IconLocation = "$TargetPath,0"
|
||||
|
||||
$KimiExecutable = Join-Path $env:LOCALAPPDATA 'Programs\Kimi\Kimi.exe'
|
||||
if (Test-Path -LiteralPath $KimiExecutable) {
|
||||
$KimiExecutable = @(
|
||||
(Join-Path $env:LOCALAPPDATA 'Programs\Kimi\Kimi.exe'),
|
||||
(Join-Path $env:ProgramFiles 'Kimi\Kimi.exe')
|
||||
) | Where-Object { Test-Path -LiteralPath $_ } | Select-Object -First 1
|
||||
if ($null -ne $KimiExecutable) {
|
||||
$IconLocation = "$KimiExecutable,0"
|
||||
} else {
|
||||
$IconLocation = "$LauncherPath,0"
|
||||
}
|
||||
|
||||
New-Item -ItemType Directory -Path (Split-Path -Parent $ShortcutPath) -Force | Out-Null
|
||||
|
||||
Reference in new issue
Block a user