Ariel Grabijas
Ariel Grabijas

Reputation: 1512

Installation version of program with database included

I got Netbeans 7.1 How can I make installation version of my program? I need it for: Win32 and Win64. I must also include PostregSQL database.

Upvotes: 2

Views: 112

Answers (2)

Craig Ringer
Craig Ringer

Reputation: 324511

If by "Netbeans 7.1" you mean that you've built an application using the Netbeans Platform, you can generate an installer for Netbeans Platform applications. See Customising the Netbeans Platform Installer and Generate a NetBeans Platform Installer with NetBeans IDE 6.9 among other things.

As for PostgreSQL: I'd recommend not auto-installing PostgreSQL. Provide the installers alongside your app if you like, but please don't install it for the user.

Why?

  • Many questions on the PostgreSQL list come from people who've had ancient versions of PostgreSQL installed when it's bundled in software. (Yes, I'm looking at you Poker Tracker). If you encourage users to download the latest point-release in the major version you support, you won't get these problems.

  • Your app will probably try to run the Pg installer silently with a preset password and location. If someone else's app has already run a Pg installer for the same major version or if the user has already installed Pg, your app won't be able to configure the install, so nothing will work properly.

  • If the user later wants to install PostgreSQL and unbeknownst to them you've already installed it for them, they won't know the PostgreSQL service password or the "postgres" admin password, so they'll be confused about why the Pg installer doesn't work how they expect. They'll end up as another confused user on the PostgreSQL mailing list.

I'm really hoping that the EnterpriseDB installer will be able to support "branded" installs in future, where an install goes into a separate location and separate service account on a non-default port, so it doesn't tread on regular Pg installs. Right now that isn't the case.

If you really must install PostgreSQL with your app, please use the .zip binary package (for Windows) and run initdb on a non-default location yourself using a non-default port. That way you won't break regular installs. This also means that you'll install more cleanly on other platforms like Linux systems where PostgreSQL is often packaged as part of the operating system.

Upvotes: 3

David B
David B

Reputation: 2698

Java is run on the JVM, which means the only installation your application would need is the Java runtime for their processor installed on their machine.

You can distribute the JAR, or if you want, create an EXE in another language or a Batch file to execute the JAR. If you take the EXE route though, you will have to compile on both architectures to be compatible.

Related: What does it mean for Java to be portable?

Upvotes: 1

Related Questions