Skip to content

fix(wine): make setup detect a provisioned prefix - #23

Merged
panxuc merged 2 commits into
panxuc:masterfrom
Aibeto:fix/setup-service-detection
Oct 15, 2026
Merged

panxuc merged 2 commits into
panxuc:masterfrom
Aibeto:fix/setup-service-detection

Conversation

@Aibeto

@Aibeto Aibeto commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Two defects made uur setup fail on a fully installed prefix.

  1. The service check matched gameviewerserver.exe, but the Windows service NetEase registers uses GameViewerService.exe as its ImagePath. GameViewerServer.exe is the streaming server and never appears in the service registration, so client_service_registered and query_client_service always returned false. A completed install was reported as "GameViewerService has no valid registered executable" and setup re-downloaded and re-installed every run.

    Both checks now share one SERVICE_IMAGE constant, and the system.reg parse is factored into a pure service_image_path helper so it is testable without a Wine prefix.

  2. wineboot --init returns before wineserver flushes system.reg/user.reg to disk (measured ~7s on Wine 11), so a freshly created prefix was misread as uninitialized and setup aborted with "Wine prefix initialization failed (exit status: 0)". Added a bounded flush_prefix barrier that waits for wineserver -w to return, then polls for the registry files.

Verified on Wine 11.19: a clean install into an isolated prefix succeeds end to end, re-running setup takes the already-provisioned fast path, and setup --repair verifies without reinstalling.

Two defects made `uur setup` fail on a fully installed prefix.

1. The service check matched `gameviewerserver.exe`, but the Windows
   service NetEase registers uses `GameViewerService.exe` as its
   ImagePath. `GameViewerServer.exe` is the streaming server and never
   appears in the service registration, so `client_service_registered`
   and `query_client_service` always returned false. A completed
   install was reported as "GameViewerService has no valid registered
   executable" and setup re-downloaded and re-installed every run.

   Both checks now share one `SERVICE_IMAGE` constant, and the
   `system.reg` parse is factored into a pure `service_image_path`
   helper so it is testable without a Wine prefix.

2. `wineboot --init` returns before wineserver flushes
   `system.reg`/`user.reg` to disk (measured ~7s on Wine 11), so a
   freshly created prefix was misread as uninitialized and setup
   aborted with "Wine prefix initialization failed (exit status: 0)".
   Added a bounded `flush_prefix` barrier that waits for `wineserver -w`
   to return, then polls for the registry files.

Verified on Wine 11.19: a clean install into an isolated prefix
succeeds end to end, re-running setup takes the already-provisioned
fast path, and `setup --repair` verifies without reinstalling.
@Aibeto

Aibeto commented Oct 13, 2026

Copy link
Copy Markdown
Contributor Author

need review again
remind in #28

@panxuc
panxuc merged commit 1dc1567 into panxuc:master Oct 15, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants