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