The problem I have is, for example VLC, atm the current version of VLC is 1.0.5, and this downloads it "start http://www.videolan.org/mirror-geo.php?file=vlc/1.0.5/win32/vlc-1.0.5-win32.exe"

But, in 6 months or when ever I reformat my PC, 1.0.5 won't be the latest version, so I don't know how to get it to always get the latest version.

Any ideas?

04-26-2010

MK27

You could update your code manually every six months with this one, it is only one screenful.

04-26-2010

paulb39

Quote:

Originally Posted by MK27

You could update your code manually every six months with this one, it is only one screenful.

I'm going to be adding a lot more programs, I first want to get the latests version part working- editing the code would defeat the purpose, if I was going to do that I might as well just go to each site and download individually.

04-26-2010

MK27

Well, I don't see a clear solution here that does not involve:

1) an online source of information for each application involved, such as the homepage.
2) an HTTP client to connect to that online source.
3) a ton of nitty gritty parsing the content of the homepage to extract the current version. The you cross your fingers the homepage looks exactly the same in 6 months.

In short, this could be a very interesting project, but considering you are brand new to C++, you might want to give yourself a month or so before you start considering the exact form of it, in order to get a firm grasp on syntax and some slightly more advanced topics such as networking (necessary) and OOP (very worthwhile).

After that, you might be able to do this inside of a month, full time (30-60 hours a week) if you turn out to be a bit of a prodigy. But to be honest, I would bet against you getting anywhere close to accomplishing this before the end of the year. That's not a personal jibe at all.

So, since it's basic syntax you need to master first, maybe put this one on the backburner for now.

I'm going to be adding a lot more programs, I first want to get the latests version part working- editing the code would defeat the purpose, if I was going to do that I might as well just go to each site and download individually.

The path to the latest version of a program is determined, ultimately, by whoever develops that program.

If you're lucky, the developer will publish the latest version number at some defined address (eg a file at http://wherever.the.program.is/latest_version.dat) that you can download, and then interpret to extract a path to the latest version. Most developers don't do that.

In the end, you need to do it on a "case by case" for each program you're interested in. That might include crossing your fingers and doing some form of web page scraping (as mentioned by MK27). Such schemes are far from trivial, even if the web page for downloading a program of interest has a layout that never changes. Over time, if the developer changes layout of their web page, or changes their web address, or whatever .... then such schemes will fail. Some sites are also specifically designed to prevent automated downloads of their products (eg by showing an image for security purposes, that must be read by a human and typed in).

For most programs, you're going to need some form of manual intervention. Whether that involves rewriting your program, or having some editable file that your program reads and you edit, is up to you.

04-26-2010

MK27

Quote:

Originally Posted by paulb39

Ah, I didn't think it would be that difficult

:p that has been my response to most of the programming tasks I end up doing. It's like this: You think computers are like people, and that their existing capacities are innate, or at least already exist and are self managing. So you just have to say to them, "Okay, I know you can run this software, and install it, and go online and find some data and tell me the latest version" and so on.

That is more like a user interface. Creating such an interface is somewhat more complicated.

The "innateness" is more or less limited to what's called low level. Bytes, memory, input/output. Beyond that, you will be very surprised how complicated it is just to create a program that will fetch a webpage, like your browser does, because the computer does not do that "innately". It has to be programmed in terms of bytes, and memory, and input/output, to do that.

Most likely they do, yes. This is a very minor task, all it requires is that someone do it periodically. I suppose history could have been such that all software applications could have a site and there could be some standared method of querying that site to get the latest version, but as it so happens this is not the case. That sort of relationship might be worked out between specific developers (eg, you as part of Ninite Easy PC Setup could work out a relationship with the development team of firefox such that you could automate version updates via simple online queries), or some of them might choose to offer it in some way already (if you inquire).

Probably the reason support for this idea is "limited" is that the most useful side of programming involves tasks that are very repetitive and need to be done all the time, or perhaps extremely complex tasks that need to be done occasionally, as opposed to very simple tasks that only need to be done occasionally, and yet are still complex to develop and maintain (like this one)*. After all, why spend months working on something to save yourself 30 minutes a year from now on? The time you spend writing this application would be impossible to make up in a single lifetime. And chances are no one else will be that interested in it, because the time it would take someone else just to learn to use effectively (say several hours) is not worth the few minutes it will save them either.

* there's a strange point about computers, that some things that are simple for a human user to do are more or less impossible for the computer to do on it's own, and other things that are very simple for a computer to do repetitively, at light speed, would be impossible or pointless for a human user to manually assist.