Skip to main content

Updater for exe programs

Project description

Updater for exe with firebase

Version format X.X.X (Example: 1.6.11)

Use

import updater

myUpdater = updater.Update(config, webAppUrl, appName, path, optional: debugPath, displayErrorMessages, autoUpdate, assetsFolder, assetsFolderUrl, updateAssetsArg)

myUpdater.checkUpdate()

#Rest of your code
config:

This is your standard config to use when you're working with firebase.

webAppUrl:

Your URL to your new version of the appliecation (example.com/new_version.exe).

appName:

The name of your application or exe name.

path:

The path in your realtime database to check for a new version.

debugPath:

The path to your project when you are still developing in python console.

displayErrorMessages:

If set to True: Messages like 'No internet connection' will appear.

autoUpdate:

If set to True, the user won't be asked to update or not.

assetsFolder:

Set this to true if the assets folder should be updated too. Also the version.json file will be saved there.

assetsFolderUrl:

If 'assetsFolder' is true, you have to specify the URL to your assets folder online (example.com/new_assets.zip)

updateAssetsArg:

If set to 1: The assets folder will be updated at X.X.X If set to 2: The assets folder will only be updated at X.X.0 If set to 3: The assets folder will only be updated at X.0.0

Example

import updater

config = {
    "apiKey": "YOUR-API-KEY",
    "authDomain": "YOU-PROJECT-NAME.firebaseapp.com",
    "databaseURL": "https://YOU-PROJECT-NAME.firebaseio.com",
    "storageBucket": "YOU-PROJECT-NAME.appspot.com",
    "tls": {
        "rejectUnauthorized": False
        }
    }

url = 'example.com/index.exe'
assetsUrl = 'example.com/assets.zip'

myUpdater = updater.Update(config, url, 'index', '/program/version', debugPath='C:/Users/user/Documents/Python/Updater', displayErrorMessages=True, autoUpdate=False, assetsFolder=True, assetsFolderUrl=assestUrl, updateAssetsArg=2)

myUpdater.checkUpdate()

#Rest of your code

Use with pyinstaller

When you want to convert the python file to an executable using py installer, you need additional hooks to use firebase and gcloud. For that you need to create a new python file at some directory NAMED 'hook-gcloud.py' with the following code:

from PyInstaller.utils.hooks import copy_metadata
datas = copy_metadata('gcloud')

When you want to convert the file into an executable you have to add the argument '--additional-hooks-dir the directory to the hook-gcloud.py file'.

Example:

pyinstaller --onfeile --additional-hooks-dir C:\Users\user\hooks index.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for updaterForExe, version 1.0
Filename, size File type Python version Upload date Hashes
Filename, size updaterForExe-1.0.tar.gz (5.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page