How to use PyUpdater with updates from USB flash drive

122 Views Asked by At

I am trying to use PyUpdater without an update server, but updates from flash drives instead. Any ideas on how to instantiate the class AppUpdate without the Client.check_update() method?

1

There are 1 best solutions below

0
On

Assuming that "without an update server" refers to an actual online (production) server:

A quick workaround would be to serve the files locally from the usb drive, e.g. using python's http.server:

python -m http.server -d <path to folder on usb drive>

Then you would need to point your app to the corresponding url path on localhost, by adding the url to the UPDATE_URLS in your ClientConfig:

class ClientConfig(object):
    PUBLIC_KEY = 'abcdefg...'
    APP_NAME = 'my-app'
    COMPANY_NAME = 'my-company'
    HTTP_TIMEOUT = 30
    MAX_DOWNLOAD_RETRIES = 3
    UPDATE_URLS = [
        'http://localhost:8000/my_updates/', # <<<<<<<<<< this one
        'https://example.com/my_updates', 
        ...
    ]