Skip to content

Don't crash on a channel folder Windows won't let us check (#595) - #596

Draft
Osiris-DevWorks wants to merge 1 commit into
release/3.1.0from
claude/project-thread-mpo7ig
Draft

Osiris-DevWorks wants to merge 1 commit into
release/3.1.0from
claude/project-thread-mpo7ig

Conversation

@Osiris-DevWorks

Copy link
Copy Markdown
Owner

Requested by Amr · project thread

Fixes #595.

Problem

With PTU or HOTFIX linked to LIVE, the first launch after each update crashed with OSError: [WinError 448] ... untrusted mount point: '...\PTU\Data.p4k'. The second launch worked.

Setup runs as admin, and the "Launch Smart Citizen" checkbox at the end had no runasoriginaluser, so that launch was elevated too. Windows won't let an elevated process follow a link a normal user made. Path.exists() only swallows a few Windows errors, so 448 got through AppSettings.get_available_channels() and crashed the app. The in-app auto-update relaunch already uses ExecAsOriginalUser, so only the manual installer path was hit.

Changes

  • src/utils/settings.py: new _p4k_exists() catches OSError, logs a warning and treats the channel as not installed. get_available_channels() uses it.
  • installer.iss: runasoriginaluser on the [Run] launch entry, so the app never starts as admin from Setup.
  • tests/test_channel_layout.py: test_unreadable_channel_counts_as_missing.

No special handling for links. Normal installs behave the same as before.

Testing

  • New test passes. The rest of test_channel_layout.py and test_sc_install_root.py fail the same way with or without this change on Linux (they need Windows), so run them on Windows CI.
  • Still needs a manual check: install over 3.0.1 with "Launch Smart Citizen" ticked and confirm the app runs unelevated (Task Manager, "Elevated" column = No).

Generated by Claude Code

@Osiris-DevWorks Osiris-DevWorks self-assigned this Nov 19, 2026
@Osiris-DevWorks Osiris-DevWorks mentioned this pull request Nov 20, 2026
@Osiris-DevWorks Osiris-DevWorks added the 3.1.0 label Nov 20, 2026 — with Claude
A PTU folder linked to LIVE crashed the first launch after an update with
WinError 448. Setup's "Launch Smart Citizen" ran the app as admin, and
Windows won't let an elevated process follow a link a normal user made.
Path.exists() lets that error through.

- get_available_channels() treats a Data.p4k it can't check as missing.
- The installer's launch entry runs as the original user.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011hqxFfH6SHBcWCQMC5hLfC
@Osiris-DevWorks
Osiris-DevWorks force-pushed the claude/project-thread-mpo7ig branch from 41d351a to 38f9be5 Compare November 20, 2026 13:50
@Osiris-DevWorks
Osiris-DevWorks changed the base branch from release/3.0.2 to release/3.1.0 November 20, 2026 13:50

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants