mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Nicer error message when running calibre on old windows
This commit is contained in:
parent
0bb121817a
commit
c3dda0d901
@ -125,9 +125,13 @@ def convert_registry_data(raw, size, dtype):
|
||||
return ctypes.cast(raw, ctypes.POINTER(types.QWORD)).contents.value
|
||||
raise ValueError('Unsupported data type: %r' % dtype)
|
||||
|
||||
try:
|
||||
RegSetKeyValue = cwrap(
|
||||
'RegSetKeyValueW', LONG, a('key', HKEY), a('sub_key', LPCWSTR, None), a('name', LPCWSTR, None),
|
||||
a('dtype', DWORD, winreg.REG_SZ), a('data', LPCVOID, None), a('size', DWORD))
|
||||
except Exception:
|
||||
raise RuntimeError('calibre requires Windows Vista or newer to run, the last version of calibre'
|
||||
' that could run on Windows XP is version 1.48, available from: http://download.calibre-ebook.com/')
|
||||
|
||||
def delete_value_errcheck(result, func, args):
|
||||
if result == winerror.ERROR_FILE_NOT_FOUND:
|
||||
|
Loading…
x
Reference in New Issue
Block a user