Auto-update feature #135
base: develop
Are you sure you want to change the base?
Auto-update feature #135
Conversation
ioannis-e
commented
May 13, 2014
•
edited
edited
- download setup file from www.sourceforge.net depending on architecture
- verify embedded signature
- run setup file
- close mpc-hc instance
- implement update for portable instances (ie not installed) - download and save 7z archive
- decide download location
- implement updating to nightlies
- internationalization of new strings
if nightlies build script can output a version.txt file containing the version of the latest nightly, then we can also implement automatic updates to nightlies. |
Thanks for the patch! It already does; that's how it skips rebuilding the same nightly, but one thing at a time. /CC @Underground78 since we were discussing about this the other day. |
src/mpc-hc/UpdateCheckerDlg.cpp
Outdated
#include <wintrust.h> | ||
|
||
// Link with the Wintrust.lib file. | ||
#pragma comment (lib, "wintrust") |
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.
Please move this in the project file.
We need to consider some things, before getting this in, like the fact that we'll no longer be able to be part of the SF accelerator program. Which in that case, I need to see about other solutions like a CDN. |
What about people not using the installer? |
Also, |
Also I think people should be able to download the file without installing immediately. |
You mean there should be an option for that too? IMO auto update should mean auto update, download and install the new version automatically. |
Well maybe just a button to open the browser but maybe you're right. Anyway the most important is to find a solution for people who aren't using the installer. |
I dont know does the installer perform any library registration, or other tasks ? As far as i tried the installer does not run properly with the commandline paramemter supplied in the comment (ie. to run silently). |
@ioannis-e: it should run fine as long as you have killed the running process. I will have a look at this later today and let you know. As for the non installer instances, I don't think we should unpack anything; we should just ask the user where to place the 7z/zip file and let them do the remaining stuff themselves. |
Is there a way to detect wether the current instance is running from an installed instance or portable ? |
Yes. x64: x86: https://github.com/mpc-hc/mpc-hc/blob/master/distrib/mpc-hc_setup.iss#L118 The installer is using the above 2 to detect if we are already installed. |
Also should the installer run silently or normally ? |
I think you're looking for https://github.com/mpc-hc/mpc-hc/blob/master/src/mpc-hc/mplayerc.cpp#L771
You shouldn't rely on the registry keys, since they may be present even though MPC-HC is set up to be portable. |
You can use the registry without using the installer so just checking for the ini isn't enough I think. |
@ioannis-e: I will check out the installer issues later and let you know. Or you can check http://www.jrsoftware.org/ishelp/topic_setupcmdline.htm @Armada651: you need to rely on registry keys. |
Well all i want to know I think is whether i am running from an installed location, to download installer else to download 7z file... |
@XhmikosR It still wouldn't be reliable, since I can have an installed and a portable instance. |
You should just check for the uninstaller path I think. |
It wouldn't catch the case where you switch to an INI file after installing it, but I guess it's okay to use an installer in that case. |
INI vs registry shouldn't be a problem here. The question is just to know if we have an existing install. |
Are you sure the SF accelerator program prohibits direct downloads? It doesn't seem to affect FileZilla at all who also have an auto-updater that downloads directly from SF. But the real question is whether we can accept the drop in revenue. Also, we might want to use some kind of redirect URL from mpc-hc.org or something similar. Since we could switch to another hosting solution for our releases in the future and we don't want our old builds to keep attempting to update from SF in that case. |
Testing with: Runs installer and starts installation automatically showing progress. I'll be checking the following, for installed path
x64
|
@Armada651: The installer itself is using those registry keys. If one messes up those it's their fault. |
My vision of this auto-update thing:
|
@alexmarsev: Well thats why i put a consept down for discussion. You are discussing it off the record for a long time and no action is being taken. In my opinion auto update should only apply for installed versions. |
That's why I'm partaking in the discussion.
Why? I can't find any reasons besides "we're too lazy to implement it right". |
Well in my mind when i choose to go portable its because i found a version that is stable on my system(s), and i want it unchanged, thats why i said in my opinion :) |
@Underground78 Execution flags is for when the installer changes, it's not exactly impossible. |
We can do it without much hassle, Inno Setup can do this:
A bit more for shortcuts and stuff, but it's doable. |
I guess that would make things easier indeed. |
What I'm worried about now though, portable versions will collect outdated files that way. And there's no easy way around it. Maybe it makes sense to limit auto-update only to installed versions after all. And show something similar to our current dialog for portable versions (I don't think we can organize "download .7z" thing nicely). |
Maybe we could just ask the user where to download the zip but it might not be that useful I don't know. |
Current implementation: |
Why not ask before downloading? Anyway wait for other opinions since I'm not exactly sure what should be done for the not installed case. |
We could ask before, it doesn't matter, i was commenting on current code in PR. Thought i'd agree with @alexmarsev on this that it should unpack and replace the files automatically, without user involvment. If it is done, it should be done right. |
You might end up doing something bad by trying cleaning up automagically. :/ |
So consensus upto now:
Points for further discussion:
Regarding non-installations:
|
I totally disagree with automating portable installs updates. If one is using a portable install they know how to extract a zip file themselves. That being said, @Armada651 yes we will lose any gains we get by using autoupdates since we won't have any visits. It's impossible to keep up with the amount of emails I get (I received like 130 emails in the last 6 hours) so if someone needs my feedback CC me. |
Temp as download location is ok. |
61780d8
to
4676703
Compare
4676703
to
b3ede16
Compare
FileZilla for example uses the default Download dir for it's auto-updates, I always hated that because I don't really use it and I clear my TMP dir regulary. About the flow, I think nothing should happen completly automatically. So there should always be a prompt that asks the user if he wants to update now, or (might be done in a future step) after he closes MPC-HC so the updates still happen but don't interrupt what the user was about to do any longer than necessary. I don't think portable installations should be treated any different from normally installed ones, if the updater detects portable, just download the zip and extract it instead of running the installer and restart/close MPC accordingly. |
@ioannis-e: care to rebase this and sort a couple of things in order to get this in? |
@XhmikosR wow just to note that @Stanzilla last post was exactly 2 years ago :D This pr was initially based on If i remember correctly (i need to go through the discussion again) certain changes to the installer were previously discussed that need to be addressed as well. |
Yeah, I know, things were slow. Just trying to clean up the PRs and get things going. You can close this and make a new one against develop if you find it easier. |
[x] download setup file from www.sourceforge.net depending on architecture [x] verify embedded signature [x] run setup file [x] close mpc-hc instance
- [x] Use default application icon - [x] Use MB instead of mb - [x] Sleep earlier in order to allow setup to start installation automatically
No. I changed base branch to develop. Github added this feature finally. |
b3ede16
to
cc9feec
Compare
Fine, with additional 7z/portable variant. I think if someone haven't used installer to install MPC-HC we should ask where to download new package. Possibly with automation to extract files in current working dir.
Yes, and auto update should be only triggered from MPC-HC instance which matches install directory in register. Otherwise we fall into portable case.
In temp. https://msdn.microsoft.com/en-us/library/windows/desktop/aa364992.aspx
If so installer should be modified to use portable mode. So don't modify registry and stuff like that. It is possible to do without much hassle. I'd agree in portable case only 7z package is downloaded for user, but installer solution will be more convenient for fast update. Ok. What is done and what remain to be done? Is the checklist at top valid? |
Not sure if it fits mpc-hc but https://github.com/Squirrel/Squirrel.Windows is quite cool. |