1

I've been doing some research into how to make Apple flat packages from a Java webapp. There doesn't seem to be much out on the subject. I found a website that details the contents of a flat package but it seems like a bit of a project to start from scratch. Anyone have any experience building PKGs? Does anyone know of any libraries to aid in the process?

EDIT: It seems I may not have been clear in my request. My goal is to have users go to a website that requires them to enter some information. After they've entered their information my code would create a PKG for them that contains some information about them. For example, maybe the postinsall script would run the command "say 'Hello USERNAME_THEY_ENTERED'". Silly example but it's the general idea. The user would then be able to run the PKG and the install that takes place would be customized with their information.

Kara
  • 6,115
  • 16
  • 50
  • 57
Staros
  • 3,232
  • 6
  • 30
  • 41

2 Answers2

0

Why would you want a web application in a pkg file? What servlet container accepts pkg files?

Web applications are meant to be packaged as WAR or EAR files (since we are talking about Java) and to be deployed on a servlet container like tomcat, jetty, websphere, glassfish, jboss, ... running on a server. The client computer then uses a browser to access to web application on the server.

PKG files can be compared to MSI files. These are meant to facilitate the installation of software (or libraries) on a client. For that the website you linked seems to have valid information.

hcpl
  • 17,382
  • 7
  • 72
  • 73
  • I'd like my web application to be able to create dynamic PKGs. The goal is for a user to browse to a website, enter some info, download a PKG that contains info about the user and then execute it on there machine. I'm not trying to bundle my web app inside a PKG file. – Staros Mar 29 '12 at 17:01
0

I am not sure why you want to do that for a webapp but we have done it for a standalone Java App (which actually was a collection of webapps including the server).

If this works for you, try to prepare your application.app folder using jarBundler. It provides an Ant task that will make things much easier.

If this does not work for you (as unfortunately was the case for us), then you have to prepare the application.app folder by hand and script adding the java resources. Start from an existing app, generated with Jar Bundler for instance, and adjust accordingly.

Then you need to install XCode and get PackageMaker. This app has a GUI but you really need to read the doc. The biggest issue we have met is that you cannot script the package build process.

I need to add that, unless you need to run some post-install scripts, building a DMG is probably much easier.

Bruno Grieder
  • 28,128
  • 8
  • 69
  • 101