Skip to content

fix(installer): let --uninstall run when IDA Free is installed - #531

Merged
mrexodia merged 2 commits into
mrexodia:mainfrom
Lesereingrape:fix/ida-free-uninstall-not-blocked
Sep 21, 2026
Merged

mrexodia merged 2 commits into
mrexodia:mainfrom
Lesereingrape:fix/ida-free-uninstall-not-blocked

Conversation

@Lesereingrape

@Lesereingrape Lesereingrape commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Closes #530

Problem

install_ida_plugin() ran its IDA Free license check before it looked at the
uninstall flag, so ida-pro-mcp --uninstall — and --uninstall <client>,
which aborts before _apply_client_install() is ever reached — exited 1 with an
install-only message and removed nothing. --allow-ida-free is documented as
"Allow installation despite IDA Free being installed"
(server.py:274-278), and removing files has no dependency on which license is
present, so the guard can only ever belong to the install path.

The state is easy to reach: --install --allow-ida-free is exactly how a user
with an IDA Free license file in the IDA user directory is expected to install,
and every later cleanup attempt then fails.

Change

One token: the guard becomes if not allow_ida_free and not uninstall:.
Nothing else in the function moves, so installation still refuses to proceed
over an IDA Free license unless --allow_ida_free is passed; that control case
was measured before the test file was removed at review.

Measurements (Windows 11, Python 3.12.11, base cae2fa8)

Same interpreter, same command, base worktree vs this branch:

$ python repro.py            # install_ida_plugin(uninstall=True) with idafree_9.2.hexlic present
base cae2fa8 : SystemExit: 1 | IDA Free does not support plugins and cannot be used. ...
             : plugin still installed: True
this branch  : returned normally
             : plugin still installed: False

A throwaway tests/test_installer_ida_free_uninstall.py (3 tests: removal
despite the license file, the install-refusal control, and run_install_command
continuing to the client step) was measured on this branch's earlier head and
removed at review, so the
branch now carries the one-token guard change:

  • on base, with only that test file copied into a pristine cae2fa8 worktree:
    2 failed, 1 passed — both failures were SystemExit: 1 raised at
    installer.py:485, i.e. they failed on behaviour, not on a mock
  • with the patch: 3 passed

Full suite A/B:

  • base cae2fa8: 1 failed, 248 passed, 114 subtests passed
  • this branch, with that test file present: 1 failed, 251 passed, 114 subtests passed

The single failure in both runs is pre-existing and unrelated:
tests/test_mcp_spec_http_e2e.py::Http11TransportTests::test_single_threaded_stop_closes_idle_keepalive_connection.
So the delta there was +3 tests and 0 new failures; on the current head the
delta is 0 tests and 0 new failures.

ruff check (0.14.0, repo config) reports All checks passed on the changed
file, and the same on installer.py at base.

install_ida_plugin has exactly one caller (run_install_command,
installer.py:650), which server.py:330 reaches from --install/--uninstall
— verified with grep -rn "install_ida_plugin", so the change cannot affect any
other entry point.

Relation to my other open PR

PR #529 also edits installer.py, but only the transport-URL helpers around
lines 140-215; this change touches line 479. The two
branches share no hunk and apply to main independently, in either merge order.

Note on CI

.github/workflows/idalib-tests.yml is the only workflow and it runs
ida-mcp-test inside the IDA containers, not pytest tests, so this suite is
not exercised by CI. To run it without an IDA installation:

uv sync --extra dev    # any env with the package importable
python -m pytest tests -q

Both platform branches of _get_ida_user_dir() feed the same glob check, so
the behaviour is identical on Linux and macOS; only Windows was measured here.

Authorship disclosure

This PR was authored by an AI agent; no human reviewed the diff before
submission. All measurements above were executed and recorded by the agent on
the commits in this branch (1 file, +1/−1 after 9b1dcaa removed the test file
at review).

install_ida_plugin() checked for idafree_*.hexlic before looking at
`uninstall`, so removing the plugin exited 1 with an install-only message
and left every file in place. --allow-ida-free is documented as allowing
*installation*, and an uninstall has no license dependency, so the guard
belongs to the install path only.
Removed at review: the change is a one-line guard in the uninstall path and
the maintainer considers the test unnecessary.
@mrexodia
mrexodia merged commit f692c06 into mrexodia:main Sep 21, 2026
1 check failed

This branch had an error being deployed

1 failed deployment
external-pr — 9b1dcaa5 Deployed Sep 21, 2026 by Lesereingrape via approval #403
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.

--uninstall removes nothing while an IDA Free license file is present

2 participants