This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I tried to use the uninstalled() of my class which extends from ModuleInstall. But it doesn't seem to get called when my module is being uninstalled by the Plugins Manager. I'm attaching the code for reference.
Created attachment 56956 [details] example code
That's true. uninstalled() will be called if the module is uninstalled (or disabled) _while the IDE is running_. The 6.0 Plugin Manager never does this, since it was found to be often unreliable; it just shuts down the IDE, deletes the module, and restarts. The module system is behaving correctly, but perhaps the PM could explicitly call the uninstalled() method before shutting down when module deletion (or disablement) is scheduled. Anyway I am tempted to mark this WONTFIX since in general modules should not use uninstalled() to begin with. They may use restored() to run code during startup, and close()/closing() during shutdown, but there is no guarantee they will be notified in advance that they will be uninstalled, since this can always happen when the IDE is not running. I will therefore deprecate uninstalled(), just as installed() and updated() were already: #5d1141abb4f0 In your case, your use of NbPreferences to track installation state is unreliable and wrong. All you can do is check in restored() if the files are already there, and if not, install them. Of course far better would be to remove the ModuleInstall entirely and rework the registration system so that it is purely declarative, using either the XML layer or Lookup as appropriate; this would avoid running code on startup when your module is not being used, and relieve you of the need for any special logic.
Not in our plan to fix it.