Skip to content

Commit 0ea0a0f

Browse files
1.2.8: reliable Claude Desktop restart, package layout
- install.ps1 finds Claude Desktop by its package family (Start menu, then the package list) and works out how to start it before stopping it; when it cannot, Claude is left running. Per-user installs start through their launcher. The restart question shows the version again. - pack.ps1 resolves -OutDir to a full path, so release packages no longer nest their files under xpp-lens/xpp-lens/dist/xpp-lens
1 parent 9bf8841 commit 0ea0a0f

4 files changed

Lines changed: 63 additions & 12 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@
33
All notable changes to xpp-lens (called xpp-graft up to 1.2.0). Versions follow `<Version>` in
44
`src/XppLens/XppLens.csproj`; release tags are `vX.Y.Z`.
55

6+
## 1.2.8 — 2026-10-14
7+
8+
### Fixed
9+
- Restarting Claude Desktop at the end of an update could close Claude and fail to start it again ("Cannot process
10+
argument transformation on parameter 'Package'"): after Claude had updated itself, the running process was in an
11+
older version folder than the installed package, so the package was not found. The application is now found by
12+
its package family (from the Start menu, then the package list) and the way to start it is worked out before Claude
13+
is stopped — if it cannot be, Claude is left running with a note to restart it yourself. Per-user installations
14+
start through their launcher, which always runs the current version.
15+
- The restart question did not show the new version (`$version?` is a different variable in PowerShell).
16+
- Release packages since 1.2.5 nested their files as `xpp-lens/xpp-lens/dist/xpp-lens/…` because the release
17+
workflow passes a relative output folder; `pack.ps1` now works with the full path. Updating was not affected (the
18+
updater finds `install.ps1` at any depth), unpacking by hand was.
19+
620
## 1.2.7 — 2026-10-13
721

822
### Added

‎install.ps1‎

Lines changed: 46 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,38 @@ $ErrorActionPreference = 'Stop'
5050
function Say($m) { Write-Host " $m" }
5151
function Head($m) { Write-Host "`n$m" -ForegroundColor Cyan }
5252

53+
# How to start Claude Desktop again, from the path of its running process; $null when it cannot be worked out.
54+
function Get-ClaudeStart([string]$appPath) {
55+
if ($appPath -match '\\WindowsApps\\(?<folder>[^\\]+)\\') {
56+
# Store / MSIX app, started through its application id. The folder ("Claude_2.1.0.0_x64__pzs8sxrjxfjjc") gives
57+
# the package family ("Claude_pzs8sxrjxfjjc"); after Claude updated itself the running folder is an older
58+
# version than the installed package, so the family is matched, never the path.
59+
$folder = $Matches['folder']
60+
if ($folder -notmatch '^(?<name>[^_]+)_.*__(?<publisher>[^_]+)$') { return $null }
61+
$family = "$($Matches['name'])_$($Matches['publisher'])"
62+
$aumid = $null
63+
try {
64+
$aumid = (Get-StartApps -ErrorAction Stop | Where-Object { $_.AppID -like "$family!*" } | Select-Object -First 1).AppID
65+
}
66+
catch { }
67+
if (-not $aumid) {
68+
try {
69+
$pkg = Get-AppxPackage -ErrorAction Stop | Where-Object { $_.PackageFamilyName -eq $family } | Select-Object -First 1
70+
if ($pkg) { $aumid = "$family!" + @((Get-AppxPackageManifest $pkg).Package.Applications.Application)[0].Id }
71+
}
72+
catch { }
73+
}
74+
if ($aumid) { return "shell:AppsFolder\$aumid" }
75+
return $null
76+
}
77+
# Per-user install: the launcher above the versioned "app-x.y.z" folders starts the current version.
78+
if ($appPath -match '^(?<root>.+)\\app-[^\\]+\\[^\\]+$' -and (Test-Path (Join-Path $Matches['root'] 'claude.exe'))) {
79+
return (Join-Path $Matches['root'] 'claude.exe')
80+
}
81+
if ($appPath -and (Test-Path $appPath)) { return $appPath }
82+
return $null
83+
}
84+
5385
$src = $PSScriptRoot
5486
if (-not (Test-Path (Join-Path $src 'bin\xpplens.exe'))) {
5587
throw "$src\bin\xpplens.exe not found - run install.ps1 from an unpacked xpp-lens package."
@@ -197,23 +229,26 @@ if ($desktop.Count -gt 0) {
197229
-not ([Environment]::GetCommandLineArgs() | Where-Object { $_ -like '-NonI*' })
198230
if (-not $restart -and $canAsk) {
199231
Write-Host ""
200-
$answer = Read-Host " Claude Desktop is running. Restart it now so all its sessions use $version? Work in progress there is interrupted. [y/N]"
232+
$answer = Read-Host " Claude Desktop is running. Restart it now so all its sessions use ${version}? Work in progress there is interrupted. [y/N]"
201233
$restart = $answer -match '^\s*(y|yes|t|tak)\s*$'
202234
}
203235
if ($restart) {
204-
$appPath = $desktop[0].Path
205-
$desktop | Stop-Process -Force -ErrorAction SilentlyContinue
206-
Start-Sleep -Seconds 2
207-
if ($appPath -match '\\WindowsApps\\') {
208-
# Store / MSIX app: started through its application id, not the exe path.
209-
$pkg = Get-AppxPackage | Where-Object { $_.InstallLocation -and $appPath.StartsWith($_.InstallLocation, [StringComparison]::OrdinalIgnoreCase) } | Select-Object -First 1
210-
$appId = @((Get-AppxPackageManifest $pkg).Package.Applications.Application)[0].Id
211-
Start-Process "shell:AppsFolder\$($pkg.PackageFamilyName)!$appId"
236+
# Worked out before Claude is stopped: when it cannot be started again, it is not stopped either.
237+
$start = Get-ClaudeStart $desktop[0].Path
238+
if (-not $start) {
239+
Say "Claude Desktop could not be located for a restart - it was left running; restart it yourself to use $version."
212240
}
213241
else {
214-
Start-Process $appPath
242+
$desktop | Stop-Process -Force -ErrorAction SilentlyContinue
243+
Start-Sleep -Seconds 2
244+
try {
245+
Start-Process $start -ErrorAction Stop
246+
Say "Claude Desktop restarted."
247+
}
248+
catch {
249+
Say "Claude Desktop was closed but did not start again ($($_.Exception.Message)) - start it from the Start menu."
250+
}
215251
}
216-
Say "Claude Desktop restarted."
217252
}
218253
else {
219254
Say "Claude Desktop: open sessions keep the old version until it is restarted; new sessions use $version."

‎pack.ps1‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ param(
2020
)
2121

2222
$ErrorActionPreference = 'Stop'
23+
# Absolute: ZIP entry names are cut from full paths (a relative -OutDir, as in the release workflow, nested them).
24+
$OutDir = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($OutDir)
2325
$proj = Join-Path $PSScriptRoot 'src\XppLens\XppLens.csproj'
2426
$stage = Join-Path $OutDir 'xpp-lens'
2527
$env:DOTNET_CLI_TELEMETRY_OPTOUT = '1'

‎src/XppLens/XppLens.csproj‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<AssemblyTitle>xpp-lens — X++ code index for MCP</AssemblyTitle>
2121
<Description>X++ (Dynamics 365 F&amp;O) code index served to AI assistants over MCP</Description>
2222
<Copyright>Copyright © 2026 WillowDev</Copyright>
23-
<Version>1.2.7</Version>
23+
<Version>1.2.8</Version>
2424
</PropertyGroup>
2525

2626
<ItemGroup>

0 commit comments

Comments
 (0)