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.

Bug 95965 - ModuleInstall.installed() doesn't get called with Auto Updated restart modules
Summary: ModuleInstall.installed() doesn't get called with Auto Updated restart modules
Status: RESOLVED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: Module System (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-19 18:31 UTC by Torbjorn Norbye
Modified: 2008-12-22 11:53 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Torbjorn Norbye 2007-02-19 18:31:21 UTC
I have a module which needs to perform one-time installation steps when
installed via Auto Update.  (I need to launch chmod u+x on some files bundled
with the modul).

I was performing this task in my ModuleInstall#installed method, since I didn't
want to do this on every single IDE start.

But it turns out installed doesn't get called for the Auto Update scenario. (See
issue 95870 for more.)

I'm going to work around this by doing my chmod task from restored() but that's
not a great permanent solution.
Comment 1 Jesse Glick 2007-02-19 19:30:20 UTC
installed() is essentially a leftover from a long-gone revision of the module
system which operated under very different circumstances. Generally it should
not be used since the notion of "installation" of a module is too ambiguous in
the presence of multiple user dirs, shared vs. private installations, version
upgrades, installers vs. AU vs. native packaging, etc. Use restored(); you can
use various means of checking whether something needs to be done again. For
example, an action which needs to be taken once on the userdir can mark a
boolean NbPreferences flag, which is written to the userdir.

In this case you probably need to use the chmod() trick in restored(); though I
would strongly recommend that when running on JDK 6, you use File.canExecute +
.setExecutable, which should be far lower overhead. You can also file an RFE for
AU to maintain executable status declaratively in NBMs.