Closed
Bug 1337530
Opened 9 years ago
Closed 9 years ago
Default browser detection doesn't work for new installs since bug 1324617
Categories
(Firefox :: Installer, defect)
Tracking
()
VERIFIED
FIXED
Firefox 54
| Tracking | Status | |
|---|---|---|
| firefox54 | --- | fixed |
People
(Reporter: molly, Assigned: molly)
References
Details
Attachments
(1 file)
In bug 1324617 I broke the check for whether the browser is currently set as the default on Windows. This is visible in the general preferences, which always claims that we aren't the default browser and offers to change the setting, even if we actually are the default browser.
This only applies to new installs since bug 1324617 landed; installations updated to that version are not affected. And it won't be necessary to reinstall to pick up the fix for this regression.
| Comment hidden (mozreview-request) |
Comment 2•9 years ago
|
||
| mozreview-review | ||
Comment on attachment 8834972 [details]
Bug 1337530 - Fix Windows default browser detection.
https://reviewboard.mozilla.org/r/110708/#review112126
Talked over removing the additional checks that were kept for Vista and above since not all apps used IApplicationAssociationRegistration when it was first introduced. Clearing review.
Attachment #8834972 -
Flags: review?(robert.strong.bugs)
| Comment hidden (mozreview-request) |
Comment 4•9 years ago
|
||
Somewhat unrelated to this bug. I tested things a little bit and found multiple entries for the same install location
Examples:
HKEY_CURRENT_USER\SOFTWARE\Clients\StartMenuInternet\Firefox-4FD8BA6A4A33F689\shell\open\command
Default = "c:\Program Files\Nightly\firefox.exe"
HKEY_CURRENT_USER\SOFTWARE\Clients\StartMenuInternet\Firefox-A3710B8EBB50CD3\shell\open\command
Default = "C:\Program Files\Nightly\firefox.exe"
Prior to these appearing I deleted all entries keys under
HKEY_CURRENT_USER\SOFTWARE\Clients\StartMenuInternet
I also have both entries under
HKEY_CURRENT_USER\SOFTWARE\RegisteredApplications
Firefox-4FD8BA6A4A33F689 = Software\Clients\StartMenuInternet\Firefox-4FD8BA6A4A33F689\Capabilities
Firefox-A3710B8EBB50CD3 = Software\Clients\StartMenuInternet\Firefox-A3710B8EBB50CD3\Capabilities
Of these two I only have
HKEY_LOCAL_MACHINE\SOFTWARE\RegisteredApplications
Firefox-4FD8BA6A4A33F689 = Software\Clients\StartMenuInternet\Firefox-4FD8BA6A4A33F689\Capabilities
and
HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Firefox-4FD8BA6A4A33F689
I first noticed this when trying to set as default and having two entries for Nightly and Firefox said it was default no matter which one I selected.
| Assignee | ||
Comment 5•9 years ago
|
||
I haven't seen that. I assume the second entry got created by whatever decided to use a lowercase drive letter, but I don't know what that would have been.
Comment 6•9 years ago
|
||
I did what I usually do when I test these sort of changes which is install using the installer and then run the following from a command prompt as admin.
cd into the installation's uninstall directory.
helper.exe /PostUpdate
helper.exe /SetAsDefaultAppGlobal
helper.exe /SetAsDefaultAppUser
I'll try to reproduce again in a few minutes.
| Assignee | ||
Comment 7•9 years ago
|
||
That STR doesn't reproduce it for me, I still just get one set of entries in all those places.
Comment 8•9 years ago
|
||
It reproduced twice last night but I might not have your last installer patch in the build I tested with so I updated my repo and am building again.
Comment 9•9 years ago
|
||
(In reply to Matt Howell [:mhowell] from comment #0)
> This only applies to new installs since bug 1324617 landed; installations
> updated to that version are not affected. And it won't be necessary to
> reinstall to pick up the fix for this regression.
I see this "Nightly is not your default browser" problem in Nightly (on Windows 10 Insider Preview channel), even though my Nightly installation is not a new install.
Comment 10•9 years ago
|
||
(In reply to Robert Strong [:rstrong] (use needinfo to contact me) from comment #8)
> It reproduced twice last night but I might not have your last installer
> patch in the build I tested with so I updated my repo and am building again.
and now it no longer reproduces after rebuilding.
Comment 11•9 years ago
|
||
| mozreview-review | ||
Comment on attachment 8834972 [details]
Bug 1337530 - Fix Windows default browser detection.
https://reviewboard.mozilla.org/r/110708/#review112642
::: browser/components/shell/nsWindowsShellService.cpp:178
(Diff revision 2)
> // FileAssociations .xhtml REG_SZ FirefoxHTML-<PathHash>
> // StartMenu StartMenuInternet REG_SZ <appname>-<PathHash>
> // URLAssociations ftp REG_SZ FirefoxURL-<PathHash>
> // URLAssociations http REG_SZ FirefoxURL-<PathHash>
> // URLAssociations https REG_SZ FirefoxURL-<PathHash>
>
Remove the entire 'Default Browser Registry Settings' section above since the registry checks are removed and only IApplicationAssociationRegistration is used.
::: browser/components/shell/nsWindowsShellService.cpp:327
(Diff revision 2)
> do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv);
> NS_ENSURE_SUCCESS(rv, rv);
>
> nsCOMPtr<nsIFile> exeFile;
> rv = dirSvc->Get(XRE_EXECUTABLE_FILE,
> - NS_GET_IID(nsIFile),
> + NS_GET_IID(nsIFile),
nit: why not keep the existing indentation so it is consitent in the file?
::: browser/components/shell/nsWindowsShellService.cpp:341
(Diff revision 2)
> - uint64_t hash = CityHash64(static_cast<const char *>(path.get()),
> - path.Length() * sizeof(nsAutoString::char_type));
> -
> aAppRegName = APP_REG_NAME_BASE;
> - aAppRegName.AppendInt((int)hash, 16);
> + uint64_t hash = CityHash64(static_cast<const char *>(appDirStr.get()),
> + appDirStr.Length() * sizeof(nsAutoString::char_type));
nit: why not keep the existing indentation so it is consitent in the file?
::: browser/components/shell/nsWindowsShellService.cpp:367
(Diff revision 2)
> - if (NS_FAILED(rv)) {
> - *aIsDefaultBrowser = false;
> - return NS_OK;
> + return NS_OK;
> - }
> + }
>
> - ::ZeroMemory(currValue, sizeof(currValue));
> + *aIsDefaultBrowser = IsAARDefault(pAAR, L"http");
Previously, if aCheckAllTypes is true then pAAR->QueryAppIsDefaultAll was called on all versions of Windows. Maybe IsDefaultBrowserVista made you think it was only for Vista. It looks like the patch in bug 796038 made it so anything later than Win8 would override that result though which is weird. I'm ok with this and will followup later in another bug if needed.
Attachment #8834972 -
Flags: review?(robert.strong.bugs)
Comment 12•9 years ago
|
||
| mozreview-review | ||
Comment on attachment 8834972 [details]
Bug 1337530 - Fix Windows default browser detection.
https://reviewboard.mozilla.org/r/110708/#review112648
Attachment #8834972 -
Flags: review+
Comment 13•9 years ago
|
||
r+ with the comments addressed of course.
| Assignee | ||
Comment 14•9 years ago
|
||
(In reply to Chris Peterson [:cpeterson] from comment #9)
> I see this "Nightly is not your default browser" problem in Nightly (on
> Windows 10 Insider Preview channel), even though my Nightly installation is
> not a new install.
I had forgotten that some of the registry entries that get created on new installs are also updated in a few other places. This patch should fix the default browser detection in that case as well. But I need to be more thorough about those code paths handling existing installs. I'll file a new bug to address those.
| Assignee | ||
Comment 15•9 years ago
|
||
| mozreview-review-reply | ||
Comment on attachment 8834972 [details]
Bug 1337530 - Fix Windows default browser detection.
https://reviewboard.mozilla.org/r/110708/#review112642
> nit: why not keep the existing indentation so it is consitent in the file?
Visual Studio decides to do this sometimes and I don't always notice. It wasn't intentional. I'll put it back.
| Comment hidden (mozreview-request) |
Comment 17•9 years ago
|
||
Pushed by mhowell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e4c6ea682f56
Fix Windows default browser detection. r=rstrong
Comment 18•9 years ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 54
Comment 19•9 years ago
|
||
FYI: I can confirm that this made an impact on Windows 8 in automation:
https://screenshots.mattn.ca/compare/?oldProject=mozilla-central&oldRev=25a94c1047e793ef096d8556fa3c26dd72bd37d7&newProject=mozilla-central&newRev=b83e2b2524c981eabae7c48f8ea6988544e5087a&filter=%5Ewin.*_prefsGeneral
It didn't change Windows 7 but that could be because the test machines don't have it set as the default there:
http://mozilla-releng-blobs.s3.amazonaws.com/blobs/mozilla-central/sha512/bdc4c34cad9eefb0f42867dc5dadcfc694585997cf1e993a5eaa3515ae76da2bf28d55cfd718d9f36e34d55162544d9a69ca0c98b86dd9c5b23d86c65c3868c8
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•