Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Application Auto-Updating Ideas

  1. #1
    Member
    Join Date
    Jun 2011
    Posts
    182
    My Mood
    Where
    Thanks
    15
    Thanked 8 Times in 8 Posts

    Default Application Auto-Updating Ideas

    One of the things I am working on with my current personal project is adding an automatic updating system that checks a dropbox link for new file updates.

    This thread is intended to be for brainstorming so post as many ideas as you like for how to make this work as efficiently as possible. I also am having trouble with figuring out how to keep the process platform independent...

    Here are the ideas I have so far:

    1. The most obvious to me is have an app launcher that simply checks for updates and, if none are available launches the main jar. If an update is available, it downloads the new jar and replaces the old one, then launches the new jar. I would rather, however, avoid the approach of having two jars/a launcher exe + jar because it would mean writing an installer which kills the platform independent goal.

    2. Include the main jar inside of the launcher jar (pretty much same process as above). I'm not sure though how I would go about replacing the contents of a running jar file.... you guys may need to help me with that one.

    3. Manually replace individual class files? Again I'm not sure if that is even possible...

    Any ideas are appreciated!


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    18,662
    Thanks
    45
    Thanked 1,960 Times in 1,934 Posts

    Default Re: Application Auto-Updating Ideas

    To swap jars and a java execution, you might need a place to stand while you are doing the swaps.
    It could depend on the OS.
    Start another program to do the transit, End the current one. Do some cleanup. Start the new version and end the transitive program.

  3. #3
    Member
    Join Date
    Jun 2011
    Posts
    182
    My Mood
    Where
    Thanks
    15
    Thanked 8 Times in 8 Posts

    Default Re: Application Auto-Updating Ideas

    Quote Originally Posted by Norm View Post
    To swap jars and a java execution, you might need a place to stand while you are doing the swaps.
    It could depend on the OS.
    Start another program to do the transit, End the current one. Do some cleanup. Start the new version and end the transitive program.
    Yeah I came up with another idea after I posted this and it's kind of like what you just said.

    I was thinking have the Launcher class run an update check method, and if there is an update, download a ZIP file with TWO jars. The new program jar and an updater program.

    It extracts the ZIP and launches the updater. It then exits itself and lets the updater program take care of the cleanup, AKA delete the old jar and replace it with the new one. The updater then launches the new program and closes itself down. I suppose the main program could also check on start up for the existence of the updater and remove it to finish up the job cleanly.

    How does that sound?

Similar Threads

  1. Running out of ideas...
    By Cat in forum What's Wrong With My Code?
    Replies: 6
    Last Post: March 12th, 2011, 10:21 AM
  2. I need ideas on how to read this
    By thursgun in forum File I/O & Other I/O Streams
    Replies: 0
    Last Post: April 21st, 2010, 09:31 PM
  3. Auto contrast and auto brightness
    By oxxxis in forum Java Theory & Questions
    Replies: 0
    Last Post: January 21st, 2010, 02:00 PM
  4. Any ideas for begginer?
    By SwEeTAcTioN in forum Java Theory & Questions
    Replies: 11
    Last Post: October 27th, 2009, 03:28 AM
  5. application Task problem - updating JTree
    By idandush in forum AWT / Java Swing
    Replies: 2
    Last Post: June 18th, 2009, 03:15 AM