This PoC demonstrates a simple .NET-based over-the-air (OTA) upgrader for projects that run as services on Windows or Unix systems.
-
This OTAUpdate Helper generates an
upgrader.sh
(for Unix) orupgrader.bat
(for Windows) file in your project's installation binary folder. -
The upgrader script is triggered by the entrypoint (e.g
Program.cs
) once the conditions for an upgrade are met (e.g., a new service binary has been downloaded). -
When invoked, the script first requests the system's service manager to stop the running service.
-
Once the service is stopped, control is released by the main binary, and the service is no longer running.
-
The script then replaces the existing service binary with the new one and starts the updated service using the system's service manager.
-
After starting the upgraded binary, the upgrade process is complete, and the program is successfully updated. 🎉