A python wrapper for the winsparkle project
Project description
About pywinsparkle
An auto-update framework for frozen Python applications on Windows.
Pywinsparkle is a wrapper for the WinSparkle project originally developed by Vaclav Slavik. WinSparkle is an update framework for Windows.
The original WinSparkle project is located here: https://winsparkle.org/
github: https://github.com/vslavik/winsparkle
The current version of PyWinSparkle includes WinSparkle 0.6.0
Note: This is package is not affiliated with the original developer Vaclac Slavik and is therefore technically unofficial.
Installation
pip install pywinsparkle
Wheels are built for 32bit and 64bit versions of Windows, covering Python 2.7 and all python version after 3.3
Note: If you are using one of the above versions pip throws and errror, consider upgrading pip with pip install --upgrade pip
Usage
All of the API function wrapper names are the same as the original WinSparkle project. The only difference is in the argument types which are either python strings or integers. For the callback functions, just the function object is required (ie, the name of the function without the parenthesis).
In pywinsparkle, I have not tested created Windows Resource files, instead I have just been using win_sparkle_set_app_details() function. The Windows Resource files should work though. It is also necessary to set the appcast url with win_sparkle_set_appcast_url().
Basic Example:
from pywinsparkle import pywinsparkle
import os
def no_update_found():
""" when no update has been found, close the updater"""
print("No update found")
print("Setting flag to shutdown PassagesUpdater")
def found_update():
""" log that an update was found """
print("New Update Available")
def encountered_error():
print("An error occurred")
def update_cancelled():
""" when the update was cancelled, close the updater"""
print("Update was cancelled")
print("Setting flag to shutdown PassagesUpdater")
def shutdown():
""" The installer is being launched signal the updater to shutdown """
# actually shutdown the app here
print("Safe to shutdown before installing")
def main():
# register callbacks
pywinsparkle.win_sparkle_set_did_find_update_callback(found_update)
pywinsparkle.win_sparkle_set_error_callback(encountered_error)
pywinsparkle.win_sparkle_set_update_cancelled_callback(update_cancelled)
pywinsparkle.win_sparkle_set_did_not_find_update_callback(no_update_found)
pywinsparkle.win_sparkle_set_shutdown_request_callback(shutdown)
# set application details
update_url = "https://winsparkle.org/example/appcast.xml"
pywinsparkle.win_sparkle_set_appcast_url(update_url)
pywinsparkle.win_sparkle_set_app_details("VendorName", "TestApp1", "1.0.0")
if os.path.isfile('dsa_pub.pem'):
with open('dsa_pub.pem', 'r') as file:
pub_key = file.read()
pywinsparkle.win_sparkle_set_dsa_pub_pem(pub_key)
# initialize
pywinsparkle.win_sparkle_init()
# check for updates
pywinsparkle.win_sparkle_check_update_with_ui()
# alternatively you could check for updates in the
# background silently
pywinsparkle.win_sparkle_check_update_without_ui()
# dont do it this way, just an example to keep the thread running
while True:
time.sleep(1)
if __name__ == "__main__":
main()
API Documentation
The documentation for the API can be found at: http://pythonhosted.org/pywinsparkle
Freezing with Pyinstaller
Add an entry to .SPEC in Analysis for binaries.
Assuming you are using a virtual environment and it is called “venv” it would look like this:
import platform
if architecture == "64bit":
winsparkle = 'venv\\Lib\\site-packages\\pywinsparkle\\libs\\x64\\WinSparkle.dll'
else:
winsparkle = 'venv\\Lib\\site-packages\\pywinsparkle\\libs\\x86\\WinSparkle.dll'
a = Analysis(['Updater\\src\\main.py'],
pathex=['.'],
binaries=[(winsparkle, '.')],
datas=[],
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher)
The package contains DLL’s for both 64bit and 32bit versions of python. Adding the preceding code snippet makes it possible to switch between versions of python seamlessly.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file pywinsparkle-1.6.0-cp37-cp37m-win_amd64.whl
.
File metadata
- Download URL: pywinsparkle-1.6.0-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/28.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 014b2052054e4288ab2220f83aa1315303f736a55dc8e616e2d1eb410f6863d2 |
|
MD5 | fa784c49d980c4d5dacd3910c5a226bb |
|
BLAKE2b-256 | 73137ba0d174d02466841668528313eae92882fc8b2d2fb28bdd3b259a32aa72 |
File details
Details for the file pywinsparkle-1.6.0-cp37-cp37m-win32.whl
.
File metadata
- Download URL: pywinsparkle-1.6.0-cp37-cp37m-win32.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.7m, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/28.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bee9133e0b768b4b108b891c76e4727a17b06e2757126fefe4f1cbde82c6e435 |
|
MD5 | 6eb244e27210660d07789dc6793e6f5a |
|
BLAKE2b-256 | f4734ffa4060d3de0cae6b3040f084229d4c6223bdecb45fb66c3ba16c33afb0 |
File details
Details for the file pywinsparkle-1.6.0-cp36-cp36m-win_amd64.whl
.
File metadata
- Download URL: pywinsparkle-1.6.0-cp36-cp36m-win_amd64.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.6m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/28.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 091ab657df7304a7a5ce8230bb83029bb20d269772d641bc48703863924daa0a |
|
MD5 | b35289b86f46e64bf1f46248420b3721 |
|
BLAKE2b-256 | 8ddeb8e379440a43977aa0b62cc17b827202e5607c6d164b6de186972339bd78 |
File details
Details for the file pywinsparkle-1.6.0-cp36-cp36m-win32.whl
.
File metadata
- Download URL: pywinsparkle-1.6.0-cp36-cp36m-win32.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.6m, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/28.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36d5798b3f3b00bb49dc459f5de064d766f2e1eebf05e896b6654fc840224e48 |
|
MD5 | 3092d4c8e7aa7ab3c6b473301f390d84 |
|
BLAKE2b-256 | e1dfdd9fa0bf069ebd5bae35364f68b32177fdfb405de1e112b0c247666a899d |
File details
Details for the file pywinsparkle-1.6.0-cp35-cp35m-win_amd64.whl
.
File metadata
- Download URL: pywinsparkle-1.6.0-cp35-cp35m-win_amd64.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.5m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/28.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cbec679340d1389e5db49b3b9349e36c9debbaa4dd6e22b1d943441014f68893 |
|
MD5 | 4eadc2148c752045f5b9bef8e1c24d86 |
|
BLAKE2b-256 | 2cd3e55e3c3905c76644d3801afccf9b2e9b7f993719dcdc43ef5dbbdaa4c348 |
File details
Details for the file pywinsparkle-1.6.0-cp35-cp35m-win32.whl
.
File metadata
- Download URL: pywinsparkle-1.6.0-cp35-cp35m-win32.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.5m, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/28.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c5c87ec10d7fca04cd437c721775921a5ac1a9f8ea3b4a944d24081931c38d8 |
|
MD5 | 14ce31edb1fc71c8f3559329a9acc8b7 |
|
BLAKE2b-256 | 06f6eed06dd6b28bbd7f8e4ed7fc08bb2b3eb54a11c4b8911b1979b4cf5ea029 |
File details
Details for the file pywinsparkle-1.6.0-cp34-cp34m-win_amd64.whl
.
File metadata
- Download URL: pywinsparkle-1.6.0-cp34-cp34m-win_amd64.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.4m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/28.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fc0476710ddfc76a61123d82e199555463267f6d1557a0a3bd9a498f9f070f0 |
|
MD5 | e2ab584b72efaa1dffda8e97070c93b5 |
|
BLAKE2b-256 | d12d073306b620e4a1c81d91544768464bd80ac18cd353b74e7b4121bf047812 |
File details
Details for the file pywinsparkle-1.6.0-cp34-cp34m-win32.whl
.
File metadata
- Download URL: pywinsparkle-1.6.0-cp34-cp34m-win32.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.4m, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/28.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6378b98c87f453a893e78020f63d0349e073454530e229f80b937bb08dfd7ad5 |
|
MD5 | 88fe08678a074eca535058ffb8891afb |
|
BLAKE2b-256 | 7305f943ab8225416c6cadb2a1bdb755f40d861547caad2c78a5656c9210485f |
File details
Details for the file pywinsparkle-1.6.0-cp33-cp33m-win_amd64.whl
.
File metadata
- Download URL: pywinsparkle-1.6.0-cp33-cp33m-win_amd64.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.3m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/28.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 746d8ce85e4c30f28a9aa71ba794ab6143c68e57ccb8235e398ff8a31cf42b5d |
|
MD5 | 30e882dae993a7ec8722c9ba746e79f8 |
|
BLAKE2b-256 | 192e8be11eb6ec9ea3da0cfca612112e9b3a9b6533da4787b6c10a2056639d21 |
File details
Details for the file pywinsparkle-1.6.0-cp33-cp33m-win32.whl
.
File metadata
- Download URL: pywinsparkle-1.6.0-cp33-cp33m-win32.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.3m, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/28.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b5896b55c71fac8e58be710b53a60617f40e43780514b47c6ee4493188f00b7 |
|
MD5 | 4a12c2a2f63e49d19b6e7c848cf0b36b |
|
BLAKE2b-256 | 1c39ea234bc17d2145f92a071018fe29ae9455bf272be874083073a4c5d18023 |
File details
Details for the file pywinsparkle-1.6.0-cp27-cp27m-win_amd64.whl
.
File metadata
- Download URL: pywinsparkle-1.6.0-cp27-cp27m-win_amd64.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 2.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/28.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1c746ff683268692d504ba04399de69c84baab97f099b45d863a13d0348a089 |
|
MD5 | cca1c531aebd47eada2e718486b9f422 |
|
BLAKE2b-256 | 2b62a5fbac3b49d99acbcdce3cc27ce1a1de5c3b6e3a2ff24689829d43d84dd9 |
File details
Details for the file pywinsparkle-1.6.0-cp27-cp27m-win32.whl
.
File metadata
- Download URL: pywinsparkle-1.6.0-cp27-cp27m-win32.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 2.7m, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/28.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d06be8eaf5cf2fb368f4999697a397e1626405cf7d32888146b7200fe434766 |
|
MD5 | 0fc2dc845d94db87f359a9b496fa7740 |
|
BLAKE2b-256 | 1416fc0a6b156c455373594c2b6bf8af83f3eff2098ce90364a57fa791cb1f12 |