Elvas Tower: Store latest version number in registry - Elvas Tower

Jump to content

Posting Rules

All new threads will be started by members of the Open Rails team, Staff, and/or Admins. Existing threads started in other forums may get moved here when it makes sense to do so.

Once a thread is started any member may post replies to it.
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Store latest version number in registry Rate Topic: -----

#1 User is offline   James Ross 

  • Open Rails Developer
  • Group: Posts: Elite Member
  • Posts: 5,514
  • Joined: 30-June 10
  • Gender:Not Telling
  • Simulator:Open Rails
  • Country:

Posted 30 August 2021 - 06:10 AM

Trello card: https://trello.com/c...ber-in-registry

Quote

Storing the latest version number in the registry has been requested by content creators, so that their installers can validate the user's version of Open Rails is compatible with the content

This will be stored per-user, next to the existing content folders storage, which installers already modify to add content

The version will be stored in a machine-readable format (so that it may be updated automatically) and human-readable text for display purposes

The current version of code produces data in "HKEY_CURRENT_USER\SOFTWARE\OpenRails\ORTS\Version" that looks like this:

https://james-ross.co.uk/temp/Screenshot%202021-08-30%20150044.png

The unlabelled QWORDs are 64-bit (8 byte) serialisations of the version number; sixteen bits (2 bytes) for each component. You can see the 1.4 and 1.3.1.1921 in the hex (0x) numbers above (0x781 = 1921). They should be compared numerically with the target version numbers in the same 64-bit format.

#2 User is offline   R H Steele 

  • Executive Vice President
  • Group: Status: R.I.P. or just Retired
  • Posts: 3,562
  • Joined: 14-March 13
  • Gender:Male
  • Location:known universe
  • Simulator:Open Rails
  • Country:

Posted 30 August 2021 - 09:37 AM

I'm assuming this only applies to those who use the OR update function. I looked at the location named above and found no version folder in the registry. I have always downloaded and manually installed various versions of OR, never using the updater...having first installed and setup the latest stable version to set the registry. Is there a downside to not using the updater?

#3 User is offline   James Ross 

  • Open Rails Developer
  • Group: Posts: Elite Member
  • Posts: 5,514
  • Joined: 30-June 10
  • Gender:Not Telling
  • Simulator:Open Rails
  • Country:

Posted 30 August 2021 - 02:06 PM

View PostR H Steele, on 30 August 2021 - 09:37 AM, said:

I'm assuming this only applies to those who use the OR update function. I looked at the location named above and found no version folder in the registry. I have always downloaded and manually installed various versions of OR, never using the updater...having first installed and setup the latest stable version to set the registry. Is there a downside to not using the updater?

Sorry, I wasn't clear: this will apply to all copies of the Stable Version and Testing Version, no matter whether you use the installer, built-in updater, or zip files.

The code is currently only in Unstable Version, where it does not do anything (same goes for if you build it yourself).

#4 User is offline   R H Steele 

  • Executive Vice President
  • Group: Status: R.I.P. or just Retired
  • Posts: 3,562
  • Joined: 14-March 13
  • Gender:Male
  • Location:known universe
  • Simulator:Open Rails
  • Country:

Posted 30 August 2021 - 02:23 PM

James, http://www.elvastower.com/forums/public/style_emoticons/default/sign_thank_you.gifhttp://www.elvastower.com/forums/public/style_emoticons/default/hi.gif

#5 User is offline   Genma Saotome 

  • Owner Emeritus and Admin
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • Group: ET Admin Group
  • Posts: 15,661
  • Joined: 11-January 04
  • Gender:Male
  • Location:United States
  • Simulator:Open Rails
  • Country:

Posted 30 August 2021 - 09:09 PM

FWIW, for a while I was testing several versions at the same time. I don't do that now but perhaps others do.

#6 User is offline   R H Steele 

  • Executive Vice President
  • Group: Status: R.I.P. or just Retired
  • Posts: 3,562
  • Joined: 14-March 13
  • Gender:Male
  • Location:known universe
  • Simulator:Open Rails
  • Country:

Posted 30 August 2021 - 10:03 PM

Dave, Ive always had several versions at once, the last stable version, then --- a couple of testing versions ("U" versions), one or two Monogame Versions, and the Ultimate version. Never had any problems.

#7 User is offline   RR1 

  • Hostler
  • Group: Posts: Active Member
  • Posts: 83
  • Joined: 03-March 13
  • Gender:Male
  • Simulator:OR
  • Country:

Posted 31 August 2021 - 04:05 AM

View PostWeter, on 30 August 2021 - 06:00 PM, said:

So, if someone runs another, say, testing version, that registry entries will be overwritten with that version numbers?
And what about a case, when someone having a number of versions at the same time?

Looking at James's post, the registry version names are all unique so it looks to me (if I'm interpreting this correctly) like all OR versions can happily co-exist.

#8 User is offline   James Ross 

  • Open Rails Developer
  • Group: Posts: Elite Member
  • Posts: 5,514
  • Joined: 30-June 10
  • Gender:Not Telling
  • Simulator:Open Rails
  • Country:

Posted 31 August 2021 - 07:36 AM

View PostWeter, on 30 August 2021 - 06:00 PM, said:

So, if someone runs another, say, testing version, that registry entries will be overwritten with that version numbers?
And what about a case, when someone having a number of versions at the same time?


View PostRR1, on 31 August 2021 - 04:05 AM, said:

Looking at James's post, the registry version names are all unique so it looks to me (if I'm interpreting this correctly) like all OR versions can happily co-exist.

Yes, the different versions (Stable and Testing) are kept separate.

But also, "Storing the latest version number" - this code will only change what is stored if you run a newer version (by version number).

So, if you switch between multiple Stable or Testing versions, the registry entry will contain the newest of each.

#9 User is offline   steved 

  • Vice President
  • Group: Posts: Elite Member
  • Posts: 2,225
  • Joined: 19-December 09
  • Gender:Male
  • Location:South of here
  • Simulator:ORMG
  • Country:

Posted 31 August 2021 - 08:54 AM

View PostR H Steele, on 30 August 2021 - 10:03 PM, said:

Dave, Ive always had several versions at once, the last stable version, then --- a couple of testing versions ("U" versions), one or two Monogame Versions, and the Ultimate version. Never had any problems.


Can you tell me where to download the Ultimate version.
Never heard of that one.

#10 User is offline   R H Steele 

  • Executive Vice President
  • Group: Status: R.I.P. or just Retired
  • Posts: 3,562
  • Joined: 14-March 13
  • Gender:Male
  • Location:known universe
  • Simulator:Open Rails
  • Country:

Posted 31 August 2021 - 10:51 AM

View Poststeved, on 31 August 2021 - 08:54 AM, said:

Can you tell me where to download the Ultimate version.
Never heard of that one.



Ultimate version is a fork of the main branch of the OR code, it is maintained by "perpetualkid" at GitHub...I have not kept up with this fork.
Regards, Gerry
Ultimate Ver. -- Fork of OR code

#11 User is offline   James Ross 

  • Open Rails Developer
  • Group: Posts: Elite Member
  • Posts: 5,514
  • Joined: 30-June 10
  • Gender:Not Telling
  • Simulator:Open Rails
  • Country:

Posted 01 September 2021 - 02:37 PM

View PostWeter, on 31 August 2021 - 07:46 AM, said:

So, this is for ensure, that content, being installed, is supported/compatible by/with at least one of existing ORTS installation on given system, for avoiding false error reports?

Yes. The content installer can check "Does the user have Open Rails 1.4 or higher?" to prevent known problems, e.g. the content relies on a feature new in 1.4.

#12 User is offline   James Ross 

  • Open Rails Developer
  • Group: Posts: Elite Member
  • Posts: 5,514
  • Joined: 30-June 10
  • Gender:Not Telling
  • Simulator:Open Rails
  • Country:

Posted 03 September 2021 - 07:53 AM

View PostWeter, on 01 September 2021 - 06:14 PM, said:

Slight off top: if I run openrails.exe it is still checking for dx9, sends me to uncle bill for downloading them and prevents menu.exe from launching, so I have to run menu.exe directly. Is this procedure still necessary in the monogame era of ORTS? Furthermore, dx9 are not available for download from there already. And not needed for W10 as well...

You are correct, these checks are out of date. We should have updated them when we switched to MonoGame but we forgot.

Chris has updated them as part of the installer updates for 1.4, so this problem should already be fixed in Unstable, and will soon be fixed in Testing.

#13 User is offline   James Ross 

  • Open Rails Developer
  • Group: Posts: Elite Member
  • Posts: 5,514
  • Joined: 30-June 10
  • Gender:Not Telling
  • Simulator:Open Rails
  • Country:

Posted 16 October 2021 - 03:17 AM

View PostJames Ross, on 30 August 2021 - 06:10 AM, said:

https://james-ross.co.uk/temp/Screenshot%202021-08-30%20150044.png

To finalise this for 1.4 let me restate exactly what should happen in 3rd party applications:

  • Open registry key "HKEY_CURRENT_USER\SOFTWARE\OpenRails\ORTS\Version"
  • Read "Stable" data as REG_QWORD - version number for comparison
  • Read "Stable_Version" data as REG_SZ - version string for display
  • Compare the version number against the target, e.g. 0x1000400000000 for 1.4, 0x1000500000000 for 1.5, etc.
  • If it is not high enough, display an appropriate error for your application, using the version string in the message to indicate what the user currently has installed
  • If the key or values do not exist, you can assume the user either does not have Open Rails or has a version prior to 1.4

Note that "Stable_Build" and "Stable_Updated" are not used for this check. The build data could be shown in the error message next to the version, but will make little sense to users. The updated data is really for internal use only.

Under no circumstances are people to try comparing versions with the version string. This is extremely hard to get right and there are no official rules on how to do it.

Always compare with the version number ("Stable" QWORD)!

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users