New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial implementation of the Dolphin auto-updater for Windows #6463
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically just nits
Source/Core/DolphinQt2/Main.cpp
Outdated
| class QtAutoUpdateChecker : public AutoUpdateChecker | ||
| { | ||
| public: | ||
| QtAutoUpdateChecker(QWidget* parent) : m_parent(parent) {} |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Source/Core/UICommon/AutoUpdate.cpp
Outdated
|
|
||
| #ifdef _WIN32 | ||
|
|
||
| const char* UPDATER_FILENAME = "Updater.exe"; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Source/Core/UICommon/AutoUpdate.cpp
Outdated
| PROCESS_INFORMATION pinfo; | ||
| INFO_LOG(COMMON, "Updater command line: %s", UTF16ToUTF8(command_line).c_str()); | ||
| if (!CreateProcessW(UTF8ToUTF16(reloc_updater_path).c_str(), | ||
| const_cast<wchar_t*>(command_line.c_str()), NULL, NULL, FALSE, 0, NULL, NULL, |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Source/Core/Updater/Main.cpp
Outdated
| 0x54, 0xdf, 0x54, 0xf4, 0x42, 0x80, 0xa6, 0x28, 0x8b, 0x6d, 0x70, | ||
| 0x14, 0xb5, 0x4c, 0x34, 0x95, 0x20, 0x4d, 0xd4, 0xd3, 0x5d}; | ||
|
|
||
| const char* UPDATE_TEMP_DIR = "TempUpdate"; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Source/Core/Updater/Main.cpp
Outdated
|
|
||
| std::string HexEncode(const u8* buffer, size_t size) | ||
| { | ||
| std::string out; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Source/Core/Updater/Main.cpp
Outdated
| if (!tokenized) | ||
| return {}; | ||
|
|
||
| std::vector<std::string> argv; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Source/Core/Updater/Main.cpp
Outdated
| size_t filename_end_pos = manifest.find('\t', pos); | ||
| if (filename_end_pos == std::string::npos) | ||
| { | ||
| fprintf(log_fp, "Manifest entry %zd: could not find filename end.\n", parsed.entries.size()); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Source/Core/Updater/Main.cpp
Outdated
| TodoList::DeleteOp del; | ||
| del.filename = entry.first; | ||
| del.old_hash = entry.second; | ||
| todo.to_delete.push_back(del); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Source/Core/Updater/Main.cpp
Outdated
| update.filename = entry.first; | ||
| update.old_hash = old_hash; | ||
| update.new_hash = entry.second; | ||
| todo.to_update.push_back(update); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| std::vector<std::string> CommandLineToUtf8Argv(PCWSTR command_line) | ||
| { | ||
| int nargs; | ||
| LPWSTR* tokenized = CommandLineToArgvW(command_line, &nargs); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
Personal preference - if the person auto-updates Dolphin, they probably want to run Dolphin, so, I think the updater should boot the new version of Dolphin when it's done updating. |
|
Yeah, we can implement that later. IMO it needs to be optional, because UI-wise I think we need two modes: "Update now" and "Update when I next close Dolphin". In the latter case you don't want to restart, in the former you probably do. Could be another command line flag. I'd like to keep anything non critical out of this PR to get as much mileage as possible as early as possible, using the fact that it's default-disabled to experiment :) |
|
(Copied from IRC conversation) Two-phase rollover for key pins should be supported by allowing for multiple signatures at the bottom of the update manifest. The server-side logic for doing so should be pretty simple, as the client is sending the exact version they're updating from. |
Updater.exe takes as input manifests and applies the difference between these manifests to an install directory. Currently lacking a UI.
…uded in default builds
The AutoUpdate module is a generic update checker mechanism which can be used by UI backends to trigger an auto-update check as well as the actual update process. Currently only configurable through .ini and the Qt implementation is completely placeholder-y -- blocking the main thread on a network request on startup, etc.
|
@riking done. |
|
EDIT moved to #6496 |
First of all, I would recommend reading the documentation on the Wiki: https://github.com/dolphin-emu/dolphin/wiki/Auto-update-internals
This is missing several features but should be good enough for people to start testing and contributing: