except:\r
gettext.install('nvda',unicode=True)\r
\r
+# Check OS version requirements\r
+import winVersion\r
+if not winVersion.canRunVc2010Builds():\r
+ winUser.MessageBox(0, unicode(ctypes.FormatError(winUser.ERROR_OLD_WIN_VERSION)), None, winUser.MB_ICONERROR)\r
+ sys.exit(1)\r
+\r
#Process option arguments\r
parser=NoConsoleOptionParser()\r
parser.add_option('-q','--quit',action="store_true",dest='quit',default=False,help="Quit already running copy of NVDA")\r
]\r
\r
#constants\r
+ERROR_OLD_WIN_VERSION=1150\r
MOUSEEVENTF_LEFTDOWN=0x0002 \r
MOUSEEVENTF_LEFTUP=0x0004 \r
MOUSEEVENTF_RIGHTDOWN=0x0008\r
--- /dev/null
+#winVersion.py\r
+#A part of NonVisual Desktop Access (NVDA)\r
+#Copyright (C) 2006-2013 NV Access Limited\r
+#This file is covered by the GNU General Public License.\r
+#See the file COPYING for more details.\r
+\r
+import sys\r
+import winUser\r
+\r
+def canRunVc2010Builds():\r
+ OSVersion=sys.getwindowsversion()\r
+ if (OSVersion.major, OSVersion.minor) < (5, 1):\r
+ # Earlier than Windows XP.\r
+ return False\r
+ if OSVersion.major == 5:\r
+ if OSVersion.minor == 1:\r
+ # Windows XP for x86.\r
+ return OSVersion.service_pack_major >= 2\r
+ if OSVersion.minor == 2 and OSVersion.product_type!=1: \r
+ # Windows Server 2003.\r
+ # (5.2 x64 is Windows XP x64. Its RTM is based on Server 2003 sp1,\r
+ # so all versions should be fine.)\r
+ return OSVersion.service_pack_major >= 1\r
+ return True\r