Skip to content
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

Merged
merged 7 commits into from Mar 20, 2018

Conversation

delroth
Copy link
Member

@delroth delroth commented Mar 18, 2018

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:

  • This defaults to not updating. Set "TrackForTesting" to "dev" in your Dolphin.ini to enable auto-updating. If testing from this PR, you might want to set your HashOverride in the config to some real Dolphin version from the last 2-3 months in order to get an auto-update prompt.
  • The updater does not have any visual cue as to what is happening. Ideally it would have a progress bar window or whatever.
  • Only Qt2 triggers an update check at startup, and it does so terribly because I couldn't be bothered to properly do multithreaded stuff. So expect a blocking network request on Qt2 startup if you have the option enabled.
  • There is no UI implemented apart from a stupidly simple Yes/No dialog. Of course this is not final.

Copy link
Member

@lioncash lioncash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically just nits

class QtAutoUpdateChecker : public AutoUpdateChecker
{
public:
QtAutoUpdateChecker(QWidget* parent) : m_parent(parent) {}

This comment was marked as off-topic.


#ifdef _WIN32

const char* UPDATER_FILENAME = "Updater.exe";

This comment was marked as off-topic.

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.

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.


std::string HexEncode(const u8* buffer, size_t size)
{
std::string out;

This comment was marked as off-topic.

if (!tokenized)
return {};

std::vector<std::string> argv;

This comment was marked as off-topic.

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.

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.

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.

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.

@JMC47
Copy link
Contributor

JMC47 commented Mar 19, 2018

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.

@delroth
Copy link
Member Author

delroth commented Mar 19, 2018

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 :)

@riking
Copy link
Contributor

riking commented Mar 20, 2018

(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.
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.
@delroth
Copy link
Member Author

delroth commented Mar 20, 2018

@riking done.

@Helios747 Helios747 merged commit ad8c316 into dolphin-emu:master Mar 20, 2018
@ghost
Copy link

ghost commented Mar 29, 2018

EDIT moved to #6496

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants