Skip to content

[Feature]: Make unregister manifest-aware with safe force retry and lifecycle UX #321

Open

Description

Is your feature request related to a problem? Please describe.

The extension's winapp.unregister command resolves a project directory and runs a bare winapp unregister from that directory. In winapp CLI v0.6.1, the package target is selected from --manifest <path> or by non-recursive manifest auto-detection in the current directory.

This makes the extension's targeting unreliable and asymmetric with registration:

  • winapp run and the debug provider register from a build-output folder, while unregister targets a detected project directory.
  • resolveProjectDirectory detects project files such as .csproj, Cargo.toml, and package.json; it does not detect Package.appxmanifest.
  • The current terminal-based runWinappCommand path returns immediately and does not expose exit status or output, so the extension cannot recognize the CLI's install-location check failure or offer the supported --force recovery.
  • Worktree moves and rebuilds commonly leave a development package registered from a different project tree, causing plain unregister to refuse.

The command only applies to packages registered in development mode, such as packages created by winapp run or create-debug-identity; it does not generally undo installation of a signed MSIX via Add-AppxPackage.

Describe the solution you'd like

Make winapp.unregister manifest-aware and align it with the package registration lifecycle:

  • Resolve the target manifest in the extension and always pass --manifest rather than relying on cwd auto-detection.
  • Prefer the manifest or input folder associated with the most recent winapp run, debug session, or create-debug-identity invocation when that target is still valid.
  • Otherwise scan the workspace for app manifests, select a single result automatically, and prompt when multiple manifests are present. Respect winapp.appDirectories when ranking or restricting candidates.
  • Execute unregister through the capture-based process path with an argument array and inspect its result, preferably using --json if the v0.6.1 payload provides a stable error classification.
  • Run without --force first. If the CLI specifically reports an install-location mismatch, show a warning with an Unregister anyway action that retries once with --force. Do not ask about force up front.
  • Show the manifest-derived package identity/display name while unregistering. Do not add a modal confirmation for the normal path; the force retry is the deliberate confirmation point.
  • Treat an already-unregistered package as an informational no-op, and surface all unrecognized failures with a link/action to the WinApp output channel.
  • Improve discoverability in the run/debug lifecycle, while coordinating with winapp run --unregister-on-exit so users are not prompted twice. Do not add unregister to the packaging completion actions, because packaging/installing an MSIX is a different lifecycle.

Additional context

CLI v0.6.1 schema for unregister exposes:

  • --manifest <path> — path to the Package.appxmanifest; default is auto-detection from the current directory.
  • --force — skip the install-location directory check and unregister even if the package was registered from a different project tree.
  • --json — machine-readable output.

Implementation should verify real unregister --json payloads for success, not-registered, and install-location mismatch before choosing JSON classification versus narrowly tested stderr matching.

Related but not a duplicate: #251 tracks multi-root workspaces generally. This issue focuses on manifest/package targeting, force recovery, and development-package lifecycle UX.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions