Patch from Paul McNett to check for the Acrobat version more robustly
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@46362 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -22,19 +22,25 @@ def get_acroversion():
|
||||
global _acroversion
|
||||
if _acroversion == None:
|
||||
import _winreg
|
||||
acrosoft = [r'SOFTWARE\Adobe\Acrobat Reader\%version%\InstallPath',
|
||||
r'SOFTWARE\Adobe\Adobe Acrobat\%version%\InstallPath',]
|
||||
|
||||
for regkey in acrosoft:
|
||||
for version in ('8.0', '7.0', '6.0', '5.0', '4.0'):
|
||||
adobesoft = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, r'Software\Adobe')
|
||||
acrokeys, acroversions = [], []
|
||||
for index in range(_winreg.QueryInfoKey(adobesoft)[0]):
|
||||
key = _winreg.EnumKey(adobesoft, index)
|
||||
if "acrobat" in key.lower():
|
||||
acrokeys.append(_winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, 'Software\\Adobe\\%s' % key))
|
||||
for acrokey in acrokeys:
|
||||
print acrokey
|
||||
for index in range(_winreg.QueryInfoKey(acrokey)[0]):
|
||||
key = _winreg.EnumKey(acrokey, index)
|
||||
try:
|
||||
path = _winreg.QueryValue(_winreg.HKEY_LOCAL_MACHINE,
|
||||
regkey.replace('%version%', version))
|
||||
_acroversion = version
|
||||
break
|
||||
acroversions.append(float(key))
|
||||
except:
|
||||
continue
|
||||
pass
|
||||
acroversions.sort(reverse=True)
|
||||
if acroversions:
|
||||
_acroversion = acroversions[0]
|
||||
return _acroversion
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
@@ -54,7 +60,7 @@ def get_acroversion():
|
||||
# Co-ordinates passed as parameters are in points (1/72 inch).
|
||||
|
||||
|
||||
if get_acroversion() >= '7.0':
|
||||
if get_acroversion() >= 7.0:
|
||||
|
||||
from wx.lib.activexwrapper import MakeActiveXClass
|
||||
import win32com.client.gencache
|
||||
|
Reference in New Issue
Block a user