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
Release files for updaterForExe 1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| updaterForExe-1.0.tar.gz | 5.3 kB | Details |
Release files / updaterForExe-1.0.tar.gz
| Download URL | updaterForExe-1.0.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6c87666ad4d23b0cbd2dadcde83e15a26aaf539342f80aae5cb1115f45e0666e
|
|
BLAKE2b-256 checksum How to use checksums |
3535263c4d1cbbeb3a7d06e767216f7211bed501397ac3c08cf16340a223e80e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
|