Master Nightlies are 5.99, I am not sure what the new pre 5.1.8 nightly Testing branch will show, but that version should be forward and backward compatible with any 5.1.x
In past versions on Windows the -# was a build version for the packaging if an error was made. For example, 5.0.1 got up to 5.0.1-4 while they debugged the Windows builder for v5. As can be verified here: https://kicad-downloads.s3.cern.ch/index.html?prefix=windows/stable/ the latest windows version is 5.1.7-1. I don’t know where the OP got 5.1.7-2 from.
In past versions on Windows the -# was a build version for the packaging if an error was made. For example, 5.0.1 got up to 5.0.1-4 while they debugged the Windows builder for v5. As can be verified here: https://kicad-downloads.s3.cern.ch/index.html?prefix=windows/stable/ the latest windows version is 5.1.7-1. I don’t know where the OP got 5.1.7-2 from.
Except that version string contains parenthesis and a git hash - which means that it was built inside a git repository and the -2 is just the number of commits past the 5.1.7 tag.