Skip to main content

PyWinSparkle

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.

Release files for pywinsparkle 1.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for pywinsparkle 1.6.0
File
pywinsparkle-1.6.0-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details
pywinsparkle-1.6.0-cp37-cp37m-win32.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-32 Details
pywinsparkle-1.6.0-cp36-cp36m-win_amd64.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-64 Details
pywinsparkle-1.6.0-cp36-cp36m-win32.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-32 Details
pywinsparkle-1.6.0-cp35-cp35m-win_amd64.whl CPython 3.5 CPython 3.5 pymalloc Windows x86-64 Details
pywinsparkle-1.6.0-cp35-cp35m-win32.whl CPython 3.5 CPython 3.5 pymalloc Windows x86-32 Details
pywinsparkle-1.6.0-cp34-cp34m-win_amd64.whl CPython 3.4 CPython 3.4 pymalloc Windows x86-64 Details
pywinsparkle-1.6.0-cp34-cp34m-win32.whl CPython 3.4 CPython 3.4 pymalloc Windows x86-32 Details
pywinsparkle-1.6.0-cp33-cp33m-win_amd64.whl CPython 3.3 CPython 3.3 pymalloc Windows x86-64 Details
pywinsparkle-1.6.0-cp33-cp33m-win32.whl CPython 3.3 CPython 3.3 pymalloc Windows x86-32 Details
pywinsparkle-1.6.0-cp27-cp27m-win_amd64.whl CPython 2.7 CPython 2.7 pymalloc Windows x86-64 Details
pywinsparkle-1.6.0-cp27-cp27m-win32.whl CPython 2.7 CPython 2.7 pymalloc Windows x86-32 Details

Total release size: 24.6 MB

Release files / pywinsparkle-1.6.0-cp37-cp37m-win_amd64.whl

Download URL pywinsparkle-1.6.0-cp37-cp37m-win_amd64.whl
Size 2.1 MB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
014b2052054e4288ab2220f83aa1315303f736a55dc8e616e2d1eb410f6863d2
BLAKE2b-256 checksum
How to use checksums
73137ba0d174d02466841668528313eae92882fc8b2d2fb28bdd3b259a32aa72
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / pywinsparkle-1.6.0-cp37-cp37m-win32.whl

Download URL pywinsparkle-1.6.0-cp37-cp37m-win32.whl
Size 2.1 MB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
bee9133e0b768b4b108b891c76e4727a17b06e2757126fefe4f1cbde82c6e435
BLAKE2b-256 checksum
How to use checksums
f4734ffa4060d3de0cae6b3040f084229d4c6223bdecb45fb66c3ba16c33afb0
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / pywinsparkle-1.6.0-cp36-cp36m-win_amd64.whl

Download URL pywinsparkle-1.6.0-cp36-cp36m-win_amd64.whl
Size 2.1 MB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
091ab657df7304a7a5ce8230bb83029bb20d269772d641bc48703863924daa0a
BLAKE2b-256 checksum
How to use checksums
8ddeb8e379440a43977aa0b62cc17b827202e5607c6d164b6de186972339bd78
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / pywinsparkle-1.6.0-cp36-cp36m-win32.whl

Download URL pywinsparkle-1.6.0-cp36-cp36m-win32.whl
Size 2.1 MB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
36d5798b3f3b00bb49dc459f5de064d766f2e1eebf05e896b6654fc840224e48
BLAKE2b-256 checksum
How to use checksums
e1dfdd9fa0bf069ebd5bae35364f68b32177fdfb405de1e112b0c247666a899d
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / pywinsparkle-1.6.0-cp35-cp35m-win_amd64.whl

Download URL pywinsparkle-1.6.0-cp35-cp35m-win_amd64.whl
Size 2.1 MB
Tags CPython 3.5 CPython 3.5 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
cbec679340d1389e5db49b3b9349e36c9debbaa4dd6e22b1d943441014f68893
BLAKE2b-256 checksum
How to use checksums
2cd3e55e3c3905c76644d3801afccf9b2e9b7f993719dcdc43ef5dbbdaa4c348
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / pywinsparkle-1.6.0-cp35-cp35m-win32.whl

Download URL pywinsparkle-1.6.0-cp35-cp35m-win32.whl
Size 2.1 MB
Tags CPython 3.5 CPython 3.5 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
7c5c87ec10d7fca04cd437c721775921a5ac1a9f8ea3b4a944d24081931c38d8
BLAKE2b-256 checksum
How to use checksums
06f6eed06dd6b28bbd7f8e4ed7fc08bb2b3eb54a11c4b8911b1979b4cf5ea029
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / pywinsparkle-1.6.0-cp34-cp34m-win_amd64.whl

Download URL pywinsparkle-1.6.0-cp34-cp34m-win_amd64.whl
Size 2.1 MB
Tags CPython 3.4 CPython 3.4 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
6fc0476710ddfc76a61123d82e199555463267f6d1557a0a3bd9a498f9f070f0
BLAKE2b-256 checksum
How to use checksums
d12d073306b620e4a1c81d91544768464bd80ac18cd353b74e7b4121bf047812
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / pywinsparkle-1.6.0-cp34-cp34m-win32.whl

Download URL pywinsparkle-1.6.0-cp34-cp34m-win32.whl
Size 2.1 MB
Tags CPython 3.4 CPython 3.4 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
6378b98c87f453a893e78020f63d0349e073454530e229f80b937bb08dfd7ad5
BLAKE2b-256 checksum
How to use checksums
7305f943ab8225416c6cadb2a1bdb755f40d861547caad2c78a5656c9210485f
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / pywinsparkle-1.6.0-cp33-cp33m-win_amd64.whl

Download URL pywinsparkle-1.6.0-cp33-cp33m-win_amd64.whl
Size 2.1 MB
Tags CPython 3.3 CPython 3.3 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
746d8ce85e4c30f28a9aa71ba794ab6143c68e57ccb8235e398ff8a31cf42b5d
BLAKE2b-256 checksum
How to use checksums
192e8be11eb6ec9ea3da0cfca612112e9b3a9b6533da4787b6c10a2056639d21
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / pywinsparkle-1.6.0-cp33-cp33m-win32.whl

Download URL pywinsparkle-1.6.0-cp33-cp33m-win32.whl
Size 2.1 MB
Tags CPython 3.3 CPython 3.3 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
5b5896b55c71fac8e58be710b53a60617f40e43780514b47c6ee4493188f00b7
BLAKE2b-256 checksum
How to use checksums
1c39ea234bc17d2145f92a071018fe29ae9455bf272be874083073a4c5d18023
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / pywinsparkle-1.6.0-cp27-cp27m-win_amd64.whl

Download URL pywinsparkle-1.6.0-cp27-cp27m-win_amd64.whl
Size 2.1 MB
Tags CPython 2.7 CPython 2.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
d1c746ff683268692d504ba04399de69c84baab97f099b45d863a13d0348a089
BLAKE2b-256 checksum
How to use checksums
2b62a5fbac3b49d99acbcdce3cc27ce1a1de5c3b6e3a2ff24689829d43d84dd9
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / pywinsparkle-1.6.0-cp27-cp27m-win32.whl

Download URL pywinsparkle-1.6.0-cp27-cp27m-win32.whl
Size 2.1 MB
Tags CPython 2.7 CPython 2.7 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
5d06be8eaf5cf2fb368f4999697a397e1626405cf7d32888146b7200fe434766
BLAKE2b-256 checksum
How to use checksums
1416fc0a6b156c455373594c2b6bf8af83f3eff2098ce90364a57fa791cb1f12
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

1.6.0 This release

12 release files

1.5.0

10 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page