Project 9: Simple Auto-Updater

An “updater” component for a simple application. The main application, on startup, will quietly make an HTTP request to a static URL you control. It will fetch a JSON file that specifies the latest version and a download link for an MSI. If the fetched version is newer than the application’s current version, it will download the new MSI and launch it.

Quick Reference

Attribute Value
Primary Language C++
Alternative Languages C
Difficulty Level 3: Advanced
Time Estimate 2-3 weeks
Knowledge Area Deployment / Networking
Tooling WinINet or WinHttp, MSI
Prerequisites Project 4 (vcpkg), Project 6 (MSI), basic HTTP knowledge.

What You Will Build

An “updater” component for a simple application. The main application, on startup, will quietly make an HTTP request to a static URL you control. It will fetch a JSON file that specifies the latest version and a download link for an MSI. If the fetched version is newer than the application’s current version, it will download the new MSI and launch it.

Why It Matters

This project builds core skills that appear repeatedly in real-world systems and tooling.

Core Challenges

  • Making HTTP requests with native APIs → maps to using WinINet (higher-level) or WinHttp (more robust)
  • Parsing JSON → maps to integrating a C++ JSON library (e.g., nlohmann/json via vcpkg)
  • Downloading a file from the internet → maps to reading an HTTP response body and writing it to a temporary file
  • Launching the installer → maps to using CreateProcess or ShellExecuteEx to run the downloaded MSI
  • Version comparison → maps to embedding version resources in your executable and reading them at runtime

Key Concepts

Real-World Outcome

{
  "version": "1.1.0",
  "url": "https://my-updates.example.com/MyApp-1.1.0.msi"
}

Implementation Guide

  1. Reproduce the simplest happy-path scenario.
  2. Build the smallest working version of the core feature.
  3. Add input validation and error handling.
  4. Add instrumentation/logging to confirm behavior.
  5. Refactor into clean modules with tests.

Milestones

  • Milestone 1: Minimal working program that runs end-to-end.
  • Milestone 2: Correct outputs for typical inputs.
  • Milestone 3: Robust handling of edge cases.
  • Milestone 4: Clean structure and documented usage.

Validation Checklist

  • Output matches the real-world outcome example
  • Handles invalid inputs safely
  • Provides clear errors and exit codes
  • Repeatable results across runs

References

  • Main guide: LEARN_WINDOWS_SYSTEMS_PROGRAMMING_CPP.md
  • N/A, rely on documentation and articles.