Re: Updating the base NetBeans Platform for my application

Boris Heithecker <[email protected]>
Newsgroups gmane.comp.java.netbeans.modules.openide.devel
Message-ID <CAL465REXt4yHD6Jo5LdLh4smFEPKL1UzT8L9=EvQSOFBPKzhBw@mail.gmail.com>
In prinicipal, it should be possible to reuse the official platform update
center of the IDE (url, or fragments of the xml entries) in your own
platform application. Most xml entries in the IDE/platform update center
have a "targetCluster" specified, so, in principal, as stated here (
http://wiki.netbeans.org/FaqPluginManagerCustomization), updated platform
modules should replace the existing ones where they are, i.e. in the
install directory.

However, this works only if you have an "AutoupdateClusterCreator",which is
a service provider, somewhere in your application. Otherwise, all updates
will always be installed in the user dir, regardless if they specify a
"targetCluster" or "global" in updates.xml. Unfortunately, this is not very
well documented. The easiest way to get an AutoupdateClusterCreator was for
me the adapt the sources of default IDE implementation from module
updatecenters, which can be found here:

http://hg.netbeans.org/main/file/37a3793b7675/updatecenters/src/org/
netbeans/modules/updatecenters/resources/NetBeansClusterCreator.java

Basically, you only have to replace "netbeans.clusters" (in currently line
103) with the respective "appname.clusters" file name (in install-dir/etc)
of your application.

Hope it helps.
Boris

2016-11-15 20:26 GMT+01:00 jhuber <[email protected]>:

>
> Peter Hansson wrote:
> > @Johannes: When you update a deployed application using the Update
> Center method all that really gets updated are modules in a writable
> user-specific directory. On Windows that would typically be in %APPDATA%
> somewhere.
> >
> > However, the core of your application doesn't get updated ... because it
> can't. Again using Windows as example the core of your deployed NetBeans
> Platform application lives in %ProgramFiles%.  So whatever you do there
> will always be a core left of your deployed application which is tied to NB
> version you originally released your version on.
> >
>
>
> I have been experimenting with updating platform modules, and I found
> somewhat different behavior than what you describe.  Whether or not the
> "core" platform gets updated seems to depend on where the application is
> installed.
>
> To make a long story short, I have tweaked the Auto Update Services and
> Auto Update UI modules.  I updated the Specification Version number for my
> patched modules by adding a ".1" to the end of the existing number.  In the
> IDE, by opening the Plugins window and navigating to the Settings tab, you
> can find the update center xml file for the NetBeans Distribution, open it
> up, and get the xml fragments necessary to update the patched platform
> modules.  You can add these xml fragments to you own update center xml
> file, modify the fragments as necessary, dump the NBMs into your update
> center, and the platform modules will be updated.
>
> I have two installations of my platform application for testing.  One is
> Windows 7 where the app is installed in the normal Program Files location
> using a Windows Installer.  The other one is installed on a Windows 2012 R2
> server on a data drive that is open to all users.  For this one, I made a
> zip distribution and just dumped it on the drive.
>
> For the Win7 app, it is as you describe above, where the platform in
> Program Files is not touched (can be verified by looking at the creation
> date of the modules in the platform folder).  The patched platform modules
> are found in c:\users\username\AppData\Roaming\.myapp\dev\modules, and
> are apparently loaded from there, because the log shows that my version of
> the two patched platform modules are being loaded.
>
> However, on the server, c:\users\username\AppData\Roaming\.myapp\dev\modules
> is not created.  And looking in the platform folder for the application,
> the creation date of the two patched modules is the date I created them,
> while all the other modules have their original creation date.  So in this
> case, it appears that the modules in the "core" platform are being updated.
>
> So, perhaps if the application is installed to a location that not
> protected by the Windows operating system, the "core" platform would be
> patched???  My next test will be to create a Windows installer that creates
> and installs to a folder directly on c:\, and avoids the Program Files
> folders.
>
> This also raises an issue for applications installed on a server where
> multiple users access the application.  If one is using an update center
> for a NetBeans platform app, and the app is installed "normally" in the
> system-protected Program Files location, it seems that each user would have
> to individually install updates from the update center.  This is probably
> not an ideal situation, since it does not allow for application updates to
> be applied by the server administrator.
>
>
>
>
>


-- 
Boris Heithecker


Dr. Boris Heithecker
Lüneburger Str. 30
28870 Ottersberg
Tel.: 0 42 05/ 31 58 34
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.