If I'm using NBMS to update my application, can I make it deactivate a module that was previously installed?

StackOverflow https://stackoverflow.com/questions/23568687

سؤال

I built our application using the Netbeans Framework. It's working great, we have a bundle of modules that we update using NBM (NetBeans module files).

When we ship out our product, our customers install it, and it comes default pointed to our update center web server. There it pulls the current updates.xml, containing the version number etc and downloads the relevant NBM file to update a module. It works well.

However, we have a module that's out, and I would like to push an update that would deactivate it, or even uninstall it.

I accomplished a quick fix by closing it immediately with this.close(). It's a top component so it opens by default, and it's basically a useless module right not. It causes clutter initially.

That to me is a total hack, there must be a graceful way to accomplish this in the Netbeans NBM delivery system.

I can provide some code, but I'm unsure what is helpful. This is OOB Netbeans framework functionality, so there's not a lot to show.

Thank you

هل كانت مفيدة؟

المحلول

Some ideas:

  • Post to one of NetBeans mailing lists where you can get answer from developers (https://netbeans.org/community/lists/index.html)
  • Add a ModuleInstall class to another module that will run a code as a part of startup procedure. Search lookup for ModuleInfo representing module that should be disabled and call ModuleManager.disable() (likely requires dependency on some internals / non-public API)
  • Keep the module as it is but add another one depending on it and override the top component there (make it non-vosible by default, hide action to show it, ...)
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top