[3.5] [Patch] Support four part version numbers and raise an error if the version number can't be parsed

We had an issue where a 4 part version number would cause a versionCode of 0 to always be generated. This prevents upgrades and breaks our MDM solution, so I fixed the code to support 4 part version numbers. Also, it raises an error if the version number is in an unexpected format rather than working and erroneously setting versionCode to 0.