You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@netbeans.apache.org by Neil C Smith <ne...@apache.org> on 2021/09/11 18:38:25 UTC

A NetBeans Packager tool?

Hi,

The other week I was re-looking at packaging options for NetBeans (and
RCP).  I experimented with using JPackage, which you might have seen
on the NetBeans twitter.  Bit hacky though, involving two Java
processes, and the lack of some packaging options I want, a few odd
issues, and the lack of some cross-platform support got me thinking
whether an NBPackage tool might be a better approach!

So, I've spent some time over the last few weeks sketching something
out, and moving over / templating out some stuff from my platform Ant
usage.  The intention is to take a NetBeans IDE or platform zip, an
optional Java runtime, and configuration.  Then it builds the required
"image" and passes it to the native packaging tool.  Currently got
AppImage and InnoSetup mostly working, and working on tidying up .deb
and macOS options.  MSI would be good too.

It might provide a useful option for both platform developers, and for
third-parties who want to create IDE installers with JDK included.

Interested in thoughts on this.

Work in progress PR at https://github.com/apache/netbeans-tools/pull/47

README at https://github.com/apache/netbeans-tools/blob/4ffd265475d69fca62b0fa8e4a79db31ffc9f2ad/nbpackage/README.md

Thanks,

Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: A NetBeans Packager tool?

Posted by Neil C Smith <ne...@apache.org>.
On Mon, 13 Sept 2021 at 08:55, Luff, Chris
<Ch...@cerner.com.invalid> wrote:
> Hey Neil, I love solving problems and producing our own may be the path of least resistance, but I wonder if working with the existing JPackage so it closer matches our needs may be a good choice. I’m sure NetBeans cannot be the only solution that needs to solve these issues?
>
> JEP-8208405[1] in progress is looking to enhance with the ability exclude the runtime.

Thanks for the feedback.  However, excluding the runtime is far from
the only problem.  JPackage just does about 75% more than we'd need,
the launcher mechanism particularly.  I'm not sure how easy that would
be to support launching NetBeans / platform in a non-hacky way, or how
much solving that would mesh with needs elsewhere.  And without that,
we're mainly talking about deferring to native packaging tools.

Bear in mind, we do already have our own, in the form of NBI.  I was
thinking this more as a possible (and simpler) alternative to that,
that takes a similar approach to JPackage in terms of using native
packaging tools.  There are a bunch of people, including myself, who
have been doing similar with the platform for a while.

Best wishes,

Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: A NetBeans Packager tool?

Posted by "Luff, Chris" <Ch...@Cerner.com.INVALID>.
Hey Neil, I love solving problems and producing our own may be the path of least resistance, but I wonder if working with the existing JPackage so it closer matches our needs may be a good choice. I’m sure NetBeans cannot be the only solution that needs to solve these issues?

JEP-8208405[1] in progress is looking to enhance with the ability exclude the runtime.

Thx
Luff


[1]: JDK-8208405Application Bundle without including Java Runtime<https://bugs-stage.openjdk.java.net/browse/JDK-8208405>


On 11 Sep 2021, at 22:51, Neil C Smith <ne...@apache.org>> wrote:

On Sat, 11 Sep 2021, 21:43 Scott Palmer, <sw...@gmail.com>> wrote:

What were the problems with using jpackage? It seems like it would be
fairly simple to take an App
Image and JRE image and do this for you.


JPackage is great, but basically does too much. We have our own launchers,
so we don't need that feature. Experiments I did I had a simple jar library
launching the IDE in a child process, which worked but not ideal. Might be
other ways.

We have use cases where we might not want the bundled JDK runtime.

We might want other packaging types. Neither of the ones implemented so far
are in JPackage currently.

There were a few other curious quirks, such as not being able to keep the
IDE jars off the classpath, a problem with spaces in file names, etc.

All in all, this seemed to me a better approach to try.

Best wishes,

Neil



CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024. Cerner Limited, Registered in England no 2519305, Registered Office 37 North Wharf Road, London W2 1AF.

Re: A NetBeans Packager tool?

Posted by Neil C Smith <ne...@apache.org>.
On Sat, 11 Sep 2021, 21:43 Scott Palmer, <sw...@gmail.com> wrote:

> What were the problems with using jpackage? It seems like it would be
> fairly simple to take an App
> Image and JRE image and do this for you.
>

JPackage is great, but basically does too much. We have our own launchers,
so we don't need that feature. Experiments I did I had a simple jar library
launching the IDE in a child process, which worked but not ideal. Might be
other ways.

We have use cases where we might not want the bundled JDK runtime.

We might want other packaging types. Neither of the ones implemented so far
are in JPackage currently.

There were a few other curious quirks, such as not being able to keep the
IDE jars off the classpath, a problem with spaces in file names, etc.

All in all, this seemed to me a better approach to try.

Best wishes,

Neil

Re: A NetBeans Packager tool?

Posted by Scott Palmer <sw...@gmail.com>.
What were the problems with using jpackage? It seems like it would be fairly simple to take an App
Image and JRE image and do this for you. 

Scott

> On Sep 11, 2021, at 2:38 PM, Neil C Smith <ne...@apache.org> wrote:
> 
> Hi,
> 
> The other week I was re-looking at packaging options for NetBeans (and
> RCP).  I experimented with using JPackage, which you might have seen
> on the NetBeans twitter.  Bit hacky though, involving two Java
> processes, and the lack of some packaging options I want, a few odd
> issues, and the lack of some cross-platform support got me thinking
> whether an NBPackage tool might be a better approach!
> 
> So, I've spent some time over the last few weeks sketching something
> out, and moving over / templating out some stuff from my platform Ant
> usage.  The intention is to take a NetBeans IDE or platform zip, an
> optional Java runtime, and configuration.  Then it builds the required
> "image" and passes it to the native packaging tool.  Currently got
> AppImage and InnoSetup mostly working, and working on tidying up .deb
> and macOS options.  MSI would be good too.
> 
> It might provide a useful option for both platform developers, and for
> third-parties who want to create IDE installers with JDK included.
> 
> Interested in thoughts on this.
> 
> Work in progress PR at https://github.com/apache/netbeans-tools/pull/47
> 
> README at https://github.com/apache/netbeans-tools/blob/4ffd265475d69fca62b0fa8e4a79db31ffc9f2ad/nbpackage/README.md
> 
> Thanks,
> 
> Neil
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
> 
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: A NetBeans Packager tool?

Posted by Neil C Smith <ne...@apache.org>.
On Sat, 11 Sept 2021 at 19:38, Neil C Smith <ne...@apache.org> wrote:
> So, I've spent some time over the last few weeks sketching something
> out, and moving over / templating out some stuff from my platform Ant
> usage.  The intention is to take a NetBeans IDE or platform zip, an
> optional Java runtime, and configuration.  Then it builds the required
> "image" and passes it to the native packaging tool.  Currently got
> AppImage and InnoSetup mostly working, and working on tidying up .deb
> and macOS options.  MSI would be good too.

Found some more time to look at this tool over the last week.  And
I've done some trial configurations (see README) and builds using the
NetBeans 12.5 zip bundle at

https://github.com/neilcsmith-net/nbpackage-test
https://github.com/neilcsmith-net/nbpackage-test/releases/tag/12.5-build1

There's a Windows installer and x86_64 AppImage with Azul Zulu JDK 16
included, and an Arm AppImage for the Pi with Liberica JDK 16
included.

Goes without saying there's nothing official here, and nothing signed
either - test at own risk!

Best wishes,

Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: A NetBeans Packager tool?

Posted by Lars Bruun-Hansen <lb...@gmail.com>.
On Sat, Sep 11, 2021 at 11:43 PM Oliver Rettig <Ol...@orat.de> wrote:
>
> I am still using the netbeans buildin installing stuff but it was always
> difficult for me to figure out how to implement specific needs. Main disadvanatage
> for me was need of a jre installed on the pc to use the installer and the lack
> of a tool to includes the app-icons in the executables. But it was ok for me.
>
side note:

I assume you mean NBI (NetBeans Installer) ?
It does indeed support an embedded JRE so there's no need for a JRE to
already exist on the target computer. There's an annoyance there
because you must create a self-extracting archive of the JRE using
specifically Info-ZIP (and not say 7-ZIP) ... logged as Bugzilla
239238 (https://bz.apache.org/netbeans/show_bug.cgi?id=239238).

I think NBI's main selling point - besides being almost infinitely
flexible - is the fact that you can build installers on any platform.
For example you can build an installer for Windows on Linux. Competing
solutions typically cannot do this.

Its main drawback is its complexity and frankly lack of clear and
concise documentation. The second major drawback is that it clearly
focus on NetBeans Platform applications. I'm not sure it can be
customized as a more generic tool, i.e. work for any kind of Java
application. This will for sure be a deal breaker for many.

Installers produced by NBI are merely a native executable. So no
support for things like MSI.

Having said all this and depending on what your target audience is:  I
believe Installers are less important than what they used to be.
Nowadays ZIP distributions are just as popular and I would claim that
if your target audience is somewhat technical then they may even
*prefer* using a ZIP distribution of your application rather than an
Installer.  Back in the days it was normal for an application on
Windows to create tons of stuff in the Registry. In this respect the
Installer/Uninstaller was important. In Windows-centric corporate
environments Installers may have a place because it is sometimes the
only way the organization will allow the application to enter their
kingdom. But the ZIP distribution has the advantage that you
immediately bypass the Windows UAC which can be somewhat of a hazzle
to work with.

Launchers, on the other hand, definitely still have their place. I
believe the fact that a desktop application is written in Java is
irrelevant for the end user. The Launcher hides that and provides a
native execution binary as the entry point to the application.


 YMMV.



/Lars
¨

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: A NetBeans Packager tool?

Posted by Neil C Smith <ne...@apache.org>.
Hi Oliver,

Sorry for the delayed follow up - was away for a while and catching
up.  Thanks for your thoughts ...

On Tue, 14 Sept 2021 at 08:32, Oliver Rettig <Ol...@orat.de> wrote:
> I would suggest to create a cwiki-page maybe under How-to-Articles or is it a
> better place? I think a place to collect all the informations about the
> advantages and disadvantages of the nbi and also to collect old documentation
> parts to the usage of the nbi would be great. Also to collect alternatives as
> your approach ...

A wiki page may be a good idea!  At least in terms of looking at pros
/ cons and collecting documentation to facilitate discussions.  Longer
term documentation would be better on the website.

Do you want to kick something off?

> I always need support for Windows and Linux. I often us to set platform
> dependend file-type-associations which to allow that a double-click on a file of
> specific type automatically opens my Netbeans-RCP-App.

Is that OS specific, or is there a built-in API for that?  It should
certainly be easy, although packager specific, with native packagers.

> I also use the possiblilty to add app specific dialogs into to installer, e.g.
> to configure the place for additional app-specific DATA folders which can be
> used from more than one application or different versions of the same
> application.
>
> In my scientific applications I typically add into the installation to make a
> choice between several "models" which are installed as an bundle of files and
> folders at a user defined place which has to be saved in the netbeans.conf file
> to be found by the application later.

I'm curious why these steps have to be in the installer?  I guess I've
done similar-ish things by first-run wizards, etc.

> Trouble with  UAC and variants to be able to install the applications in
> central administered windows environment of universities or big companies has
> to be keep in mind. With nbi it was sometimes complicated to solve such
> problems.

Yes, that should hopefully be solved by using third-party packaging.
There are similar reasons why I stopped using NBI myself a while back,
as well as things like easily allowing to upgrade in-place via the
installer, easier shortcut customisation, icons, etc.  And easier JDK
bundlng.

> An further point in this szenario in the past for me was that often the user
> has often liminted space for the cache it it is per default on a remote
> harddisk. For these cases it would be great if the installer is able to change
> the place where the application stores the cache, e.g. on a local folder.

This is another thing I wonder whether it belongs in the installer or
not?  I guess whether such things are better managed outside of
installers so they can work with zip bundles as well, or can be
altered more easily after install?  Cache clearing is also something
that would be great to handle in another way - I do clear caches as
part of install process currently.

Best wishes,

Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: A NetBeans Packager tool?

Posted by Oliver Rettig <Ol...@orat.de>.
Hi Neil,

> On Sat, 11 Sept 2021 at 22:43, Oliver Rettig <Ol...@orat.de> wrote:
> > I am still using the netbeans buildin installing stuff but it was always
> > difficult for me to figure out how to implement specific needs. Main
> > disadvanatage for me was need of a jre installed on the pc to use the
> > installer and the lack of a tool to includes the app-icons in the
> > executables.
> 
> I've not used the built-in installers for the platform for years
> myself now for these reasons, and more.  

I would suggest to create a cwiki-page maybe under How-to-Articles or is it a 
better place? I think a place to collect all the informations about the 
advantages and disadvantages of the nbi and also to collect old documentation 
parts to the usage of the nbi would be great. Also to collect alternatives as 
your approach ... 

> > it needs a better structure which makes it possible to implement
> > app-specific parts in the src of the app instead of all putting in the
> > harness dir
> Are there particular app-specific things you have in mind?  What
> customizations, packaging types, support, etc. might we need to
> consider if we take this route?

I always need support for Windows and Linux. I often us to set platform 
dependend file-type-associations which to allow that a double-click on a file of 
specific type automatically opens my Netbeans-RCP-App.

I also use the possiblilty to add app specific dialogs into to installer, e.g. 
to configure the place for additional app-specific DATA folders which can be 
used from more than one application or different versions of the same 
application. 

In my scientific applications I typically add into the installation to make a 
choice between several "models" which are installed as an bundle of files and 
folders at a user defined place which has to be saved in the netbeans.conf file 
to be found by the application later.

Trouble with  UAC and variants to be able to install the applications in 
central administered windows environment of universities or big companies has 
to be keep in mind. With nbi it was sometimes complicated to solve such 
problems.

An further point in this szenario in the past for me was that often the user 
has often liminted space for the cache it it is per default on a remote 
harddisk. For these cases it would be great if the installer is able to change 
the place where the application stores the cache, e.g. on a local folder.

With nbi I often run into problems for deinstallation  of the complete 
application due to file-rights-problems. This point should be overcome the 
tools of your approach, I think.

best regards
Oliver
> Best wishes,
> 
> Neil
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
> 
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists





---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: A NetBeans Packager tool?

Posted by Neil C Smith <ne...@apache.org>.
On Sat, 11 Sept 2021 at 22:43, Oliver Rettig <Ol...@orat.de> wrote:
> I am still using the netbeans buildin installing stuff but it was always
> difficult for me to figure out how to implement specific needs. Main disadvanatage
> for me was need of a jre installed on the pc to use the installer and the lack
> of a tool to includes the app-icons in the executables.

I've not used the built-in installers for the platform for years
myself now for these reasons, and more.  I've been using InnoSetup,
AppImage, deb, etc.  I know other platform developers have been doing
similar.  I've been using Ant build scripts and shell scripts to
produce so far - fully intend to replace with using this already, as
well as for building some experimental IDE bundles in the near future.

> it needs a better structure which makes it possible to implement app-specific
> parts in the src of the app instead of all putting in the harness dir

Are there particular app-specific things you have in mind?  What
customizations, packaging types, support, etc. might we need to
consider if we take this route?

Best wishes,

Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: A NetBeans Packager tool?

Posted by Oliver Rettig <Ol...@orat.de>.
Hi Neil,
I am still using the netbeans buildin installing stuff but it was always 
difficult for me to figure out how to implement specific needs. Main disadvanatage 
for me was need of a jre installed on the pc to use the installer and the lack 
of a tool to includes the app-icons in the executables. But it was ok for me. 

I had also used com.danielreese.nsisant.Task an ant task to create a windows 
installer a while but I also run into issues.

So I am interesting in your work. Do you think it makes sense to spend time in 
reorganising the netbeans-buildin-installing-stuff. In principle I like it but 
it needs a better structure which makes it possible to implement app-specific 
parts in the src of the app instead of all putting in the harness dir.
Maybe it is too much work and your approach is easier to come to a working 
solution.

best regards
Oliver
> Hi,
> 
> The other week I was re-looking at packaging options for NetBeans (and
> RCP).  I experimented with using JPackage, which you might have seen
> on the NetBeans twitter.  Bit hacky though, involving two Java
> processes, and the lack of some packaging options I want, a few odd
> issues, and the lack of some cross-platform support got me thinking
> whether an NBPackage tool might be a better approach!
> 
> So, I've spent some time over the last few weeks sketching something
> out, and moving over / templating out some stuff from my platform Ant
> usage.  The intention is to take a NetBeans IDE or platform zip, an
> optional Java runtime, and configuration.  Then it builds the required
> "image" and passes it to the native packaging tool.  Currently got
> AppImage and InnoSetup mostly working, and working on tidying up .deb
> and macOS options.  MSI would be good too.
> 
> It might provide a useful option for both platform developers, and for
> third-parties who want to create IDE installers with JDK included.
> 
> Interested in thoughts on this.
> 
> Work in progress PR at https://github.com/apache/netbeans-tools/pull/47
> 
> README at
> https://github.com/apache/netbeans-tools/blob/4ffd265475d69fca62b0fa8e4a79d
> b31ffc9f2ad/nbpackage/README.md
> 
> Thanks,
> 
> Neil
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
> 
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists





---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists