Skip to content

LwkRenCup/UpdateSystem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

UpdateSystem

UpdateSystem is a lightweight, self-contained auto-update launcher written in Python.
It checks for new versions, downloads updates, installs them, and launches your application — regardless of the language it is written in.

This system is ideal for small and medium projects that need a simple update mechanism without external dependencies or complex installers.


Features

  • Version checking via a remote version.txt
  • Automatic update download from a ZIP archive
  • Automatic extraction into the application directory
  • Launches any type of program (Python, EXE, shell script, Java, Node, etc.)
  • Customizable UI (title, theme, app name)
  • No external libraries required
  • Works on Windows, Linux, macOS

How It Works

  1. The launcher starts and displays a small Tkinter window.
  2. It reads the local version from:
core/version.txt
  1. It fetches the remote version from:
http://yourserver/version.txt
  1. If a newer version exists, the user is prompted to update.
  2. If accepted, the launcher downloads:
latest.zip
  1. The ZIP is extracted into the application directory.
  2. The main program is launched.

Program Compatibility

UpdateSystem can launch any executable, not just Python scripts.

Modify this line in the launcher:

subprocess.Popen(["python3", PROGRAM_PATH])

Examples:

Windows .exe

subprocess.Popen([PROGRAM_PATH])

Linux binary

subprocess.Popen([PROGRAM_PATH])

Shell script

subprocess.Popen(["bash", PROGRAM_PATH])

Java JAR

subprocess.Popen(["java", "-jar", PROGRAM_PATH])

Node.js app

subprocess.Popen(["node", PROGRAM_PATH])

As long as the program can be executed from a command, UpdateSystem can launch it.


Configuration

At the top of the launcher script, you can customize:

LAUNCHER_TITLE = "MyApp Launcher"
LAUNCHER_APP_NAME = "MyApp"
LAUNCHER_THEME = "clam"

Available themes (depending on OS)

  • clam
  • alt
  • default
  • classic
  • vista (Windows)
  • xpnative (Windows)

Server Requirements

Your update server must provide two files:

version.txt

Contains only the version number, for example:

1.2

or:

1.2.5

latest.zip

A ZIP archive containing the updated files.
The ZIP must mirror the structure of your application directory.


Version Format

UpdateSystem compares versions as plain strings, not semantic version numbers.

This means:

  • 1.2 works
  • 1.10 works
  • 1.2.5 works
  • 2024.01.15 works

You are not limited to two digits — any consistent version format works.

If needed, the system can be upgraded to use semantic versioning or numeric comparison.


Local Testing

You can test updates using a local HTTP server:

python3 -m http.server 8000

Place version.txt and latest.zip in the directory where you run the server.

Then set:

REMOTE_VERSION_URL = "http://localhost:8000/version.txt"
REMOTE_ZIP_URL = "http://localhost:8000/latest.zip"

Project Structure Example

UpdateSystem/
 ├─ launcher/
 │   └─ launcher.py
 ├─ core/
 │   ├─ myprogram.py
 │   └─ version.txt
 └─ updates/
     └─ latest.zip   (downloaded automatically)

Launching the Application

Make the launcher executable (Linux/macOS):

chmod +x launcher.py

Run it:

./launcher.py

Or simply:

python3 launcher.py

License

This project is free to use and modify.
No attribution required, but appreciated.

About

a simple, good Update System made in python, but can be used with other programs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages