Hello,
I would make a full setup for my java application but I have no idea how can i make it, and I would make a class installer like in .net because I want some tasks running during the installation.
Thanks for your help.

I'd clarify that a little. Are you intending to setup your app, or are you intending to setup their Linux, Apple, Windows and other computers with the JAVA runtime as needed plus your app?

Let me share I've found JAVARA to help me dust off old JAVA, install the new and a bit more. But at no time have I stepped over that line where I am installing runtimes for the end user. Maybe today's users need that?

Yes I'm intending to setup my app.

Typically, you'd just have a method in the main class that does that stuff, or in a class where you launch it from the main class. A single entry in a properties file can then be used to determine whether that initialisation method runs or not.

I found how can i make a setup but my primary question is how can make a Class Installer like in .net that run only 1 time during the installation.

@alaad
Aha, I think I get your question now. You want your app not to be a setup app but "the entire app" so you have a method you want to run once.

I have apps that on startup do checking to see if it's all good to go like a pre-flight check. Your method would not just blindly set things up but test for what you need configured. In psuedo code.
if this isn't there, create this.
if that isn't set, set that.

@rproffitt
But I want to get from the user some information (like, where you want save your data, and where you want to save your application).
So it is any idea to do that, or I want to do this tasks by coding (hard coded), like what you said (if this isn't there, create this.
if that isn't set, set that.)

If you get that information from the user then you have to store that in a configuration file (or equivalent) somewhere so you can find it next time the program is run.
So your startup code can look something like:

p s v main(etc) {
   get config file
   if file exists start running normally
   else run the one-time installation code

Okay, Thank you all for your interest.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.