#pragma once #include #include #include // All fields must be default-initialized struct UpdateState { enum State { upToDate = 0, errorDownloading = 1, readyToDownload = 2, readyToInstall = 3, networkError = 4 } state = upToDate; std::wstring releasePageUrl; std::optional githubUpdateLastCheckedDate; std::wstring downloadedInstallerFilename; // To prevent concurrent modification of the file, we enforce this interface, which locks the file while // the state_modifier is active. static void store(std::function stateModifier); static UpdateState read(); };