I have a program that we create an exe with for distribution. My clients run XP and Vista and 7. We are trying to make the installation easier by adjusting where the log file writes to in Win7 and Vista as we did not have to worry about that in XP. We are trying to use platform.release() to then decide where to write the log file. If it is not XP then we will write the log file to the location specified by os.environ["LOCALAPPDATA"].
I am just trying to make sure that when running on an XP machine that we are only going to get ‘XP’ as the return value, for Vista and 7 we also will only get those expected results. For instance is there some flavor of XP that will return XP.v2 (I made that up)?
We have Googled around for the answer and can’t find anything that is specific enough to be certain.
Thanks for any help.
Cheers
The definitive answer can be found in the source code to the exact version of your Python interpreter. I am using CPython 2.7.1. Its source code available for free download, and here is the relevant code (found in
Lib/platform.py):After reading this code I wouldn’t expect to see a
releasevalue other than ‘XP’ on a Windows XP box.