8 Replies - 1364 Views - Last Post: 29 April 2014 - 06:47 AM

#1 ranar  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 24-April 14

Suggestion on Software Updater

Posted 24 April 2014 - 07:17 PM

I have an updater and so far how it is coded it would only be able to update from one version to another like 1.0.1 to 1.0.2. I would like to make it so it can go from any previous version to the current version. Such as 1.0.0 to 1.0.2. The only way i can think of this working would be reading all the software's files on the clients PC than comparing them to a list which it downloaded from the server. If it finds newer or different files than it fetches them but here is what i don't like about this method.
1. There could be many files this is also a 3d application so it will have to download larger 3d models
2. It would be downloading each file by it self and not in a zip.

What would be the best method for this?

Here are the steps my updater takes right now
1. checks a txt file on server and checks local version with the one on the server
2. if out of date it makes a url (What i mean by make is that no matter what the latest version is it will be able to download it from the server)
3. unzips the file
4. parses a xml file to tell were to place the files, folders and deletes the ones that need to be.
5. once done with moving, deleting and updating files changes local version to the same as the downloaded one.
6. removes the zip file(maybe it would be best to download to temp directory?)

The other method i thought of while typing this would be in the xml file it reads maybe put a tag in there and if that tag is not empty than make a url again and download the next file. How efficient would this work?

Thanks

Is This A Good Question/Topic? 0
  • +

Replies To: Suggestion on Software Updater

#2 cfoley  Icon User is offline

  • Cabbage
  • member icon

Reputation: 1949
  • View blog
  • Posts: 4,048
  • Joined: 11-December 07

Re: Suggestion on Software Updater

Posted 25 April 2014 - 03:28 AM

The easy way would be to just give them all the files for the latest version regardless.

Otherwise, you know what files changed between versions. Just create a set of zips, one for each previous version. Then the updater can send the client's version and you can send the appropriate zip.

I would strongly recommend just sending the whole lot. It's easier to program and easy to remedy if you get it wrong.
Was This Post Helpful? 0
  • +
  • -

#3 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 3535
  • View blog
  • Posts: 10,943
  • Joined: 05-May 12

Re: Suggestion on Software Updater

Posted 25 April 2014 - 06:22 AM

If you are going for minimal bandwidth usage, and you are on Windows, consider using Remote Differential Compression . Unfortunately, the API isn't the most straightfoward to use nor clearly documented, or you are not on Windows so you can choose to roll your own by reading the research paper explaining RDC.

Or you could decide that, "okay, I like the concept of minimizing bandwidth usage, but RDC is just way above my head." In that case consider the simpler rsync algorithm and librsync (as used by DropBox).

cfoley is right about if you just want the simplest solution, send the entire set of files. The next simplest is to just send the changed files. Having implemented a few updaters in my past, it really depends on what your target environment is like and what you want the user experience to be like. With those in mind, then you factor in how time you have to invest into the problem, and what is the expected life time of project.
Was This Post Helpful? 0
  • +
  • -

#4 ArtificialSoldier  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 357
  • View blog
  • Posts: 1,296
  • Joined: 15-January 14

Re: Suggestion on Software Updater

Posted 25 April 2014 - 10:31 AM

If updating the application isn't as trivial as only copying files, then you can always chain the updates. If they are on version 1.0.1, and the current is 1.0.10, then they would update to 1.0.2 first, then 1.0.3, 1.0.4, etc. Each update would have an indication about whether there is an update to install next, where the current version wouldn't have that. When you release a new version then you update the previous version to point to the current version as the next.
Was This Post Helpful? 0
  • +
  • -

#5 ranar  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 24-April 14

Re: Suggestion on Software Updater

Posted 27 April 2014 - 08:10 PM

Sorry everyone I have been busy but just for the simplicity of this application I think i will start off by just chaining them all together like ArtificialSoldier said. If i want a more professional way or just have time i will look at those library.
Was This Post Helpful? 0
  • +
  • -

#6 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 3535
  • View blog
  • Posts: 10,943
  • Joined: 05-May 12

Re: Suggestion on Software Updater

Posted 28 April 2014 - 06:08 AM

Have you ever tried reinstalling Civilization III from CD? They took that chaining approach, but the current version Civ III version is about 5-6 patches away from what is on the CD. When my friends and I had a LAN party and decided to break out the classics, I ended up cooking lunch and making snacks while we waited to patch our various machines so that we would all be at the same patch level.
Was This Post Helpful? 0
  • +
  • -

#7 Momerath  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1010
  • View blog
  • Posts: 2,444
  • Joined: 04-October 09

Re: Suggestion on Software Updater

Posted 28 April 2014 - 08:50 PM

Same with a game I played (Runes of Magic). It chains the updates, which they do 1-2 times a week, and if you stop playing for a bit it can take days to update. I hate that method with a passion.
Was This Post Helpful? 0
  • +
  • -

#8 cfoley  Icon User is offline

  • Cabbage
  • member icon

Reputation: 1949
  • View blog
  • Posts: 4,048
  • Joined: 11-December 07

Re: Suggestion on Software Updater

Posted 29 April 2014 - 03:31 AM

Simplest option is download all the files on every update.
Was This Post Helpful? 0
  • +
  • -

#9 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 3535
  • View blog
  • Posts: 10,943
  • Joined: 05-May 12

Re: Suggestion on Software Updater

Posted 29 April 2014 - 06:47 AM

If you have persisted data on the local machine, you'll need to write code that updates it to the current format. If you are talking to servers that may be at different patch levels, you'll also have to either negotiate a protocol version, or simply refuse to talk to older servers.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1