The Mission Planner Update System manages the software maintenance lifecycle, including version detection, differential file synchronization, and secure execution of the update bootstrapper. It supports multiple release tracks and ensures data integrity through cryptographic verification.
The system is primarily implemented in the MissionPlanner.Utilities.Update class, which coordinates with an external Updater.exe to perform file operations while the main application is offline. It also includes mechanisms for synchronizing external metadata such as vehicle parameters and terrain data.
The following diagram maps high-level update concepts to the specific classes and methods that implement them.
Sources: Utilities/Update.cs39-40 Utilities/Update.cs115-116 ExtLibs/Utilities/Download.cs35-36 app.config10-13
Mission Planner utilizes app.config to define endpoints for three distinct update streams. This allows the system to toggle between stable, beta, and bleeding-edge "master" builds.
| Channel | Flag | Primary Metadata URL | Archive URL |
|---|---|---|---|
| Stable | Default | UpdateLocationVersion | UpdateLocationZip |
| Beta | dobeta | BetaUpdateLocationVersion | BetaUpdateLocationZip |
| Master | domaster | MasterUpdateLocationMD5 | MasterUpdateLocationZip |
Sources: app.config9-18 Utilities/Update.cs28-29 Utilities/Update.cs46-63
The function CheckForUpdate performs a synchronous check against the remote version.txt.
version.txt file in the application directory Utilities/Update.cs125-128HttpClient from the URL defined in app.config Utilities/Update.cs132-134System.Version class to compare strings. If LocalVersion < WebVersion, the update flag is set Utilities/Update.cs168-173Sources: Utilities/Update.cs115-181
To minimize bandwidth, Mission Planner uses an MD5-based differential update strategy in CheckMD5.
The system downloads a checksums.txt file containing a list of all files in the distribution and their expected MD5 hashes. It iterates through local files:
.new extension to prevent conflicts with the running process Utilities/Update.cs83-87The DownloadStream class ExtLibs/Utilities/Download.cs35 provides a specialized Stream implementation for handling large downloads. It features:
chunksize of 250KB) ExtLibs/Utilities/Download.cs39_cacheChunks dictionary to store downloaded memory streams, reducing redundant network requests ExtLibs/Utilities/Download.cs47Timer triggers expireCache() every 30 seconds to clean up stale chunks ExtLibs/Utilities/Download.cs94-96Sources: Utilities/Update.cs39-63 ExtLibs/Utilities/Download.cs35-60 ExtLibs/Utilities/Download.cs125-169
Since Windows prevents replacing executable files that are currently in use, Mission Planner delegates the final installation to a separate assembly: Updater.exe.
Update.updateCheckMain prepares the environment and verifies Updater.exe itself isn't pending an update Utilities/Update.cs83-87Updater.exe and immediately calls Application.Exit() Utilities/Update.cs97-101MissionPlanner.exe (using mono if on a Unix/Mac environment) Utilities/Update.cs67-79The system detects the environment using Type.GetType("Mono.Runtime") Utilities/Update.cs41-42 On Linux/macOS, it uses /bin/bash -c 'mono ...' to invoke the updater, whereas on Windows it executes the PE binary directly Utilities/Update.cs67-79
Sources: Utilities/Update.cs65-102
Beyond software binaries, the system synchronizes vehicle parameter metadata and terrain elevation data.
The ParameterMetaDataParser class retrieves vehicle-specific parameter descriptions from ArduPilot source repositories ExtLibs/Utilities/ParameterMetaDataParser.cs18-19
HttpClient to fetch Parameters.cpp files from URLs defined in app.config ExtLibs/Utilities/ParameterMetaDataParser.cs58-63_paramMetaRegex to extract metadata keys (e.g., Range, Units) and values ExtLibs/Utilities/ParameterMetaDataParser.cs22-24ParameterMetaData.xml using XmlTextWriter ExtLibs/Utilities/ParameterMetaDataParser.cs89-95The srtm class manages elevation data tiles ExtLibs/Utilities/srtm.cs18-19
Sources: ExtLibs/Utilities/ParameterMetaDataParser.cs56-70 ExtLibs/Utilities/srtm.cs40-42 app.config19-21
Refresh this wiki