Skip to content

Please support running a pre_uninstall script #2277

Closed
@PaulStoffregen

Description

@PaulStoffregen

Describe the request

Please add the ability for platforms to provide a pre_uninstall script.

Similar to the post_install script feature which is run after Boards Manager finishes installing a platform, which allows installing drivers or other system setup, a pre_uninstall script would be run before uninstalling to allow for removal of drivers, stopping any background programs, closing any network connections (even if only localhost between programs) and any other special cleanup which should be performed before the platform files are removed.

Describe the current behavior

While any platform could benefit, pre_uninstall is particularly needed by the Teensy platform on Windows. A background process is started during upload and left running to allow subsequent uploads to run quickly. If this process is still running during uninstall, Windows may not allow the platform files to be deleted. The uninstall silently fails, and subsequent install can then also fail.

Arduino CLI version

Version: 0.34.0 Commit: 304d48c Date: 2023-08-22T15:54:20Z

Operating system

N/A

Operating system version

any

Additional context

No response

Issue checklist

  • I searched for previous requests in the issue tracker
  • I verified the feature was still missing when using the nightly build
  • My request contains all necessary details

Metadata

Metadata

Labels

topic: codeRelated to content of the project itselftype: enhancementProposed improvement

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions