views:

42

answers:

1

I have a server, and Client that are working fine, they transfer file to each other and handle commands with success. The thing is that once connected to the server, the server can ask the Client to update itself.

Since I did everything using sockets with a TCP connection, and I am NOT able to use java web start, I am looking for a way I can update the software.

One thing I thought was:

  • Making the java call another java software and close itself. Then the other java software, would connect to the server again and waits for the update request, so it could replace all files from the current version (lib directory and the jar main file - Im using Netbeans).

Maybe I could just send the connection Object to the Software that would update, but the main only accpets String.

So I ask two questions here:

  1. Is this a good solution? Or is there a better one?
  2. If I do that, how can I send the Client Object of my proto from one application to another?
+2  A: 

I would suggest keep a property file on server having latest version of app.

Each time you start the app compare version if its updatable then download all new updates in a temp dir

After SUCCESSFUL download invoke another small application to copy those files to your lib file in order to update your app actually

At the end prompt user that app has been updated and launch the newly updated app. i would say.

org.life.java
seems like a good idea, I will try that... But to copy to my Lib I will need to override the files, right? renameTo doesnt override it. So I will have to remove those files first, but I am afraid someone shuts down the computer after I remove those files...
fredcrs
@darri I have mentioned it, `After SUCCESSFUL download invoke another small application to copy those files to your lib file in order to update your app actually` till then the original lib are safe and untouched
org.life.java