views:

113

answers:

4

How to create an own installer using Java? I am not asking about any Java installer software. Anyone knows the logic or method please tell me. Is there any API available for these?

+2  A: 

This is such a vague question. What do you want to install ? Options include:

  1. the JRE ?
  2. your application (a .jar) ?
  3. Registry entries ?
  4. Configuration files ?

There's no such Java API. If you need to install the JRE, then you could look at an existing deployment mechanism such as .rpm (others exist) and declare a dependency on a JRE. That way your chosen package manager will deploy all your pre-requisites.

Brian Agnew
@Brian I want to install my application(a.jar) with JRE.
Samurai
+1 for pointing out there's no such API and that the q is somewhat ambiguous.
Jonik
+1  A: 

In windows you can use Advanced Installer .

Advanced Installer is the only Windows Installer authoring tool with built-in support for Java applications, integrating them fully into the Windows OS and making them look and feel just like a native application.

Using Advanced Installer you can create MSI packages for your Java applications, and allow your application to use the Windows Installer features.

http://www.advancedinstaller.com/java.html

SjB
@SjB I don't need any software name. I just need the concept to create it for my own.
Samurai
Advanced Installer is just one option, and it definitely is **not** the only option for producing native Windows installers for Java apps. @Samurai: umm, it doesn't really make sense to create your own installer builder... but for ideas on how to distribute Java apps, see http://stackoverflow.com/questions/80105/whats-the-best-way-to-distribute-java-applications/80597#80597
Jonik
+1  A: 

This is a highly specialized topic, and I would be very surprised to see an answer here that satisfies your need for knowledge. If you are serious about this, you should be prepared to do your own work to research the concepts and implementation strategies.

Suggestions:

  1. Survey what the existing tools do; e.g. by reading all of the available user documentation. It should be pretty obvious how they achieve most of the things that they do, at least from a high-level perspective.

  2. Download the source code for one or more of the open-source products and read the code to figure out how it works / they work.

  3. Start designing and building your own tool and develop your own practical knowledge.

Stephen C
@Stephen C Thanks for your suggestions. I will start with open-source products.
Samurai
A: 

Maybe start with the Windows Installer MSDN reference?

Neil Coffey