updateCheck module

Update checking functionality. @note: This module may raise C{RuntimeError} on import if update checking for this build is not supported.

updateCheck.CHECK_URL = 'https://www.nvaccess.org/nvdaUpdateCheck'

The URL to use for update checks.

updateCheck.CHECK_INTERVAL = 86400

The time to wait between checks.

updateCheck.RETRY_INTERVAL = 600

The time to wait before retrying a failed check.

updateCheck.DOWNLOAD_BLOCK_SIZE = 8192

The download block size in bytes.

updateCheck.storeUpdatesDir = 'updates'

directory to store pending update files

updateCheck.state: Dict[str, Any] | None = None

Persistent state information.

updateCheck.autoChecker: AutoUpdateChecker | None = None

The single instance of L{AutoUpdateChecker} if automatic update checking is enabled, C{None} if it is disabled.

updateCheck.getQualifiedDriverClassNameForStats(cls)

fetches the name from a given synthDriver or brailleDisplay class, and appends core for in-built code, the add-on name for code from an add-on, or external for code in the NVDA user profile. Some examples: espeak (core) newfon (external) eloquence (addon:CodeFactory) noBraille (core)

updateCheck.checkForUpdate(auto: bool = False) Dict | None

Check for an updated version of NVDA. This will block, so it generally shouldn’t be called from the main thread. @param auto: Whether this is an automatic check for updates. @return: Information about the update or C{None} if there is no update. @raise RuntimeError: If there is an error checking for an update.

updateCheck._setStateToNone(_state)
updateCheck.getPendingUpdate() Tuple | None

Returns a tuple of the path to and version of the pending update, if any. Returns C{None} otherwise.

updateCheck.isPendingUpdate() bool

Returns whether there is a pending update.

updateCheck.executePendingUpdate()
updateCheck._executeUpdate(destPath: str) None

Execute the update process.

Parameters:

destPath – The path to the update executable.

updateCheck._generate_updateParameters() str

Generate parameters to pass to the new NVDA instance for the update process.

We generate parameters that specify: - Whether to install, update a portable copy, or run the launcher. - Whether to disable addons. - The path to the configuration directory.

Returns:

The parameters to pass to the new NVDA instance.

class updateCheck.UpdateChecker

Bases: TrackedObject

Check for an updated version of NVDA, presenting appropriate user interface. The check is performed in the background. This class is for manual update checks. To use, call L{check} on an instance.

AUTO = False
check()

Check for an update.

_bg()
_started()
_error()
_result(info: Dict | None) None
class updateCheck.AutoUpdateChecker

Bases: UpdateChecker

Automatically check for an updated version of NVDA. To use, create a single instance and maintain a reference to it. Checks will then be performed automatically.

AUTO = True
terminate()
setNextCheck(isRetry=False)
_started()
_error()
_result(info)
class updateCheck.UpdateResultDialog(parent, updateInfo: Dict | None, auto: bool)

Bases: DpiScalingHelperMixinWithoutInit, ContextHelpMixin, Dialog

helpId = 'GeneralSettingsCheckForUpdates'
onUpdateButton(destPath)
onDownloadButton(evt)
_download()
onLaterButton(evt)
onReviewAddonsButton(evt)
class updateCheck.UpdateAskInstallDialog(parent, destPath, version, apiVersion, backCompatTo)

Bases: DpiScalingHelperMixinWithoutInit, ContextHelpMixin, Dialog

helpId = 'GeneralSettingsCheckForUpdates'
onReviewAddonsButton(evt)
onUpdateButton(evt)
onPostponeButton(evt)
class updateCheck.UpdateDownloader(updateInfo)

Bases: TrackedObject

Download and start installation of an updated version of NVDA, presenting appropriate user interface. To use, call L{start} on an instance.

Constructor. @param updateInfo: update information such as possible URLs, version and the SHA-1 hash of the file as a hex string. @type updateInfo: dict

start()

Start the download.

_guiExec(func, *args)
_guiExecNotify()
_bg()
_download(url)
_downloadReport(read, size)
_stopped()
_error()
_downloadSuccess()
class updateCheck.DonateRequestDialog(parent, continueFunc)

Bases: Dialog

MESSAGE = 'We need your help in order to continue to improve NVDA.\nThis project relies primarily on donations and grants. By donating, you are helping to fund full time development.\nIf even $10 is donated for every download, we will be able to cover all of the ongoing costs of the project.\nAll donations are received by NV Access, the non-profit organisation which develops NVDA.\nThank you for your support.'
onDonate(evt)
onClose(evt)
updateCheck.saveState()
updateCheck.initialize()
updateCheck.terminate()
class updateCheck.CERT_USAGE_MATCH

Bases: Structure

_fields_ = (('dwType', <class 'ctypes.c_ulong'>), ('cUsageIdentifier', <class 'ctypes.c_ulong'>), ('rgpszUsageIdentifier', <class 'ctypes.c_void_p'>))
cUsageIdentifier

Structure/Union member

dwType

Structure/Union member

rgpszUsageIdentifier

Structure/Union member

class updateCheck.CERT_CHAIN_PARA

Bases: Structure

RequestedIssuancePolicy

Structure/Union member

RequestedUsage

Structure/Union member

_fields_ = (('cbSize', <class 'ctypes.c_ulong'>), ('RequestedUsage', <class 'updateCheck.CERT_USAGE_MATCH'>), ('RequestedIssuancePolicy', <class 'updateCheck.CERT_USAGE_MATCH'>), ('dwUrlRetrievalTimeout', <class 'ctypes.c_ulong'>), ('fCheckRevocationFreshnessTime', <class 'ctypes.c_long'>), ('dwRevocationFreshnessTime', <class 'ctypes.c_ulong'>), ('pftCacheResync', <class 'ctypes.c_void_p'>), ('pStrongSignPara', <class 'ctypes.c_void_p'>), ('dwStrongSignFlags', <class 'ctypes.c_ulong'>))
cbSize

Structure/Union member

dwRevocationFreshnessTime

Structure/Union member

dwStrongSignFlags

Structure/Union member

dwUrlRetrievalTimeout

Structure/Union member

fCheckRevocationFreshnessTime

Structure/Union member

pStrongSignPara

Structure/Union member

pftCacheResync

Structure/Union member

updateCheck._updateWindowsRootCertificates()