The Problem: "Download the new ZIP, please" ๐ฉ Weโve all been there. You write a cool Python script, maybe wrap it in a GUI using Tkinter or PyQt, and share it with the world (or your colleagues).
But then you fix a bug.
Now you have to tell everyone: "Hey, delete the old folder, download this new ZIP, extract it, and run the new EXE."
It feels ancient. It kills the user experience.
I wanted my open-source privacy tool, DotScramble, to feel like a modern application (like VS Code or Chrome). I wanted it to update itself silently, handle data professionally, and run on Windows, Linux, and macOS without me compiling binaries manually.
So, I built DotScramble V2.0. Here is how I engineered an Enterprise-Grade Desktop App using nothing but Python and GitHub Actions.
Whaโฆ
The Problem: "Download the new ZIP, please" ๐ฉ Weโve all been there. You write a cool Python script, maybe wrap it in a GUI using Tkinter or PyQt, and share it with the world (or your colleagues).
But then you fix a bug.
Now you have to tell everyone: "Hey, delete the old folder, download this new ZIP, extract it, and run the new EXE."
It feels ancient. It kills the user experience.
I wanted my open-source privacy tool, DotScramble, to feel like a modern application (like VS Code or Chrome). I wanted it to update itself silently, handle data professionally, and run on Windows, Linux, and macOS without me compiling binaries manually.
So, I built DotScramble V2.0. Here is how I engineered an Enterprise-Grade Desktop App using nothing but Python and GitHub Actions.
What is DotScramble? ๐ Before we dive into the code, DotScramble is an advanced image privacy studio. It allows developers and users to:
Automatically detect and blur faces or license plates in photos.
Redact sensitive text (OCR) from documents.
Process images in bulk (Batch Processing).
The new V2 release introduces a Hybrid Architecture (GUI + CLI) and a custom Silent Auto-Update System.
The Architecture ๐๏ธ
- The Hybrid Approach (GUI + CLI) Most Python apps are either command-line scripts OR windowed apps. I wanted both.
I structured the main.py entry point to check for arguments. If you pass arguments (like -i image.jpg), it runs in Headless Mode for automation. If not, it launches the Tkinter GUI.
Python
main.py logic
if len(sys.argv) > 1: # Running in a CI pipeline or server? Use CLI. run_cli_mode() else: # User double-clicked the icon? Launch GUI. launch_gui()
- The Silent Auto-Updater (The Hard Part) ๐ Updating a running executable (Frozen Bundle) is tricky because the OS locks the file. You canโt just overwrite yourself while running.
I implemented a "Passive Update" strategy:
Check: On startup, the app queries the GitHub API for the latest release tag.
Download: If a new version exists, it downloads the binary to a hidden temp folder in the background (AppData/Roaming/DotScramble/temp).
Notify: It does not interrupt the user. A small button appears in the status bar: "โฌ๏ธ Update Ready (Restart)".
Switch: When the user restarts, a small batch script (generated on the fly) runs:
Waits for the app to close.
Moves the new binary from Temp to the installation folder.
Restarts the app.
This provides a seamless, zero-friction experience.
- Professional Data Management Amateur apps clutter your "Downloads" folder with logs/, configs/, and saves/. I utilized Pythonโs pathlib and sys.platform to detect the OS and store data where it belongs:
Windows: %APPDATA%\DotScramble
Linux/Mac: ~/.local/share/DotScramble
The CI/CD Pipeline (GitHub Actions) ๐ค I didnโt want to manually build EXEs. I set up a Matrix Strategy in GitHub Actions.
Every time I push a tag (e.g., v2.0.0), the pipeline:
Spins up Ubuntu, Windows, and macOS runners simultaneously.
Installs system dependencies (like Tesseract OCR).
Injects the specific version number into the Python code.
Runs PyArmor (for obfuscation) and PyInstaller.
Uploads the binaries to the GitHub Release page.
This means I can deploy to three operating systems in under 3 minutes by just pushing a tag.
Try It Out (Open Source) ๐งช This project was a fantastic journey into moving from "Scripting" to "Software Engineering."
It is 100% Free and Open Source. You can grab the latest release, check out the CI/CD YAML files, or steal the Auto-Updater code for your own projects!
๐ GitHub Repository: https://github.com/kareem2099/DotScramble
Iโd love to hear your feedback in the comments or on GitHub Issues!
Happy Coding! โค๏ธ
If you found this useful, drop a generic unicorn reaction! ๐ฆ