Getting Started: Python
Get started with our python library.
Install velopack from the Python Package Index:
pip install velopack
Add the following code to your entry point (eg. main.py
) as early as possible (before any electron startup code etc.):
import velopack
if __name__ == "__main__":
# Velopack builder needs to be the first thing to run in the main process.
# In some cases, it might quit/restart the process to perform tasks.
velopack.App().run()
# ... your other app startup code here
Velopack provides a simple way to check for updates and apply them. The following shows how to implement a basic update check within your application.
You can also split up the various methods to allow your users to control when to check for updates, download them, or apply them.
def update_app():
manager = velopack.UpdateManager("https://the.place/you-host/updates")
update_info = manager.check_for_updates()
if not update_info:
return # no updates available
# Download the updates, optionally providing progress callbacks
manager.download_updates(update_info)
# Apply the update and restart the app
manager.apply_updates_and_restart(update_info)
Compile your app to a binary (eg. .exe
on Windows). Example using PyInstaller:
pyinstaller --onedir app.py
Velopack uses a command line tool called vpk
to package and publish releases.
It is distributed as a .NET global tool. Though Velopack can be used with app from various languages, the .NET is required to install and run vpk
.
You can install the .NET SDK from the .NET download page.
Once .NET is installed, you can install vpk
by running:
dotnet tool install -g vpk
You are now ready to build a Velopack release for your application.
The --packId
can be any unique application identifier that you wish to use. Because this must be unique across all applications,
we recommend including your company name: <CompanyName>.<AppName>
.
The --mainExe
option is only required if your executable name is different than the --packId
of your application.
See the CLI reference for more details on the available options.
vpk pack --packId YourAppId --packVersion 1.0.0 --packDir .\publish --mainExe yourMainApp.exe
✅ You're Done! Your app now has auto-updates and an installer.
You can upload your release to your website, or use the vpk upload
command to publish it to the destination of your choice.
You can also check out our Sample Apps to see completed examples that leverage Velopack.