Closed general

Add altium_uninstall_library (inverse of install_library); no way to remove an installed library today

John Lauer · 28d ago ·closed by Colby Knox

Ask

Add altium_uninstall_library {libraryPath | libraryName}, the inverse of altium_install_library / altium_install_library_bundle. Today a library can be installed but not removed, so the only ways out are clicking through Components › File-based Libraries Preferences or hand-running DelphiScript through altium_eval.

Why it came up

Preparing a from-scratch demo on ConfRoomROG (Altium Designer Develop, bridge 0.2.40): an earlier run had installed Adom_ToF (SchLib + PcbLib) and it had to go so the new run would build its library fresh rather than reuse it on camera. There was no verb, and deleting the files is worse: the contract says so itself (altium_install_library pitfall: "moving or deleting it later leaves a dead entry").

Suggested contract

  • input: libraryPath (exact registered path) or libraryName (matches every installed library whose file stem equals it, i.e. both X.SchLib and X.PcbLib), dryRun bool.
  • output: removed: [path], remaining: int, notInstalled: bool.
  • implementation: IntegratedLibraryManager.UninstallLibrary(path) after matching against InstalledLibraryPath(i) for i < InstalledLibraryCount. Library files are never touched.
  • behaviour: background like install_library (no foreground steal, see #12). Answer notInstalled:true rather than failing when nothing matches, so a cleanup script can call it twice without erroring.
  • companion: altium_list_installed_libraries (read-only) so a caller can check before and after without a screenshot.

Also worth covering

altium_install_library_bundle receipts could record the registered paths, so an uninstall can remove exactly what a bundle added.

2 Replies

John Lauer · 28d ago

Did it by hand on ConfRoomROG (ADDevelop, 0.2.40) with a one-shot .PrjScr through altium_run_script. What a real verb has to handle:

  • IntegratedLibraryManager.InstalledLibraryCount / InstalledLibraryPath(i) / UninstallLibrary(path) all work on Develop. UninstallLibrary takes effect live (count 6 -> 4).
  • The removal does NOT persist unless Altium shuts down cleanly. Each installed SchLib is loaded as an open document and comes up "modified" (Confirm Save Locally for (2) Modified Documents: Adom_Test.SchLib, Adom_ToF.SchLib, never edited). Answering that with altium_close {discardChanges:true} exited Altium (one run close_timeout) and the uninstall was lost on the next launch, twice.
  • What worked: altium_close_document on each open library doc first, then a plain altium_close (7.1 s, no prompt).
  • Also seen: the first -R hand-off left a SECOND Altium instance up (pid 88608 beside the launched 86576), and the uninstall ran in the one that was then closed via discard.

So altium_uninstall_library should close any open document whose path it unregisters, then verify with a relaunch-free read-back, and the docs should warn that a discard close can drop library-registration changes.

Colby Knox · 6d ago

Added in 0.2.45 (insiders): altium_uninstall_library {libraryName | libraryPath, dryRun} and altium_list_installed_libraries, as you specced. It closes any open document for the library first, never touches the files, and answers notInstalled:true when nothing matches. Verified live including a clean close and relaunch: the removal persisted. The docs warn that a discard close can bring an entry back.

Log in to reply.