Repository navigation
fix(windows): never run in session 0 — skip LaunchApp on silent installs + in-app guard - #6
Merged
Merged
Conversation
…lls + in-app guard GPO machine-context installs run msiexec silently as SYSTEM in session 0 at boot. The LaunchApp custom action fired there too, and the explorer.exe handoff that fixes interactive elevated installs does nothing for it: in session 0 there is no shell, so explorer just runs the exe itself. The result is the worst possible state — a server that binds the port and answers /status, but opens every Explorer window on session 0's invisible desktop, while blocking the user's logon copy from binding. Users see storage links silently "do nothing" until the machine's next plain reboot clears the squatter, then it breaks again on the next version rollout (StirlingMarketingGroup/StirlingMarketingGroup#7436). Two layers, either sufficient alone: - MSI: LaunchApp now requires UILevel >= 4, so silent installs (GPO = 2) never launch during install and rely on the existing HKLM Run value at each user's next logon — the same behavior Dazzle's MSI has always had. Interactive double-click installs keep the instant launch. - Server: exits at startup when running in session 0, so a wrongly launched copy can never squat the port or swallow opens. Rollout heals the fleet: the next GPO upgrade's CloseApplication kills any squatting session-0 copy at boot, nothing relaunches there, and the Run key starts a proper copy at logon. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
LaunchAppcustom action fired there too. The explorer.exe handoff (fix(windows): survive wrong-identity installs — de-elevated MSI launch + access-denied Explorer fallback #5) doesn't help in session 0 — there's no shell, so explorer just runs the exe itself. The resulting copy is worse than not running at all: it binds127.0.0.1:29101and answers/status(clients think it's healthy), but every Explorer window it opens lands on session 0's invisible desktop, and it blocks the user's logon copy from binding the port. Confirmed in the field:tasklist /vshowedfolder-opener.exewithSession Name: Services, Session# 0, User Name: N/Aon an affected machine.LaunchApponly fires during an install/upgrade, so only boots that applied a new MSI version spawn the squatter — the machine stays broken until its next plain reboot, then heals, then re-breaks on the next version rollout. The rapid 0.2.1→0.2.3 release run kept a rotating chunk of the fleet inside the broken window.Changes
MSI (
packaging/windows/folder-opener.wxs)LaunchAppnow requiresUILevel >= 4: silent installs (GPO = UILevel 2) never launch during install and rely on the existing HKLMRunvalue at each user's next logon — the same behavior Dazzle's MSI has always had (it never had a launch action, which is why it never hit this). Interactive double-click installs keep the instant launch, still via the explorer.exe handoff from fix(windows): survive wrong-identity installs — de-elevated MSI launch + access-denied Explorer fallback #5.Server (
main.go,session_windows.go,session_other.go)ProcessIdToSessionId), before binding the port, so a wrongly launched copy can never squat the port or swallow opens — defense in depth if anything else (a service context, future packaging changes) ever launches it there. No-op stub on non-Windows.Rollout
Tag the next release and let GPO apply it: the upgrade's existing
CloseApplicationkills any squatting session-0 copy at boot, the conditionedLaunchAppdoesn't respawn it, and theRunkey starts a proper per-user copy at logon. Every currently-broken machine self-heals with zero manual steps. (Immediate per-machine triage without waiting: elevatedtaskkill /f /im folder-opener.exe, then start it from the Start menu.)Test Plan
go build ./... && go vet ./... && go test ./...GOOS=windows go build -o /dev/null .andGOOS=linux CGO_ENABLED=0 go build -o /dev/null .msiexec /i folder-opener.msi /qnfrom an elevated prompt: nofolder-opener.exeprocess appears; after logoff/logon it runs in the user session with the tray iconpsexec -s -i 0): it exits immediately with the session-0 log line🤖 Generated with Claude Code