-
Notifications
You must be signed in to change notification settings - Fork 972
Prevent loss of default browser on Windows during upgrade/reinstall/etc #8060
Conversation
This prevents default browser from being reset on upgrade / reinstall. Fixes #5246 Auditors: @bbondy, @jonathansampson
|
||
Push $EXEDIR | ||
Call GetParent | ||
Call GetParent |
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.
Sorry for the confusing diff; This is the fix here (calling GetParent
a second time)
I messed around with my .gitconfig for about 20 minutes trying it to only recognize this one line change before giving up and just checking it in like this. I believe this file in particular was checked in with CRLF (and I'm not about to change my config to do that). Good news: future updates won't have this conflict
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.
++
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.
I had to look into GetParent to understand the fix, but I think I get it now. Nice work!
@bsclifton do you think QA work on this needs to be postponed until 0.14.2? |
@luixxiul do you mean postponed until 0.14.3? (the version after this?) I believe a valid test is to install the same version on top of what you already have. For example, with 0.14.1 (which does not have the fix), you can do these steps:
The same steps should not repro for 0.14.2 (because it will properly handle the path) |
Yes, I just misunderstood the current version number. |
@srirambv OK - let me see if I can find a way that you can reset the cache. There is something called the MUI cache which is holding onto that value |
@srirambv here are some steps you can take to force the MUI cache to reload:
|
@bsclifton Works perfect after deleting reg values 👍 (verified on 0.14.2 RC2) |
Test plan
Prevent loss of default browser on Windows during upgrade/reinstall/etc
This should be attempted on Windows 7 and 10
http
andhttps
changed for BraveUpdate name shown in Windows to Brave Software (was Brave Inc)
While doing the test plan for Windows default browser, make sure all places in the UI say
Brave Software
and notBrave Inc
. See below screenshots for expected before/after.Description
Prevent loss of default browser on Windows during upgrade/reinstall/etc
Fixes #5246
BraveHTML
Default Programs
, users can associate an extension or protocol with a handler (which in our case isBraveHTML
.Each upgrade was breaking default browser because the install or upgrade updates the path which is not allowed. For example, it would set:
"C:\Users\brian\AppData\Local\brave\app-0.13.4\Brave.exe" -- "%1"
to
"C:\Users\brian\AppData\Local\brave\app-0.13.5\Brave.exe" -- "%1"
Changing the value of keys associated with the
BraveHTML
handler would trigger the reset of the handler for http and https (but not extensions, email, or FTP). Specifically these keys:HKEY_CURRENT_USER\SOFTWARE\Classes\BraveHTML\DefaultIcon
HKEY_CURRENT_USER\SOFTWARE\Classes\BraveHTML\shell\open\command
This PR fixes the issue by linking to the stub executable. Using the above example, this would look like:
"C:\Users\brian\AppData\Local\brave\Brave.exe" -- "%1"
This stub executable was something introduced (I believe) with Squirrel 1.5.0. We already use it for the shortcut which gets installed on the desktop (in fact, this change was something @aekeus
and I had to resolve because it broke the params being passed).
The stub executable has an absolute path which does not change, meaning:
Update name shown in Windows to
Brave Software
(wasBrave Inc
)Fixes #2061
BEFORE change
AFTER change
git rebase -i
to squash commits (if needed).