Skip to content

fix(launch): detect MSIX TradingView by wildcard, not exact package name#366

Open
iamdrsid1 wants to merge 1 commit into
tradesdontlie:mainfrom
iamdrsid1:fix/windows-msix-detection
Open

fix(launch): detect MSIX TradingView by wildcard, not exact package name#366
iamdrsid1 wants to merge 1 commit into
tradesdontlie:mainfrom
iamdrsid1:fix/windows-msix-detection

Conversation

@iamdrsid1

Copy link
Copy Markdown

Problem

On Windows, tv launch (and the tv_launch MCP tool) fail with "TradingView not found on win32" even when TradingView Desktop is installed as an MSIX/Store package.

The MSIX detection in src/core/health.js queries:

(Get-AppxPackage -Name 'TradingView.Desktop').InstallLocation

But the installed package name is publisher-prefixed — e.g. 31178TradingViewInc.TradingView — so the exact -Name 'TradingView.Desktop' match returns nothing. Detection then falls through to the legacy install paths (%LOCALAPPDATA%\TradingView, %PROGRAMFILES%\TradingView, …), none of which exist for a Store install, and throws.

Real install observed:

C:\Program Files\WindowsApps\31178TradingViewInc.TradingView_3.3.0.0_x64__q4jpyh43s5mv6

Fix

Match on a *TradingView* wildcard and select the first install whose folder actually contains TradingView.exe:

Get-AppxPackage *TradingView* | ForEach-Object { $_.InstallLocation } |
  Where-Object { $_ -and (Test-Path (Join-Path $_ 'TradingView.exe')) } |
  Select-Object -First 1

The Test-Path guard avoids picking up an unrelated *TradingView* package that has no launcher. The existing WindowsApps → %LOCALAPPDATA% local-copy fallback (for the "Access is denied" case) is unchanged.

Verification

  • Resolves the real MSIX install via the exact execSync code path (v3.3.0.0).
  • tests/launch.test.js7/7 pass (the mock keys on the Get-AppxPackage substring, so it stays compatible).
  • ESLint clean.

🤖 Generated with Claude Code

Windows launch auto-detection queried `Get-AppxPackage -Name
'TradingView.Desktop'`, but the installed MSIX package name is
publisher-prefixed (e.g. `31178TradingViewInc.TradingView`). The exact
`-Name` match returned nothing, so `tv launch` / `tv_launch` fell through
to the legacy install paths and failed with "TradingView not found on
win32" even when TradingView Desktop was installed.

Match on a `*TradingView*` wildcard and select the first install whose
folder actually contains TradingView.exe. The existing WindowsApps ->
local-copy fallback is unchanged.

Verified against a real MSIX install (v3.3.0.0) and tests/launch.test.js
(7/7 pass; the mock keys on the `Get-AppxPackage` substring, unaffected).
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.

1 participant