Digital-Sapphire/PyUpdater

Client.update_check(APPNAME, APPVERSION) always returning None?

elgizabbasov opened this issue · 3 comments

I am trying to use PyUpdater with PyQt5 and when the code reaches the check for updates, it always returns None. Does anyone know how to fix this issue?

from pyupdater.client import Client
from client_config import ClientConfig
from qtwindow import MyWindow
import pyqtupdater
import sys
from PyQt5.QtWidgets import QApplication

def CheckForUpdates():
    CLIENT_CFG = ClientConfig()
    client = Client(ClientConfig())
    client.refresh()
    # Optionally you can use release channels
    # Channel options are stable, beta & alpha
    # Note: Patches are only created & applied on the stable channel
    app_update = client.update_check(CLIENT_CFG.APP_NAME, pyqtupdater.APP_VERSION, channel='stable')
    print(app_update) # Currently none 
    # Use the update object to download an update & restart the app
    if app_update is not None:
        downloaded = app_update.download()
        print("Here")
        if downloaded is True:
            status = 'Extracting update and restarting.'
            print(status)
            app_update.extract_restart()

def Run():
    app = QApplication(sys.argv)
    win = MyWindow()
    win.show()
    sys.exit(app.exec_())
    
if __name__ == "__main__":
    CheckForUpdates()
    Run()

In addition to that, I thought that if I build and process & sign a release say 1.0, and then change my version to 1.1 and build and process & sign it again, the 1.0 executable PyQt5 application would automatically open up a window with the 1.1 version but it is still showing me version 1.0, do I have to do stuff manually to update it or how would this work?

The issue was on my end, you can close it :)

The issue was on my end, you can close it :)

How you solve this issue same thing are with me. I received this error
DEBUG:pyupdater.client:Setting up directories...
DEBUG:dsdev_utils.helpers:Version str: 1.1.0
DEBUG:pyupdater.client:No update manifest found
Version 1
Actually I want to download file from github and update app
from pyupdater.client import Client,AppUpdate, LibUpdate
import logging
from client_config import ClientConfig

logging.basicConfig(level=logging.DEBUG)
APP_NAME = 'PyUpdater App'
APP_VERSION = '1.1.0'

ASSET_NAME = 'PyUpdater App'
ASSET_VERSION = '1.2.0'

def progress(data):
print('Time remaining'.format(data['time']))

def log_progress(data):
log.debug('Total file size %s', data['total'])

Or you can add them later.

client = Client(ClientConfig(),refersh=True,headers={'basic_auth': 'wpN1q1X5wOuID21CFzjgdnNVY7qIOlipZeQACb3jeqc'})
#client.add_progress_hook(log_progress)
#client.add_progress_hook(progress)
client.platform = "win"
app_update = client.update_check(APP_NAME,APP_VERSION)
if app_update is not None:
app_update.download()
else:
print("Version 1")
#if app_update.is_downloaded():
#app_update.extract()

#app_update.update_folder

And client_config file code are
class ClientConfig(object):
PUBLIC_KEY = 'wpN1q1X5wOuID21CFzjgdnNVY7qIOlipZeQACb3jeqc'
APP_NAME = 'PyUpdater App'
COMPANY_NAME = 'JBL'
HTTP_TIMEOUT = 30
MAX_DOWNLOAD_RETRIES = 3
UPDATE_URLS = ['https://github.com/asad1234go/task1']
and github link are
https://github.com/asad1234go/task1