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
@@ -6,12 +6,18 @@ $HttpProxy = "http://${ProxyHostName}:${ProxyPort}"
|
||||
$ProxyBypassList = "${ProxyHostName};localhost;127.0.0.1;[::1];*.concept-software.ru;dementev.space;*.dementev.space"
|
||||
|
||||
function Get-KimiApplication {
|
||||
$Executable = Join-Path $env:LOCALAPPDATA 'Programs\Kimi\Kimi.exe'
|
||||
if (-not (Test-Path -LiteralPath $Executable)) {
|
||||
throw "Kimi Desktop не найден: ожидался файл '$Executable'."
|
||||
$Candidates = @(
|
||||
(Join-Path $env:LOCALAPPDATA 'Programs\Kimi\Kimi.exe'),
|
||||
(Join-Path $env:ProgramFiles 'Kimi\Kimi.exe')
|
||||
)
|
||||
|
||||
foreach ($Executable in $Candidates) {
|
||||
if (Test-Path -LiteralPath $Executable) {
|
||||
return $Executable
|
||||
}
|
||||
}
|
||||
|
||||
return $Executable
|
||||
throw "Kimi Desktop не найден: проверены пути '$($Candidates -join "', '")'."
|
||||
}
|
||||
|
||||
function Assert-KimiNotRunning {
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
Option Explicit
|
||||
|
||||
Dim fileSystem
|
||||
Dim launcherPath
|
||||
Dim powerShellPath
|
||||
Dim command
|
||||
Dim exitCode
|
||||
Dim shell
|
||||
|
||||
Set fileSystem = CreateObject("Scripting.FileSystemObject")
|
||||
Set shell = CreateObject("WScript.Shell")
|
||||
|
||||
launcherPath = shell.ExpandEnvironmentStrings("%USERPROFILE%\.local\bin\start-kimi-proxy.ps1")
|
||||
powerShellPath = shell.ExpandEnvironmentStrings("%LOCALAPPDATA%\Microsoft\WindowsApps\pwsh.exe")
|
||||
|
||||
If Not fileSystem.FileExists(powerShellPath) Then
|
||||
powerShellPath = "pwsh.exe"
|
||||
End If
|
||||
|
||||
command = """" & powerShellPath & _
|
||||
""" -NoLogo -NoProfile -ExecutionPolicy Bypass -File """ & _
|
||||
launcherPath & """"
|
||||
|
||||
exitCode = shell.Run(command, 0, True)
|
||||
If exitCode <> 0 Then
|
||||
MsgBox "Не удалось запустить Kimi Proxy. Код ошибки: " & exitCode, _
|
||||
vbCritical, "Kimi Proxy"
|
||||
End If
|
||||
Reference in new issue
Block a user