# ===================================================================== # KernelHub CLI official installer (Windows / PowerShell) # # irm https://icloser.xyz/install.ps1 | iex # # --------------------------------------------------------------------- # WHY THIS FILE IS PURE ASCII (no BOM, no non-ASCII characters anywhere) # --------------------------------------------------------------------- # `irm | iex` means this file is fetched as *text* and then parsed. # Two things break silently when it is not ASCII: # # * Encoding. Invoke-RestMethod picks the decoder from the response # Content-Type charset. A static file server that does not send # `charset=utf-8` makes Windows PowerShell 5.1 decode UTF-8 bytes as # the ANSI code page. Comments turn into mojibake -- and a mojibake # byte can land on a backtick or a quote, which changes where strings # start and end. The failure looks like a random parser error on a # line the author never wrote. # * BOM. A UTF-8 BOM survives into the string `irm` returns, so `iex` # sees U+FEFF as the first token. PowerShell 5.1 rejects it. # # So: ASCII only, no BOM, and every user-facing message is English. # This is a deliberate deviation from the repo's Chinese-comment # convention, for a reason that only applies to files served over the # wire and executed as text. # # --------------------------------------------------------------------- # WHAT IT DOES -- none of these steps is optional # --------------------------------------------------------------------- # 1. Detect the real CPU architecture of this machine. # 2. Read stable.json. Version, file name and checksum are NEVER # hard-coded here -- they all come from the manifest. # 3. Refuse to install when the manifest says the channel is not READY. # There is no override switch, on purpose: add a -Force and nobody # looks at this gate again. # 4. Verify SHA-256 (and size) before installing. Mismatch = delete and # stop. Never install something the manifest does not vouch for. # 5. Install, put the directory on PATH for BOTH the current session # and the user environment, then run `icloser version` and check it # against the manifest. "The file is there" is not "it is installed". # # Tested against PowerShell 7.4; written to the Windows PowerShell 5.1 # language level (no ternary, no null-coalescing, -UseBasicParsing). # ===================================================================== # -Runtime / -SkipRuntime only bind when this file is invoked as a file # (`powershell -File install.ps1 -Runtime qwen`). The advertised install path # is `irm ... | iex`, which cannot pass parameters at all -- there the two # switches are the environment variables KERNELHUB_RUNTIME and # KERNELHUB_SKIP_RUNTIME, which are the SAME names with the SAME meaning as # in install.sh. Both forms are honoured below. param([string]$Runtime = '', [switch]$SkipRuntime) $ErrorActionPreference = 'Stop' # Windows PowerShell 5.1 still defaults to TLS 1.0 on older builds, and # every modern endpoint refuses that. Without this line the failure is # "The underlying connection was closed", which reads like a network # outage rather than a protocol mismatch. try { [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12 } catch { } # Two hosts, two jobs: # icloser.xyz company site -- serves THIS SCRIPT only (/install.ps1) # kernelhub.icloser.xyz official site + release download root # (/stable.json and /cli//...) # So $Base is where the manifest and artifacts are fetched FROM, # not where this script is served from. if ($env:KERNELHUB_INSTALL_BASE) { $Base = $env:KERNELHUB_INSTALL_BASE } else { $Base = 'https://kernelhub.icloser.xyz' } $Base = $Base.TrimEnd('/') if ($env:KERNELHUB_BIN_DIR) { $Dest = $env:KERNELHUB_BIN_DIR } else { $Dest = Join-Path $env:LOCALAPPDATA 'Programs\icloser' } function Fail { param([string]$Message, [string[]]$Detail = @()) Write-Host '' Write-Host "x $Message" -ForegroundColor Red foreach ($d in $Detail) { Write-Host " $d" -ForegroundColor Red } exit 1 } function Ok { param([string]$Message) Write-Host "v $Message" -ForegroundColor Green } # --------------------------------------------------------------------- # 1. Architecture # # PROCESSOR_ARCHITECTURE reports the architecture of the *process*, so a # 32-bit PowerShell on 64-bit Windows says x86. PROCESSOR_ARCHITEW6432 # carries the machine's real architecture in exactly that case. # --------------------------------------------------------------------- $rawArch = $env:PROCESSOR_ARCHITEW6432 if (-not $rawArch) { $rawArch = $env:PROCESSOR_ARCHITECTURE } switch ($rawArch) { 'AMD64' { $arch = 'amd64' } 'ARM64' { $arch = 'arm64' } 'x86' { $arch = '386' } default { $arch = $rawArch.ToLower() } } $plat = "windows-$arch" # --------------------------------------------------------------------- # 2. Manifest # --------------------------------------------------------------------- $manifestUrl = "$Base/stable.json" Write-Host "Fetching the official release manifest from $manifestUrl ..." # Download to a file and decode as UTF-8 explicitly, instead of using the # string Invoke-WebRequest hands back. When the server does not send a # charset, Windows PowerShell 5.1 decodes the body with the ANSI code page # -- the JSON still parses, but every non-ASCII string value inside it # (the not_ready_reasons the user is about to read) comes out as mojibake. $mfTmp = Join-Path $env:TEMP 'kernelhub-stable.json' try { Invoke-WebRequest -Uri $manifestUrl -OutFile $mfTmp -UseBasicParsing -TimeoutSec 30 $mf = (Get-Content -Path $mfTmp -Raw -Encoding UTF8) | ConvertFrom-Json Remove-Item $mfTmp -Force -ErrorAction SilentlyContinue } catch { Fail "Cannot read $manifestUrl" @( $_.Exception.Message, 'If this is a 404, the official release manifest has not been published yet.', 'That is the "install entry point is not ready" case -- not a problem on your side.') } if ($mf.schema -ne 'kernelhub-install-manifest/1') { Fail "Unknown manifest schema: '$($mf.schema)'" @( 'This installer only understands kernelhub-install-manifest/1.', 'The installer and the manifest are on different contracts. Do not patch this check.') } foreach ($f in @('version','build','commit','path','status','platforms')) { if ($mf.PSObject.Properties.Name -notcontains $f) { Fail "Manifest is missing the '$f' field" } } Write-Host (" Manifest: {0} channel - v{1} - build {2} - commit {3}" -f $mf.channel, $mf.version, $mf.build, $mf.commit) # --------------------------------------------------------------------- # 3. Not READY means not installed # --------------------------------------------------------------------- if ($mf.status -ne 'READY') { Write-Host '' Write-Host ("x The {0} channel is currently {1} -- nothing was installed." -f $mf.channel, $mf.status) -ForegroundColor Red foreach ($r in $mf.not_ready_reasons) { Write-Host " - $r" -ForegroundColor Red } Write-Host '' Write-Host ' This is not a network problem: the official manifest says it is not ready.' -ForegroundColor Red Write-Host ' Installing a build the manifest does not vouch for is worse than not installing:' -ForegroundColor Red Write-Host ' when something breaks, nobody can say which code the user is running.' -ForegroundColor Red exit 1 } # --------------------------------------------------------------------- # 4. Download + verify # --------------------------------------------------------------------- $entry = $mf.platforms.$plat if (-not $entry) { $have = ($mf.platforms.PSObject.Properties.Name | Where-Object { $_ -like 'windows-*' }) -join ', ' if (-not $have) { $have = '(no Windows build in this release)' } Fail "This release has no artifact for $plat" @( "Windows artifacts in v$($mf.version): $have", 'Installing a binary built for another architecture is not a workaround:', 'it fails with a message that looks like a corrupted download.') } $url = "$Base/$($mf.path)$($entry.file)" Write-Host "Downloading $($entry.file) ..." New-Item -ItemType Directory -Force -Path $Dest | Out-Null $tmp = Join-Path $env:TEMP ("icloser-{0}-{1}.exe" -f $mf.version, $mf.build) try { Invoke-WebRequest -Uri $url -OutFile $tmp -UseBasicParsing -TimeoutSec 600 } catch { # Say WHICH failure this is. These two have opposite next steps: # # * the transfer was cut short -> run the same command again; the # package on the server has not changed # * the server answered with an HTTP error -> retrying gives the same # answer; the manifest and the server really do disagree # # This block used to print the second sentence for both, so a flaky # link read as "the server's package is broken" -- and the user went # looking at a server that was fine. # The distinction is "did the server answer at all", which is exactly what # a non-null .Response means. Read the status code in a SEPARATE try: if # only the cast fails we still know an answer came back, and must not fall # through to the retry branch. Branching on the code alone would file a 404 # under "just try again" every time the cast misbehaves. $answered = $false $httpStatus = $null try { $r = $_.Exception.Response if ($r) { $answered = $true try { $httpStatus = [int]$r.StatusCode } catch { } } } catch { } if ($answered) { if (-not $httpStatus) { $httpStatus = 'unknown' } Fail "The server has no such artifact: $url (HTTP $httpStatus)" @( $_.Exception.Message, 'The server ANSWERED, and it answered with an error code. This is the case', 'where the manifest and the server really do disagree: the manifest lists', 'this file and the server does not have it. Retrying will not help --', "ask whoever published v$($mf.version) build $($mf.build).") } else { Fail "Download interrupted: $($entry.file)" @( $_.Exception.Message, 'This is THIS TRANSFER being cut short -- a dropped connection, a TLS', 'handshake that did not finish, or a timeout. The package on the server', 'has not changed and it is not corrupt.', 'Just run the same command again. If it keeps dropping, look at the link:', 'a proxy, a VPN or a corporate firewall cutting long connections is the', 'usual cause.') } } $got = (Get-FileHash -Path $tmp -Algorithm SHA256).Hash.ToLower() if ($got -ne $entry.sha256.ToLower()) { Remove-Item $tmp -Force -ErrorAction SilentlyContinue # Getting here means the download itself reported success, so this is # NOT the interrupted-transfer case above: the bytes arrived in full and # they are the wrong bytes. Retrying will most likely hand you the same # ones. Fail 'SHA-256 mismatch -- the downloaded file has been deleted' @( "expected $($entry.sha256)", "actual $got", 'The transfer itself completed, so a retry will most likely give the same bytes.', 'Either the file on the server is not the one the manifest describes, or', 'something in between rewrote it. Neither is safe to install.') } Ok 'SHA-256 verified' if ($entry.size) { $realSize = (Get-Item $tmp).Length if ($realSize -ne $entry.size) { Remove-Item $tmp -Force -ErrorAction SilentlyContinue Fail "Size mismatch: manifest says $($entry.size) bytes, got $realSize bytes" } } # --------------------------------------------------------------------- # 5. Install # # W-7 (2026-09-16, real machine): this used to be a bare # `Move-Item -Path $tmp -Destination $exe -Force`. When a KernelHub daemon # is running -- which is exactly the situation on every UPGRADE -- Windows # refuses to replace the running .exe (ERROR_SHARING_VIOLATION / ACCESS # DENIED). The install died on a raw .NET IOException and the user had to # work out for themselves that the resident task had to be stopped first. # # Windows does allow RENAMING a running .exe: the process keeps running the # file it already has open, and the name is freed for the new copy. Same # rule server/internal/atomicfs lives by on the Go side. # # Deliberately NOT stopping the daemon here: stopping something the user is # running is upgrade.ps1's job. Renaming aside makes the install SUCCEED, # which is the cheaper of the two. # # The cost is stated out loud afterwards: the daemon that is still running # is still the OLD build until it is restarted. An install that silently # leaves the old binary running is worse than one that fails. # # Judge: scripts/windows_installer_locked_exe_gate.sh (five situations run # for real under the local pwsh; the real-Windows half is NOT_PROVEN). # --------------------------------------------------------------------- # >>> LOCKED-EXE-REPLACE BEGIN -- windows_installer_locked_exe_gate.sh slices on these two lines, do not touch their text function Install-ExeFile { # Put $Source at $Destination even when the destination is in use. # Returns 'copied' (plain overwrite) or 'renamed-aside' (the old file was # moved out of the way). Throws a plain-language message when it cannot. param( [Parameter(Mandatory = $true)][string]$Source, [Parameter(Mandatory = $true)][string]$Destination ) $leaf = Split-Path -Leaf $Destination $dir = Split-Path -Parent $Destination # Files a previous run moved aside: delete what can be deleted. Anything # still locked means that process has not exited yet -- not an error, we # pick it up next time. Failing an install over leftover junk is wrong. Get-ChildItem -LiteralPath $dir -Filter ($leaf + ".old-*") -ErrorAction SilentlyContinue | ForEach-Object { try { Remove-Item -LiteralPath $_.FullName -Force -ErrorAction Stop } catch { } } # Plain overwrite first. When nothing holds the file this is the whole # story -- do not rename on every install "for symmetry", that would # litter the directory and turn a one-step success into two. try { Copy-Item -LiteralPath $Source -Destination $Destination -Force -ErrorAction Stop return "copied" } catch { $native = $_.Exception.Message # No destination at all: the failure has nothing to do with a lock and # renaming cannot help. Rethrow as-is instead of reporting a full disk # or a bad path as "in use by another process". if (-not (Test-Path -LiteralPath $Destination)) { throw $_ } } $aside = $Destination + ".old-" + (Get-Date -Format "yyyyMMddHHmmss") try { Move-Item -LiteralPath $Destination -Destination $aside -Force -ErrorAction Stop } catch { throw ("Cannot install " + $leaf + ": it is in use by a running process (Windows will not " + "replace a running .exe) and moving the old file aside failed too. Native error: " + $native + " / " + $_.Exception.Message + ". There is most likely a KernelHub daemon running on this machine. Stop it and " + "install again: icloser daemon uninstall") } try { Copy-Item -LiteralPath $Source -Destination $Destination -Force -ErrorAction Stop } catch { # The name is free now, so failing here leaves NOTHING in place -- # worse than not having touched it. Put the old file back, then report. try { Move-Item -LiteralPath $aside -Destination $Destination -Force -ErrorAction Stop } catch { } throw ("Cannot install " + $leaf + ": the old file was moved aside but the new one could not " + "be copied in (" + $_.Exception.Message + "). The old file has been put back, so this " + "machine still has the build it had before. Stop the daemon and install again: " + "icloser daemon uninstall") } return "renamed-aside" } function Show-LockedExeNotice { # Something got in only because the old file was renamed out of the way. # Say so: it IS installed, but the process still running is the OLD one. # Staying quiet here lets the user believe the upgrade already took effect. param([string[]]$Names) if (-not $Names -or $Names.Count -eq 0) { return } Write-Host '' Write-Host ("! These files were in use by a running process while installing: " + ($Names -join ', ')) -ForegroundColor Yellow Write-Host ' Windows will not replace a running .exe, so the old copy was renamed out of the way' -ForegroundColor Yellow Write-Host ' (*.old-, same directory) and the new one is now in place. But the process' -ForegroundColor Yellow Write-Host ' that is still running is STILL THE OLD BUILD. Restart it to pick up the new one:' -ForegroundColor Yellow Write-Host '' -ForegroundColor Yellow Write-Host ' icloser daemon uninstall' -ForegroundColor Yellow Write-Host ' icloser daemon install' -ForegroundColor Yellow Write-Host '' -ForegroundColor Yellow Write-Host ' On the offline bundle, upgrade.ps1 does this for you (stops the daemon, installs,' -ForegroundColor Yellow Write-Host ' starts it again): powershell -ExecutionPolicy Bypass -File upgrade.ps1' -ForegroundColor Yellow Write-Host ' The *.old- files are cleaned up by the next install, once that process exits.' -ForegroundColor Yellow } # <<< LOCKED-EXE-REPLACE END $exe = Join-Path $Dest 'icloser.exe' $sidelined = @() try { if ((Install-ExeFile -Source $tmp -Destination $exe) -eq 'renamed-aside') { $sidelined += 'icloser.exe' } } catch { Remove-Item $tmp -Force -ErrorAction SilentlyContinue Fail $_.Exception.Message @() } Remove-Item $tmp -Force -ErrorAction SilentlyContinue Ok "Installed to $exe" # --------------------------------------------------------------------- # 5b. The other three names # # One binary, four names. install.sh (macOS/Linux) creates icli, # kernelhub-cli and devnexus-cli as symlinks to icloser. On Windows this # script created NONE of them, so every document, script and habit that # says `icli ...` produced "not recognized as the name of a cmdlet" -- # a message that reads like a broken install rather than a missing alias. # # The old names must keep working: dropping them breaks every machine # that was set up before the rename, all at once, with no hint of why. # # Why .cmd shims and not copies or hard links: # * Copies drift. Four separate .exe files silently diverge the first # time only one of them is upgraded, and the symptom is # "icloser is fixed, icli still does the old thing". # * Hard links have the same problem here: this installer replaces # icloser.exe with Move-Item -Force on upgrade, which breaks the link # and leaves the other names pointing at the OLD binary forever. # * A .cmd shim re-reads icloser.exe on every invocation, so an upgrade # is picked up by all four names at once. # # Known difference from Unix: the CLI branches on argv[0] (progName), and # a .cmd shim cannot rewrite argv[0] -- it always launches icloser.exe. # So on Windows the legacy names do NOT print the "this is an old command # name" notice. The name works; only the nag is missing. That is the # right trade: the notice is a courtesy, the command existing is not. # # ASCII only, LF or CRLF both fine; written without a BOM because cmd.exe # treats a leading U+FEFF as part of the first command. # --------------------------------------------------------------------- $aliasBody = @' @echo off rem KernelHub CLI alias -- forwards to icloser.exe in this same directory. rem Generated by install.ps1. Editing this file has no effect: the next rem install or upgrade overwrites it. "%~dp0icloser.exe" %* exit /b %ERRORLEVEL% '@ $aliasNames = @('icli', 'kernelhub-cli', 'devnexus-cli') $aliasMade = @() foreach ($a in $aliasNames) { $shim = Join-Path $Dest "$a.cmd" try { # -Encoding ASCII: no BOM. Out-File/redirection would give UTF-16LE # on Windows PowerShell 5.1, and cmd.exe cannot run that at all. Set-Content -Path $shim -Value $aliasBody -Encoding ASCII -Force $aliasMade += $a } catch { Write-Host " ! Could not create the '$a' alias: $($_.Exception.Message)" -ForegroundColor Yellow } } if ($aliasMade.Count -eq $aliasNames.Count) { Ok ("Aliases: {0} (short name), {1} (legacy, still work)" -f $aliasMade[0], ($aliasMade[1..2] -join ' / ')) } else { Write-Host (" ! Only {0} of {1} aliases were created" -f $aliasMade.Count, $aliasNames.Count) -ForegroundColor Yellow } # PATH, for the current session AND for future ones. Only the user scope # is touched -- a per-user tool has no business editing the machine PATH. # Setting only the user variable would mean "open a new terminal first", # and the next line of this script already needs the tool to be usable. $userPath = [Environment]::GetEnvironmentVariable('Path', 'User') if (-not $userPath) { $userPath = '' } if (($userPath -split ';') -notcontains $Dest) { if ($userPath -eq '') { $newPath = $Dest } else { $newPath = "$userPath;$Dest" } [Environment]::SetEnvironmentVariable('Path', $newPath, 'User') Ok "Added $Dest to your user PATH" } else { Ok "$Dest is already on your user PATH" } if (($env:Path -split ';') -notcontains $Dest) { $env:Path = "$env:Path;$Dest" } # --------------------------------------------------------------------- # 5c. Is there ANOTHER KernelHub on this machine? # # There are three install locations, written by three different things: # # %ProgramFiles%\KernelHub\bin the MSI -- MACHINE PATH # %LOCALAPPDATA%\Programs\icloser this script -- user PATH # %LOCALAPPDATA%\KernelHub\bin the offline bundle installer (user) # # Windows builds the effective PATH as MACHINE PATH first, then user PATH. # So a machine-level install ALWAYS wins the name `icloser`, no matter how # much newer this one is. And the MSI creates no `icli` alias at all, so # `icli` resolves here while `icloser` resolves there: two names, two # different builds, on one machine, with nothing saying so. # # 2026-09-15, real Windows machine: # icli -> an older 1.0.0 build (commit b4332cfc60d8) # icloser -> a different, older 1.0.0 build (commit e98221869ec7) # # This block does NOT refuse to install and does NOT touch the other copy. # Refusing would block the user from getting any work done, and this # installer's job is to get them working. It states the fact and the # consequence, and gives the exact command to make them agree. # --------------------------------------------------------------------- $others = @() # Either variable can be unset (non-Windows pwsh, stripped service env). Under # ErrorActionPreference=Stop a null Join-Path aborts the whole install, so # only probe the roots that actually exist. $otherRoots = @() if ($env:ProgramFiles) { $otherRoots += (Join-Path $env:ProgramFiles 'KernelHub\bin') } if ($env:LOCALAPPDATA) { $otherRoots += (Join-Path $env:LOCALAPPDATA 'KernelHub\bin') } foreach ($cand in $otherRoots) { if ($cand -eq $Dest) { continue } $otherExe = Join-Path $cand 'icloser.exe' if (Test-Path $otherExe) { $ver = '(could not run it)' try { $ver = (& $otherExe version 2>&1 | Out-String).Trim() } catch { } $others += [pscustomobject]@{ Path = $otherExe; Version = $ver } } } if ($others.Count -gt 0) { Write-Host '' Write-Host '! There is ANOTHER KernelHub installed on this machine.' -ForegroundColor Yellow foreach ($o in $others) { Write-Host (" $($o.Path)") -ForegroundColor Yellow Write-Host (" reports: $($o.Version)") -ForegroundColor Yellow } Write-Host (" just installed here: $exe") -ForegroundColor Yellow Write-Host '' $machineHit = $others | Where-Object { $env:ProgramFiles -and $_.Path -like "$($env:ProgramFiles)*" } if ($machineHit) { # The one that wins is decided by PATH order, not by which is newer. Write-Host ' Windows puts the MACHINE PATH before your user PATH, so that copy --' -ForegroundColor Yellow Write-Host ' not this one -- is what you get when you type icloser' -ForegroundColor Yellow Write-Host ' This install is reachable as icli' -ForegroundColor Yellow Write-Host '' Write-Host ' To make both names mean the same build, remove the machine-wide one:' -ForegroundColor Yellow Write-Host ' Settings > Apps > KernelHub > Uninstall' -ForegroundColor Yellow Write-Host ' (or run the bundled scripts\uninstall.ps1 from an elevated PowerShell)' -ForegroundColor Yellow } else { Write-Host ' Which one you get depends on your user PATH order. To avoid surprises,' -ForegroundColor Yellow Write-Host ' uninstall the other copy, or always use the full path.' -ForegroundColor Yellow } } # --------------------------------------------------------------------- # 5d. When you type the name, WHICH file do you actually get? # # 5c above only looks inside the two directories KernelHub itself installs # into. That is not the question a user has. The question is "I type # icloser -- what runs?". (The where.exe listing below is how it was first # seen; the check itself no longer uses where.exe -- see Resolve-CommandOnPath.) # # 2026-09-16, real Windows machine (JIMPC, PowerShell 5.1.26100.9444), # right after a successful v1.0.1 install: # # where.exe icloser # C:\Users\GPD\AppData\Roaming\npm\icloser <- an UNRELATED npm tool # C:\Users\GPD\AppData\Roaming\npm\icloser.cmd # C:\Users\GPD\AppData\Local\Programs\icloser\icloser.exe # C:\Users\GPD\AppData\Local\KernelHub\bin\icloser.exe <- installed that day # C:\Program Files\KernelHub\bin\icloser.exe # where.exe icli # C:\Users\GPD\AppData\Local\Programs\icloser\icli.cmd # # `icloser version` printed the npm package's help menu. `icli version` # printed an old 1.0.0 build. The newer release that had just been # installed won NOTHING. 5c could not have seen this: the winner was not # a KernelHub install at all, so scanning KernelHub directories is blind # to it by construction. # # Root cause of the losing: every PATH edit in this script APPENDS # ($userPath;$Dest). Windows resolves MACHINE PATH first, then user PATH, # in order -- so an appended entry is the last one consulted, and anything # already there wins the name. # # -- What this block does and does NOT do ------------------------------ # # It does NOT reorder PATH and does NOT remove anything. That is the # user's machine, and a tool that silently rewrites PATH order or deletes # someone else's binary is worse than the problem. It also never fails the # install: an install that works but needs a different name typed is far # better than no install at all. Our job here is to SAY the fact, exactly, # and hand over the commands. Deciding is theirs. # # It asks against the PATH a NEW terminal will have (machine + user), not # this session's -- the lines above already doctored $env:Path, and # answering from that would be optimistically wrong. # --------------------------------------------------------------------- # >>> ENTRY-WINNER-CHECK BEGIN -- windows_installer_entry_winner_gate.sh slices on these two lines; do not reword them function Resolve-CommandOnPath { # Answers "on this PATH, typing $Name finds which files, in what order": # PATH entries are asked in the order they appear; inside each directory # the extensions in $PathExt are tried in order. Every hit is returned; # THE FIRST ONE IS WHAT RUNS. # # Why not where.exe any more (real machine 2026-09-16, candidate 7ed139e4): # where.exe searches the CURRENT DIRECTORY FIRST; PowerShell does not. # This script is often run from inside the extracted folder, so where.exe # always ranked that folder's icloser.exe first -- which is not the answer # to "open a new terminal, type icloser, what runs?". So: PATH only, no # current directory. A file with no extension (the npm folder's bare # `iCloser`) is not in PATHEXT and is not a hit; `iCloser.cmd` next to it is. # # PATH is passed in as a string and split on a hard-coded ';': this script # only runs on Windows, and the gate feeds Windows-shaped PATHs into it on a # non-Windows pwsh (do not switch to [IO.Path]::PathSeparator). # # Return shape (both real-machine failures were here): hits are written to # the PIPELINE, with NO leading comma. Callers always write # [string[]]$x = @(Resolve-CommandOnPath ...) # which wraps exactly once: 0 hits -> empty array, 1 hit -> one-element # array, and $x[0] is a full-path [string]. # - Two versions ago nothing wrapped: a single hit unrolled to a scalar # and $x[0] was its first letter, "C". # - Last version did `return ,@(...)` AND `@(...)` at the call site: two # layers, $x.Count was always 1, $x[0] was the whole array, and the # screen said "you get: System.Object[]". # Gate: scripts/windows_installer_entry_winner_gate.sh (runs this in pwsh). param([string]$Name, [string]$PathString, [string]$PathExt) $exts = @(($PathExt -split ';') | ForEach-Object { $_.Trim() } | Where-Object { $_ -ne '' }) $seen = @{} foreach ($raw in ($PathString -split ';')) { $dir = [Environment]::ExpandEnvironmentVariables($raw.Trim().Trim('"')) # Absolute entries only (X:\... or \\server\share). A relative entry # such as "." depends on where the new terminal stands; unanswerable. if ($dir -notmatch '^([A-Za-z]:\\|\\\\)') { continue } $dir = $dir.TrimEnd('\') $key = $dir.ToLowerInvariant() if ($seen.ContainsKey($key)) { continue } $seen[$key] = $true foreach ($ext in $exts) { $cand = $dir + '\' + $Name + $ext.ToLowerInvariant() if (Test-Path -LiteralPath $cand -PathType Leaf) { $cand } } } } $machinePath = [Environment]::GetEnvironmentVariable('Path', 'Machine') $userPathNow = [Environment]::GetEnvironmentVariable('Path', 'User') # A new terminal's PATH: machine entries first, then user entries. $futurePath = (@($machinePath, $userPathNow) | Where-Object { $_ }) -join ';' # This script does not touch PATHEXT, so this session's is the new terminal's. # PowerShell tries .ps1 before the PATHEXT executables within a directory. $pathExt = $env:PATHEXT if (-not $pathExt) { $pathExt = '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC' } $pathExt = '.PS1;' + $pathExt # Only ask about names we actually just put on disk. $entryNames = @('icloser', 'icli', 'kernelhub-cli', 'devnexus-cli') $shadowed = @() foreach ($n in $entryNames) { # "The copy just installed" is literally the file in the install folder -- # deliberately NOT computed through the resolver above: if resolution is # ever broken (say, it searches the current directory again), "mine" and # "winner" would drift together, still compare equal, and still print OK. $mine = '' foreach ($ext in @('.exe', '.cmd')) { $cand = Join-Path $Dest ($n + $ext) if (Test-Path -LiteralPath $cand -PathType Leaf) { $mine = $cand; break } } if ($mine -eq '') { continue } [string[]]$hits = @(Resolve-CommandOnPath -Name $n -PathString $futurePath -PathExt $pathExt) $winner = '(nothing found on PATH)' if ($hits.Count -gt 0) { $winner = $hits[0] } # -ne on strings is case-insensitive in PowerShell, which is what we # want: Windows paths are. if ($hits.Count -eq 0 -or $winner -ne $mine) { $shadowed += [pscustomobject]@{ Name = $n; Winner = $winner; Mine = $mine; Hits = $hits } } } if ($shadowed.Count -gt 0) { Write-Host '' Write-Host '! Typing the name does NOT get you the copy just installed.' -ForegroundColor Yellow foreach ($e in $shadowed) { Write-Host '' Write-Host (" {0} in a new terminal -- every match in PATH order (the first one runs):" -f $e.Name) -ForegroundColor Yellow if ($e.Hits.Count -eq 0) { Write-Host ' (no match on the PATH a new terminal will have)' -ForegroundColor Yellow } else { foreach ($h in $e.Hits) { if ($h -eq $e.Mine) { Write-Host (" {0} <- the one just installed" -f $h) -ForegroundColor Yellow } else { Write-Host (" {0}" -f $h) -ForegroundColor Yellow } } } Write-Host (" You type {0} and you get: {1}" -f $e.Name, $e.Winner) -ForegroundColor Yellow Write-Host (" Just installed here: {0}" -f $e.Mine) -ForegroundColor Yellow } $machineWins = @($shadowed | Where-Object { $env:ProgramFiles -and $_.Winner.ToLower().StartsWith($env:ProgramFiles.ToLower()) }).Count -gt 0 Write-Host '' Write-Host ' Nothing above was changed for you: this installer does not reorder your' -ForegroundColor Yellow Write-Host ' PATH and does not remove other tools. Pick one:' -ForegroundColor Yellow Write-Host '' Write-Host ' a) Put this install FIRST on your user PATH (new terminals only):' -ForegroundColor Yellow Write-Host (' $d = ''{0}''' -f $Dest) -ForegroundColor Yellow Write-Host ' $p = ([Environment]::GetEnvironmentVariable(''Path'',''User'') -split '';'' | Where-Object { $_ -and $_ -ne $d }) -join '';''' -ForegroundColor Yellow Write-Host ' [Environment]::SetEnvironmentVariable(''Path'', ($d + '';'' + $p), ''User'')' -ForegroundColor Yellow if ($machineWins) { Write-Host ' ^ this alone will NOT be enough here: the copy winning is on the' -ForegroundColor Yellow Write-Host ' MACHINE PATH, and Windows consults that before any user entry.' -ForegroundColor Yellow } Write-Host '' Write-Host ' b) Or remove the copy that is winning. Which command depends on who' -ForegroundColor Yellow Write-Host ' owns it -- look at its path above:' -ForegroundColor Yellow Write-Host ' ...\AppData\Roaming\npm\... -> npm ls -g then npm rm -g ' -ForegroundColor Yellow Write-Host ' C:\Program Files\KernelHub\ -> Settings > Apps > KernelHub > Uninstall' -ForegroundColor Yellow Write-Host ' another KernelHub folder -> delete that folder, or its PATH entry' -ForegroundColor Yellow Write-Host '' Write-Host ' c) Or change nothing and address this copy directly:' -ForegroundColor Yellow Write-Host (' & ''{0}'' version' -f $exe) -ForegroundColor Yellow Write-Host (' Set-Alias icloser ''{0}'' (add it to $PROFILE to make it stick)' -f $exe) -ForegroundColor Yellow Write-Host '' Write-Host ' The install itself is fine. This is about which name reaches it.' -ForegroundColor Yellow } else { Ok 'Typing icloser / icli gets you this install (checked against a new terminal''s PATH and PATHEXT)' } # <<< ENTRY-WINNER-CHECK END # --------------------------------------------------------------------- # 6. Prove it runs, and that it is the build the manifest promised # # Running it without checking the output would let a version mismatch # look exactly like success, right up until some feature is missing. # --------------------------------------------------------------------- try { $said = (& $exe version 2>&1 | Out-String).Trim() } catch { Fail 'Installed, but it does not run' @($_.Exception.Message) } if ($LASTEXITCODE -ne 0) { Fail "Installed, but 'icloser version' exited with $LASTEXITCODE" @($said) } if ($said -notlike "*$($mf.version)*") { Fail "The installed binary reports '$said' but the manifest says v$($mf.version)" @( 'The artifacts on the server are not the batch the manifest describes.') } if ($said -notlike "*$($mf.build)*") { Fail "Build number mismatch: '$said' vs manifest build $($mf.build)" } Ok $said # --------------------------------------------------------------------- # 6b. Method skill pack (skills/) -- installed NEXT TO the executable. # # The loader (skillpack.go) resolves the skills root as: explicit > # $KERNELHUB_SKILLS_DIR > skills/ beside the executable > workspace/cwd. # Shipping the CLI without skills/ leaves the loading surface empty # ("skills root not found"), so this step is part of the product, not an # extra. Per-file SHA-256 comes from the manifest (stable.json skills # files), re-hashed at package time -- nothing is hard-coded here. # # A declared-but-unverifiable part fails the whole install: half a skill # surface is worse than none, because it looks installed. Same gate # discipline as the binary above. # --------------------------------------------------------------------- if ($mf.PSObject.Properties.Name -contains 'skills' -and $mf.skills.files) { $skillsRoot = Join-Path $Dest 'skills' if (Test-Path $skillsRoot) { Remove-Item -Recurse -Force $skillsRoot } New-Item -ItemType Directory -Force -Path $skillsRoot | Out-Null $sCount = 0 foreach ($sp in $mf.skills.files.PSObject.Properties) { $sRel = $sp.Name $sMeta = $sp.Value $sUrl = "$Base/$($mf.path)skills/$sRel" $sTmp = Join-Path $env:TEMP 'kernelhub-skill-part.bin' try { Invoke-WebRequest -Uri $sUrl -OutFile $sTmp -UseBasicParsing -TimeoutSec 120 } catch { Fail "Skill part '$sRel' failed to download: $($_.Exception.Message)" @( 'The manifest lists it but the server does not serve it.', 'Not installing half a skill surface -- tell whoever shipped this release.') } $sGot = (Get-FileHash -Path $sTmp -Algorithm SHA256).Hash.ToLower() if ($sGot -ne "$($sMeta.sha256)".ToLower()) { Remove-Item -Force $sTmp -ErrorAction SilentlyContinue Fail "Skill part '$sRel' SHA-256 mismatch (manifest $($sMeta.sha256), got $sGot)" @( 'The downloaded bytes are not the ones the manifest vouches for.') } $sDst = Join-Path $skillsRoot ($sRel -replace '/', '\') New-Item -ItemType Directory -Force -Path (Split-Path -Parent $sDst) | Out-Null Move-Item -LiteralPath $sTmp -Destination $sDst -Force $sCount++ } Ok ("skills/: {0} parts beside the executable, per-file SHA-256 verified" -f $sCount) } else { Fail 'This manifest ships no skills section -- the skill loading surface would be empty' @( 'The skills tree is part of the product (skillpack.go resolves skills/ beside the executable).', 'Refusing to install a hollow product; tell whoever shipped this release.') } # --------------------------------------------------------------------- # 7. Local management console (kernelhub-desktop) # # Before 2026-08-22 this script installed only icloser, while the console # is a separate executable. The result was the P0 a user hit: install, # run `icloser run`, the executor is fine -- and the local management web # is nowhere, because the machine simply does not have that program. # # It is a single file: the UI is //go:embed-ed into the binary, so there # are no static assets to ship alongside it. # # A failure here does NOT fail the install. The CLI is the main path -- # without the console you can still pair and run tasks. Making it fatal # would let one flaky download roll back a perfectly good installation. # --------------------------------------------------------------------- $deskOk = $false $deskPort = 18092 $desk = $null if ($mf.PSObject.Properties.Name -contains 'desktop') { $desk = $mf.desktop.$plat } if ($desk -and $desk.port) { $deskPort = $desk.port } if (-not $desk -or $desk.status -ne 'READY') { $why = if ($desk) { $desk.status } else { 'not in this manifest' } Write-Host " ! Local management console not shipped for ${plat} ($why) -- CLI only" -ForegroundColor Yellow } else { $dtmp = Join-Path $env:TEMP ("kernelhub-desktop-{0}-{1}.exe" -f $mf.version, $mf.build) $dOK = $true try { Invoke-WebRequest -Uri "$Base/$($mf.path)$($desk.file)" -OutFile $dtmp -UseBasicParsing -TimeoutSec 600 } catch { # Soft failure (the CLI is the main path and must not roll back), # but a soft failure still has to say WHICH failure it is. $dStatus = $null try { $dr = $_.Exception.Response if ($dr) { $dStatus = [int]$dr.StatusCode } } catch { } if ($dStatus) { Write-Host " ! The server has no management console artifact (HTTP $dStatus) -- CLI only" -ForegroundColor Yellow Write-Host " Retrying will not help: the manifest lists it and the server does not have it." -ForegroundColor Yellow } else { Write-Host " ! The management console transfer was cut short -- CLI only" -ForegroundColor Yellow Write-Host " Nothing is wrong with it on the server. Run the same command again to pick it up." -ForegroundColor Yellow } $dOK = $false } if ($dOK) { $dgot = (Get-FileHash -Path $dtmp -Algorithm SHA256).Hash.ToLower() # Same strictness as the CLI: the console can read workspace tokens, # so an unverified one is no safer than an unverified CLI. if ($dgot -ne $desk.sha256.ToLower()) { Remove-Item $dtmp -Force -ErrorAction SilentlyContinue Write-Host " ! Management console SHA-256 mismatch, discarded" -ForegroundColor Yellow $dOK = $false } } if ($dOK) { # Same locked-file rule as the CLI above (W-7): on an upgrade the # console may be running too. Never let it kill the whole install -- # the CLI is already in place by now. $dexe = Join-Path $Dest 'kernelhub-desktop.exe' try { if ((Install-ExeFile -Source $dtmp -Destination $dexe) -eq 'renamed-aside') { $sidelined += 'kernelhub-desktop.exe' } Ok "Installed to $dexe (local management console)" $deskOk = $true } catch { Write-Host (" ! " + $_.Exception.Message) -ForegroundColor Yellow Write-Host ' The CLI is installed; only the management console was skipped.' -ForegroundColor Yellow } Remove-Item $dtmp -Force -ErrorAction SilentlyContinue } } # Both binaries are placed by now -- say it once, here, whether one or both # had to be renamed aside. Show-LockedExeNotice -Names $sidelined if ($deskOk) { Write-Host '' Write-Host 'Local management console (runtimes / permissions / environment / status):' Write-Host ' kernelhub-desktop' Write-Host " Then open http://127.0.0.1:$deskPort/ -- it is a separate process, not started by 'icloser run'." } # --------------------------------------------------------------------- # 8. Install one AI runtime -- otherwise the install is a dead end # # Until now this script installed only KernelHub itself. So the first task a # fresh user dispatched came back with "no runtime on this machine can run # it -- claude / codex / qwen ... all NOT_INSTALLED". The product was # installed and could not take a single step. That is a loop: you need a # runtime to run a task, and the user believed one command was the install. # # Installing one BY DEFAULT is a fallback so the machine can start working. # It does NOT narrow support down to one vendor: the table below covers every # row of runtimeRegistry, and KERNELHUB_RUNTIME= picks any of them. # # Four rules, none of them optional: # 1. Failing here MUST NOT fail the install. Installing KernelHub is this # script's job. No npm / no network / npm errors out -> warn, continue. # Making it fatal would let one flaky npm roll back a good install. # 2. Do NOT install Node. Every platform installs it differently; bundling # that would make this installer heavy and its failures harder to read. # No npm -> say so plainly and give the next step. # 3. Already installed -> leave it alone. The copy the user has is probably # already logged in; reinstalling cannot improve that and might break it. # 4. No second package manager in here: npm only. Anything else is # described, not attempted. Multi-path installs belong to # internal/skillv1, and are not rebuilt here. # # Switches: # $env:KERNELHUB_SKIP_RUNTIME=1 install no runtime at all (CI, opt-out) # $env:KERNELHUB_RUNTIME= install a different one (first table column) # install.sh uses the SAME two names with the SAME meaning. # # Installed is NOT usable: a runtime that has never logged in shows up as # STARTABLE_NOT_AUTHED and still cannot run a task -- which is why the # "next steps" below put "run it once to log in" first. # # The table below is GENERATED from the projection of runtimeRegistry in # server/cmd/icloser/installer_runtime_table.go. Hand-editing it does # nothing: TestInstallerRuntimeTable_* turns red. Regenerate with # cd server; KERNELHUB_WRITE_INSTALLER_TABLE=1 ` # go test -run TestInstallerRuntimeTable ./cmd/icloser/ # Columns: kind|method|package|bin|note # --------------------------------------------------------------------- # >>> KERNELHUB RUNTIME TABLE (generated) >>> $KernelhubRuntimeDefault = 'claude' $KernelhubRuntimeTable = @' claude|npm|@anthropic-ai/claude-code|claude| codex|npm|@openai/codex|codex| gemini|retired||gemini|retired: Google no longer ships a standalone loggable gemini CLI. Use agy instead. agy|none||agy|a native binary with no package manifest -- get it from Google Antigravity, we will not guess a URL. qwen|npm|@qwen-code/qwen-code|qwen| codebuddy|npm|@tencent-ai/codebuddy-code|codebuddy| opencode|npm|opencode-ai|opencode| kimi|npm|@moonshot-ai/kimi-code|kimi| mimo|npm|@mimo-ai/cli|mimo| pi|npm|@earendil-works/pi-coding-agent|pi| ohmypi|none||omp|npm has an oh-my-pi package but its version does not match omp -- not the same thing, so we do not install it. acp|none|||ACP is a protocol, not an executable -- there is nothing to install. mcp|none|||MCP is a protocol, not an executable -- there is nothing to install. khub|none|||built in: our own in-process runtime ships with the CLI -- nothing to install; configure a model API endpoint to enable it. '@ # <<< KERNELHUB RUNTIME TABLE <<< function Get-RuntimeRow { param([string]$Kind) foreach ($line in ($KernelhubRuntimeTable -split "`n")) { $line = $line.Trim() if ($line -eq '') { continue } $f = $line.Split('|') if ($f[0] -eq $Kind) { return [pscustomobject]@{ Kind = $f[0]; Method = $f[1]; Package = $f[2]; Bin = $f[3]; Note = $f[4] } } } return $null } function Get-RuntimeNpmKinds { $names = @() foreach ($line in ($KernelhubRuntimeTable -split "`n")) { $line = $line.Trim() if ($line -eq '') { continue } $f = $line.Split('|') if ($f[1] -eq 'npm') { $names += $f[0] } } return ($names -join ' ') } $runtimeKind = $KernelhubRuntimeDefault if ($Runtime -ne '') { $runtimeKind = $Runtime } elseif ($env:KERNELHUB_RUNTIME) { $runtimeKind = $env:KERNELHUB_RUNTIME } $runtimeState = '' $runtimePkg = '' $runtimeBin = '' $runtimeNote = '' $npmOut = '' $skipEnv = $env:KERNELHUB_SKIP_RUNTIME if ($SkipRuntime) { $runtimeState = 'skipped' } elseif ($skipEnv -and @('1','true','TRUE','yes','YES','on','ON') -contains $skipEnv) { $runtimeState = 'skipped' } if ($runtimeState -eq '') { $row = Get-RuntimeRow -Kind $runtimeKind if (-not $row) { $runtimeState = 'unknown-kind' } else { $runtimePkg = $row.Package $runtimeBin = $row.Bin $runtimeNote = $row.Note if ($row.Method -ne 'npm') { $runtimeState = 'not-installable' } } } if ($runtimeState -eq '' -and $runtimeBin -ne '') { if (Get-Command $runtimeBin -ErrorAction SilentlyContinue) { $runtimeState = 'present' } } if ($runtimeState -eq '') { if (-not (Get-Command npm -ErrorAction SilentlyContinue)) { $runtimeState = 'no-npm' } } if ($runtimeState -eq '') { Write-Host "Installing runtime $runtimeKind (npm install -g $runtimePkg) ..." # npm writes progress to stderr. With ErrorActionPreference = 'Stop', # redirecting a native command's stderr into the success stream raises # NativeCommandError in Windows PowerShell 5.1 -- the install would die # on npm being chatty rather than on npm failing. Drop to 'Continue' # around the call and judge the outcome by $LASTEXITCODE alone. $prevEAP = $ErrorActionPreference $ErrorActionPreference = 'Continue' $npmRc = 1 try { $npmOut = (& npm install -g $runtimePkg 2>&1 | Out-String) $npmRc = $LASTEXITCODE } catch { $npmOut = $_.Exception.Message $npmRc = 1 } $ErrorActionPreference = $prevEAP if ($npmRc -eq 0) { $runtimeState = 'installed' } else { $runtimeState = 'failed' } } switch ($runtimeState) { 'present' { Ok ("{0} is already installed ({1}) -- not reinstalling" -f $runtimeKind, (Get-Command $runtimeBin).Source) } 'installed' { Ok "Installed runtime: $runtimeKind ($runtimePkg)" } 'skipped' { Write-Host ' - KERNELHUB_SKIP_RUNTIME is set -- no runtime was installed' -ForegroundColor Yellow } 'unknown-kind' { Write-Host " ! Unknown KERNELHUB_RUNTIME=$runtimeKind -- no runtime was installed (KernelHub itself is installed)" -ForegroundColor Yellow Write-Host (" This installer can install: {0}" -f (Get-RuntimeNpmKinds)) -ForegroundColor Yellow } 'not-installable' { Write-Host " ! This installer cannot install $runtimeKind (KernelHub itself is installed)" -ForegroundColor Yellow if ($runtimeNote) { Write-Host " $runtimeNote" -ForegroundColor Yellow } Write-Host (" This installer can install: {0}" -f (Get-RuntimeNpmKinds)) -ForegroundColor Yellow } 'no-npm' { Write-Host ' ! No npm on this machine, so no runtime was installed (KernelHub itself is installed)' -ForegroundColor Yellow Write-Host ' Install Node.js (it ships npm), then run this installer again.' -ForegroundColor Yellow } 'failed' { Write-Host " ! npm could not install $runtimePkg -- no runtime was installed (KernelHub itself is installed)" -ForegroundColor Yellow if ($npmOut) { $lines = @(($npmOut -split "`n") | ForEach-Object { $_.TrimEnd() } | Where-Object { $_ -ne '' }) if ($lines.Count -gt 5) { $lines = $lines[($lines.Count - 5)..($lines.Count - 1)] } foreach ($l in $lines) { Write-Host " $l" -ForegroundColor Yellow } } } } # --------------------------------------------------------------------- # 9. Next steps # # "Installed" is not the finish line. Whether this machine can take a task # depends on there being a LOGGED-IN runtime, so this screen branches on the # actual runtime state instead of telling everyone the same thing. # --------------------------------------------------------------------- Write-Host '' Write-Host 'Next:' if ($runtimeState -eq 'installed') { Write-Host ' 1. Log the runtime in (once). Installed but not logged in still cannot run tasks:' Write-Host " $runtimeBin" Write-Host ' Follow the prompts, then exit it.' } elseif ($runtimeState -eq 'present') { Write-Host " 1. Make sure $runtimeKind is logged in -- if it never was, run $runtimeBin once." } elseif ($runtimeState -eq 'no-npm') { Write-Host ' 1. There is no logged-in AI runtime on this machine. Without one, every task' Write-Host ' comes back as "no runtime here can run it" -- that is not KernelHub being' Write-Host ' broken. Install Node.js (it ships npm), then run this installer again:' Write-Host ' irm https://icloser.xyz/install.ps1 | iex' } else { Write-Host ' 1. There is no logged-in AI runtime on this machine. Without one, every task' Write-Host ' comes back as "no runtime here can run it" -- that is not KernelHub being' Write-Host ' broken. Install one:' Write-Host " `$env:KERNELHUB_RUNTIME='$KernelhubRuntimeDefault'; irm https://icloser.xyz/install.ps1 | iex" } Write-Host ' 2. In your project directory:' Write-Host ' icloser pair # create a workspace, show a QR code, scan it with the app' Write-Host ' icloser doctor # service, gateway, queue, permissions, runtimes -- all at once' # Other runtimes. DO NOT DROP THIS PARAGRAPH: without it, "installs one by # default" reads as "KernelHub only supports that one" -- and AI employees # need all of them to work. Write-Host '' Write-Host 'Want a different one (same installer, and it needs a login too):' Write-Host ' icloser env bootstrap # once KernelHub is installed, use this' Write-Host ' $env:KERNELHUB_RUNTIME=''''; irm https://icloser.xyz/install.ps1 | iex' Write-Host (" kinds: {0}" -f (Get-RuntimeNpmKinds)) Write-Host ' none at all: $env:KERNELHUB_SKIP_RUNTIME=1' Write-Host ' icloser runtimes lists what this machine recognises and which are logged in.' Write-Host '' Write-Host 'To keep it running after you close the terminal, in your project directory (after pairing):' # Teach `daemon install` (a scheduled task that starts when you sign in, runs as # you, needs no admin and no password; verified on a real Windows machine, # 2026-09-16, R13b). Same wording as the "from zero" help page, step 13. # # DO NOT print a copyable Windows-service line with a password placeholder here # (v1.1 LEDGER 12q, credential-leak family): the password can currently only be # given on the command line, so whatever the user types lands in PowerShell # history and the process command line -- on 2026-09-16 a real sign-in password # ended up in a session log exactly that way. `service install` with no # arguments refuses and prints the line to fill in itself; name it bare. Write-Host ' icloser daemon install # starts when you sign in, runs as you; no admin, no password' Write-Host ' icloser daemon status # check on it any time' Write-Host ' Only a machine that must take work with nobody signed in needs the Windows service' Write-Host ' (icloser service install, admin PowerShell, your own MACHINE\user account; do not install' Write-Host ' both). It currently takes the password on the command line, where it stays in your' Write-Host ' PowerShell history -- see the help page before using it.' # --------------------------------------------------------------------- # 10. Say the unsigned thing out loud (2026-09-22, v1.1 LEDGER S10) # # This installer already verified SHA-256 against stable.json before it # installed anything (step 4), so the bytes on disk are accounted for. # But the moment the user next double-clicks kernelhub-desktop.exe from # Explorer, SmartScreen shows "Windows protected your PC" -- and nothing # on this path warned him. Somebody who was not told reads that dialog as # "this download is malware" and stops there; the product ends at that # screen. So say it now, while the terminal is still in front of him. # # Never claim the file "is safe": that is not ours to promise, and a # promise we cannot keep is worse than none. Say what he can check # himself instead. Judges WS12 / WS13 pin both halves of that. # --------------------------------------------------------------------- Write-Host '' Write-Host 'About "Windows protected your PC":' Write-Host ' These binaries are NOT code-signed -- we have not bought a Windows code' Write-Host ' signing certificate. Windows calls us an unknown publisher the first time' Write-Host ' you launch kernelhub-desktop.exe from Explorer. Click "More info", then' Write-Host ' "Run anyway".' Write-Host ' This installer already checked the SHA-256 against the published manifest.' Write-Host ' You can repeat that check yourself at any time:' Write-Host (' Get-FileHash ''{0}'' -Algorithm SHA256' -f $exe) Write-Host ' and compare it with the hash shown on the download page.'