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.
  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

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

#11 User is online   James Ross 

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

Posted 01 September 2021 - 02:37 PM

 Weter, 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 online   James Ross 

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

Posted 03 September 2021 - 07:53 AM

 Weter, 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 online   James Ross 

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

Posted 16 October 2021 - 03:17 AM

 James 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)!

  • 2 Pages +
  • 1
  • 2
  • 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