OpenTTD Auto Update - 2.0.6

OpenTTD is a fully open-sourced reimplementation of TTD, written in C++, boasting improved gameplay and many new features.

Moderator: OpenTTD Developers

Post Reply
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

OpenTTD Auto Update - 2.0.6

Post by Zuu »

Note:
2.0.6 is available later in the thread

Website with introduction


Read on for version 1.1

Note (2008-11-01): Version 1.1 does not work anymore since the server migration of OpenTTD, some months ago.

------------------------
Since there have been an increase of discussions about other updaters than OpenTTD Updater by Madassasin I have started this thread about my updater OpenTTD Auto Update so that if you have any comments about it there is a thread for it where it is not off-topic.

A list of updaters for OpenTTD can be found at the wiki. But since you are here, you're probably interested in this updater and should continue to reed this page. :)

I've also moved the information about the program from a post in another thread which I've until now updated with new versions of the program.


Usage
Quick start
  • Download zip-file (attached at the bottom of the post)
  • Unpack it and place the unziped files directly in your OpenTTD dir. (no subdirectory)
  • Double click on OpenTTDAutoUpdate.exe
Optionally (some easy, some harder):
  • Make a shortcut on your desktop or in the start menu to OpenTTDAutoUpdate.exe
  • Hard: Add the option /auto to the shortcut which will hide the configuration-dialog independent of if the checkbox to skip the configuration-dialog is checked or not. This way you can use the shortcut to play and still don't have to edit the ini-file to change the settings. (just use another shortcut without /auto or browse to the actual exe-file)
  • Now when you want to play the last nightly use this new shortcut you just created instead of your old shortcut to openttd.exe. When you have the latest nightly installed OpenTTD wil just start, and if there is an update you will be asked if you want to update.
Note: You _can_ put the unziped files anywhere you wish as long as you place all files in the same directory. You will be required to tell where your OpenTTD nightly installation is located though.

What is it doing?
  1. Display the configuration every startup until you get pissed of and check the lower left check box that disables the configuration window.
  2. Checks for updates of the updater itself.
  3. If there is a nightly available for the selected revision source (nightly or #openttdcoop PS) with a different revision number than the one you have installed then it will ask you if you want to upgrade/downgrade. If you say no or if you already have the "correct" revision it will keep your existing installation untouched and continue to point 6 (k+3, where k is current point).
  4. Downloads last nightly zip-file and then unpacks it in the configured OpenTTD directory. If "Ask before overwriting" have been checked the unzip program will ask you before it overwrites any existing file.
  5. Displays an extract of the change log with just the changes that are new for this update. You can turn this of if you wish, just check the don't show this dialog anymore checkbox.
  6. Start OpenTTD. (unless you have disabled that)
  7. Exit OpenTTDAutoUpdate, just after OpentTTD have started. So it will not waste your memory while you are playing.
If you disable starting of OpenTTD and use the configuration window (main window) then the configuration window will show again after update.

The website-link in the about dialog actually looks up the current website URL from the same server that it checks for self updates (users.tt-forums.net) and on failure it falls back to this forum thread.


ChangeLog
-- 1.1 (2008-04-06) --
  • Checks for updates of the program itself.
  • Reads version information from openttd.exe instead of changes.log.
  • Made it easier to use the updater without a pre-existing OpenTTD installation. (In 1.0 you had to create a fake openttd.exe, now you just have to answer a dialog)
  • The tab order of the main window was wrong in 1.0, now fixed.
  • Pimped the About dialog. Now text such as URLs can be selected and copied from this dialog. The website button will open the current OpenTTD Auto Update website in your default browser. (As of now, this thread is the website)
  • In 1.0 when your changes.log was missing a error message was displayed that you could ignore. This error message, but for failure in interpreting openttd.exe have been changed from "error" to "warning", since you can ignore the dialog and update anyway.
-- 1.0 (2008-03-27) --
  • Users can now select between Latest Nightly or the nightly used by #openttdcoop Public Server. (Revision Source)
  • As a result of this it is now possible to downgrade to a lower version of OpenTTD. Therefor I've introduced a zip-file cache that stores zip-files untill they are not needed anymore, to reduce downloading. Cache cleaning can be disabled if you wish. The cache directory is named "AutoUpdateCache" and is automatically created in your OpenTTD directory. If you currently have a file/directory with that name, you should rename it.
  • The dialog that asks if OpenTTD should be updated can now be disabled => always update. (Ask before updating OpenTTD)
  • Added option to disable starting of OpenTTD after updating. (Start OpenTTD)
  • Windows are centered even if you don't use 1024x768.
  • Some entries in changes.txt end with an empty line, some do not. Remove the empty line from those who have that so that the change log looks more consistent.
  • Tweaked tab order of some windows.
  • Added constraints for how small the change log window can become.
  • When /noauto is given, don't tell user how to show the configuration window again.
  • Even more robust error handling. (including catch unzip failures better)
  • Log what the program is doing to a file "OpenTTDAutoUpdate.log" in the OpenTTD directory.
  • The icon have been slightly tweaked.
-- Beta 5 (2008-03-22) --
  • Displays new changes (from changes.txt) since last update after upgrade.
  • Handles exceptions/errors better. Shows helpful dialogs on many more errors.
  • The bundled unzip.exe have been exchanged by another compatible build from info-zip that takes about 100 kB less space.
  • Shows a small banner (no advert, just informative text that OpenTTD is starting) when starting OpenTTD.
  • Added an icon for the program.
-- Beta 4 (2007-08-18) --
  • Fixed /auto bug that raised an exception/assertion at startup.
  • Old GUI removed.
  • New GUI let users configure OpenTTDAutoUpdate and then update OpenTTD.
  • Check box to skip configuration dialog at startup.
  • Now visually indicate that downloading is in progress, when downloading latest nightly. (useful on slower connections where download takes longer than a second or two)
  • Show either progressbar-window or confirmation window when unzipping OpenTTD, not both.
-- Beta 3 (2007-07-15)--
  • Fix: Releases the changes.log files after reading it.
  • Feature: Stores the path to OpenTTD in a ini-file: conf.ini located in the same directory as the program. The status of the checkbox (not in the beta1 picture) is also saved in the ini-file.
  • Feature: If parameter '/auto' is given, the program will check for updates and if any updates are found it asks for confirmation. And after that it starts OpenTTD. (currently the window is not hidden, but that is on my ToDo-list :) )
-- Beta 2 --
  • Does include an option to ask before overwriting files when unzipping.
  • Shows the output of unzip.exe to allow users confirm overwriting.
  • Works with paths that contain spaces.

License
Currently this is a freeware program, since that was the decision I took in 2007 when I started with the program, but it's not set into stone that it will not become open source in future.
Attachments
mainwindow.png
mainwindow.png (15.52 KiB) Viewed 25288 times
upgradequestion.png
upgradequestion.png (7.65 KiB) Viewed 25279 times
OpenTTDAutoUpdate_1-1.zip
Read Quick Start under Usage in the post above for install instructions.
(396.63 KiB) Downloaded 1580 times
Last edited by Zuu on 22 Dec 2011 22:22, edited 29 times in total.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: OpenTTD Auto Update

Post by Zuu »

More images
Attachments
The change log dialog, can be disabled/enabled either in the main configuration dialog or using the checkbox in the lower left corner.
The change log dialog, can be disabled/enabled either in the main configuration dialog or using the checkbox in the lower left corner.
changelog.png (27.51 KiB) Viewed 25292 times
Last edited by Zuu on 27 Mar 2008 16:30, edited 1 time in total.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: OpenTTD Auto Update

Post by Zuu »

I don't like to triple post, but nobody have posted so.. I have to. :)

What I want to say is that I have a made quite some fixes and also added the possibility to disable the question if you want to upgrade or not (simply upgrade if there is a newer revision available)

List of upcoming fixes/features
  • User can tell the program that it should always update OpenTTD whenever there is a newer revision available (no asking before)
  • Windows are centered even if you don't use 1024x768 (which my laptop uses)
  • Some entries in changes.txt end with an empty line, some do not. Remove the empty line from those who have that so that the change log looks more consistent.
  • Tweaked tab order of some windows
  • Added constraints for how small the change log window can become.
  • When /noauto is given, don't tell user how to show the configuration window again.
  • Even more robust error handling. (including catch unzip failures better)
  • Log what the program is doing to a file "OpenTTDAutoUpdate.log" in the OpenTTD directory.
Also I've implemented checking for new versions of OpenTTD Auto Update from a web server. But as I don't currently have an enough reliable server and server address I'm not sure if I should keep it or remove that feature. A reliable address could be one on SourceForge, but I'm not really motivated to go through all the hassle to work with SF, and I have not yet decided to go open source. Also they have quite high latency times, which will delay the usage of the updater as it is single-threaded with blocking downloading of websites.

Most likely I'll drop the feature to check for newer version of OpenTTD Auto Update, though I'm interested to hear your opinions. After this release I'll probably not update the program for a few months. So next release will probably become 1.0.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
rbenevid
Traffic Manager
Traffic Manager
Posts: 192
Joined: 14 Oct 2004 20:08
Location: Brazil

Re: OpenTTD Auto Update

Post by rbenevid »

Nice app! Does it support proxies? I'd love to use it at work.
User avatar
leno4
Traffic Manager
Traffic Manager
Posts: 247
Joined: 10 Mar 2008 02:45
Location: Australia

Re: OpenTTD Auto Update

Post by leno4 »

Is sensational, but could you make it so OTTD dosnt start automaticly after download.l
User avatar
tkz
Engineer
Engineer
Posts: 84
Joined: 27 Nov 2007 14:23

Re: OpenTTD Auto Update

Post by tkz »

leno4 wrote:Is sensational, but could you make it so OTTD dosnt start automaticly after download.l
Agreed. :bow:

Fantastic work, but that feature is a little annoying.

:]
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: OpenTTD Auto Update

Post by Zuu »

rbenevid wrote:Nice app! Does it support proxies? I'd love to use it at work.
Thanks,

I have not taken any action to make it work with proxies since I've personally never have had the need for that. I use the Indy library for Delphi, which seam to have some proxy support. Though having no proxy server to test on it's a bit hard to make it work.

leno4 wrote:Is sensational, but could you make it so OTTD dosnt start automaticly after download.l
I didn't though of the need for that, but I guess if the download takes long time you want to do something else during that time and save that word document or whatever before you start playing. I'll add an option to do so.

But, thinking out loud, if you have show change log on, then you have to close the Change log before OpenTTD starts. Isn't that enough or do you want to have an option to quit the updater after the update have been performed, but before OpenTTD starts?

Could you (or Halo14, or anyone else) elaborate a bit?


And thanks for your comments, since myself I only know how I would use it. And I'm on a 100Mbit downlink so download only take a few seconds. :)
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
tkz
Engineer
Engineer
Posts: 84
Joined: 27 Nov 2007 14:23

Re: OpenTTD Auto Update

Post by tkz »

I'd just put a toggle option somewhere saying "Automatically start OpenTTD when updated y/n". Sometimes people may just want to update and then not play.

Hope that makes sense.

:]
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: OpenTTD Auto Update

Post by Zuu »

Halo14 wrote:I'd just put a toggle option somewhere saying "Automatically start OpenTTD when updated y/n". Sometimes people may just want to update and then not play.

Hope that makes sense.

:]
It makes sense for me when I'm testing the program at least. :) Through I'm thinking a bit on what unnecessary load it may put on the web server if many people update without playing that nightly and then have to update again. The webserver is not free and we users have from time to time put in some money to tt-forums and/or openttd to make it go around. So it is not only making a program that enables people to download, but not play and then maybe dowloads again later as a new version have came again. But there is also another aspect to it, the unnecessary downloads that will increase. Just some thoughts. But I guess even as now it is quite easy to quit OpenTTD or simply kill the updater program when the change log dialog is shown.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
dihedral
Tycoon
Tycoon
Posts: 1053
Joined: 14 Feb 2007 17:48

Re: OpenTTD Auto Update

Post by dihedral »

how about "update to current #openttdcoop public-server game" :-)

we could provide a webservice that would provide the revision number / url to the nightly + version/url to the current #openttdcoop grfpack

we could then even talk about advertising it on the #openttdcoop website :-)
User avatar
Ammler
President
President
Posts: 953
Joined: 18 Jun 2006 18:18
Location: Switzerland
Contact:

Re: OpenTTD Auto Update

Post by Ammler »

It doesn't need to be just for #openttdcoop, but something like a changeable revision URL, I guess, you take it from http://nightly.openttd.org/devs/rev now?

So it would be possible make our own "revision" URL.

Greets
Ammler
dihedral
Tycoon
Tycoon
Posts: 1053
Joined: 14 Feb 2007 17:48

Re: OpenTTD Auto Update

Post by dihedral »

yes - exactly what i meant :-P thanks Ammler :-)
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: OpenTTD Auto Update

Post by Zuu »

Ammler wrote:It doesn't need to be just for #openttdcoop, but something like a changeable revision URL, I guess, you take it from http://nightly.openttd.org/devs/rev now?

So it would be possible make our own "revision" URL.

Greets
Ammler
Yes that is true, it uses http://nightly.openttd.org/devs/rev, so if #openttdcoop provides an URL, perhaps one for each server and I add an option to make the URL configurable then Coopers will be able to get the right version as the coop-games often last longer than a 24-hour cycle. Through I need to do some research on how the archived nightlies are stored. Looks like current year is in one /[OS]/ and last year is in /OS/[year][month]/ but I would have to check with someone who is responsible for the structure there. (Win32: http://nightly.openttd.org/win32/ )


Would downgrading be something useful then? Currently I remove the downloaded zip-files just after unpack, but with the possibility to change "revision" URL you could possible change between two revisions back and forth and put unnecessary high load on the server. So storing the zip files for some time would be good to save on the bandwidth. A complex solution would be to allow users to set several URLs and the program will keep zip files with revision equal to or higher than min(revision_URL) on disk.

dihedral wrote:how about "update to current #openttdcoop public-server game" :-)

we could provide a webservice that would provide the revision number / url to the nightly + version/url to the current #openttdcoop grfpack

we could then even talk about advertising it on the #openttdcoop website :-)

I've left out the GRF pack both because making the basics work first makes sense, but mostly because I did not knew if that was welcome or not. But I read you as that is something you would not have anything against, at least as far as it uses the upgrade zip-files etc. to save on your bandwidth?
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
Ammler
President
President
Posts: 953
Joined: 18 Jun 2006 18:18
Location: Switzerland
Contact:

Re: OpenTTD Auto Update

Post by Ammler »

Zuu wrote: Would downgrading be something useful then? Currently I remove the downloaded zip-files just after unpack, but with the possibility to change "revision" URL you could possible change between two revisions back and forth and put unnecessary high load on the server.
I enjoyed our talk in IRC yesterday. Thank you. I have an idea for that: Just use different folders for different Release URLs. Nightlies won't be downgraded and #openttdcoop PS won't either.

Greets
Ammler
Last edited by Ammler on 27 Mar 2008 13:17, edited 1 time in total.
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: OpenTTD Auto Update

Post by Zuu »

Ammler wrote:
Zuu wrote: Would downgrading be something useful then? Currently I remove the downloaded zip-files just after unpack, but with the possibility to change "revision" URL you could possible change between two revisions back and forth and put unnecessary high load on the server.
I enjoyed our talk in IRC yesterday. Thank you. I have an idea for that: Just use different folders for different Release URLs. Trunk won't be downgraded and #openttdcoop PS won't either.

Greets
Ammler
Thanks, thats a good idea. Through the program will have to scan all directories, currently only two, to see if a specific nightly revision exist on disk or if it need to download it. But it's still a good idea that I'll consider.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: OpenTTD Auto Update

Post by Zuu »

I just released 1.0 of the program. It's better than ever and here is the updates (also found in the first post)

Especially noticable is the possibility to not only update to latest nightly but also to the nightly used by #openttdcoop Public Server, a function that have been implemented in cooperation with the coopers. :)

Also you can now disable starting of OpenTTD after update as you have been asking about.
Zuu wrote:-- 1.0 (2008-03-27) --
  • Users can now select between Latest Nightly or the nightly used by #openttdcoop Public Server. (Revision Source)
  • As a result of this it is now possible to downgrade to a lower version of OpenTTD. Therefor I've introduced a zip-file cache that stores zip-files untill they are not needed anymore, to reduce downloading. Cache cleaning can be disabled if you wish. The cache directory is named "AutoUpdateCache" and is automatically created in your OpenTTD directory. If you currently have a file/directory with that name, you should rename it.
  • The dialog that asks if OpenTTD should be updated can now be disabled => always update. (Ask before updating OpenTTD)
  • Added option to disable starting of OpenTTD after updating. (Start OpenTTD)
  • Windows are centered even if you don't use 1024x768.
  • Some entries in changes.txt end with an empty line, some do not. Remove the empty line from those who have that so that the change log looks more consistent.
  • Tweaked tab order of some windows.
  • Added constraints for how small the change log window can become.
  • When /noauto is given, don't tell user how to show the configuration window again.
  • Even more robust error handling. (including catch unzip failures better)
  • Log what the program is doing to a file "OpenTTDAutoUpdate.log" in the OpenTTD directory.
  • The icon have been slightly tweaked.
Some notes on the zip-file cache:
In the directory AutoUpdateCache (created when you run the program) in your OpenTTD directory there are two directories "LastNightly" and "CoopPublicServer".

When the updater is to update to a specific revision it first looks in the correct folder and see if the revision is on disk, if not it also checks the other directory and if it finds the wanted zip-file there it is copied over to the correct directory. This will waste 3 MB on your harddrive, but makes the code easier, but at least you don't have to download it twice.

The Zip-Cache for the revision source you have selected is cleaned when either
*) OpenTTDAutoUpdate need to download the zip file
or
*) Copy the zip file from the other revision source directory.
When the cache is cleaned ALL .zip files are removed.

In normal usage cases you will maximum have one zip-file sitting in each cache directory of a total of about 6 MB. (If you use both revision sources, if you only play last nightly, then it will only be about 3MB)

Thanks to Ammler for the idea about splitting the cache in two to both keep the harddrive usage low but still don't downloading if you switch back and forth between Nightly and #openttdcoop Public Server during the day.


Enjoy :)
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
tkz
Engineer
Engineer
Posts: 84
Joined: 27 Nov 2007 14:23

Re: OpenTTD Auto Update - 1.0

Post by tkz »

Great work Zuu!

Just update your sig ;]

:]
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: OpenTTD Auto Update - 1.0

Post by Zuu »

Halo14 wrote:Great work Zuu!

Just update your sig ;]

:]
Thanks, and oh.. forgot to update that sig too. But I've fixed my sig now. :)
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: OpenTTD Auto Update - 1.1

Post by Zuu »

New version 1.1 is out.

It fixes a few minor things in 1.0 such as bad tab order in main window and a dialog have been degraded from error to warning. :) Though, there are some goodies too. In 1.0 you had to have a pre-existing nightly installation (or at least a fake openttd.exe), in 1.1 you don't need to create a fake openttd.exe, the program will instead give you the option to install if now openttd.exe is found. Install is not using the installer, but simply the same as updating, just that there are no old files to overwrite.

Another nice thing with 1.1 is that it will check for newer versions of the OpenTTD Auto Update program itself. When there is a new version available you will get a dialogbox with some text and a link, as it can not yet update itself. Checking for updates can be disabled if you wish, just as most other major aspects.
Changelog wrote:-- 1.1 (2008-04-06) --
  • Checks for updates of the program itself.
  • Reads version information from openttd.exe instead of changes.log.
  • Made it easier to use the updater without a pre-existing OpenTTD installation. (In 1.0 you had to create a fake openttd.exe, now you just have to answer a dialog)
  • The tab order of the main window was wrong in 1.0, now fixed.
  • Pimped the About dialog. Now text such as URLs can be selected and copied from this dialog. The website button will open the current OpenTTD Auto Update website in your default browser. (As of now, this thread is the website)
  • In 1.0 when your changes.log was missing a error message was displayed that you could ignore. This error message, but for failure in interpreting openttd.exe have been changed from "error" to "warning", since you can ignore the dialog and update anyway.
As you see, there is not much revolutionary about this release. So update if you wish to get notified about coming releases, found anything interesting in the changelog or just want to checkout the pimped about dialog. ;)


---

Also while you are here reading this and perhaps already have used the program. You are a real user, I've just have written this program, so while I have my opinions about how to design it, you have insights about what you think is annoying and what you think is well designed from a users point of view. I would be glad to read your feedback. If there is things you don't like, do you have suggestions about solutions for that?

Thank you
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: OpenTTD Auto Update - 1.1

Post by planetmaker »

Works like a charm. Thx for the great work
Post Reply

Return to “General OpenTTD”

Who is online

Users browsing this forum: No registered users and 8 guests