This repository was archived by the owner on Jul 9, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -306,16 +306,23 @@ nsresult nsWindowsShellService::LaunchHTTPHandlerPane() {
306306NS_IMETHODIMP
307307nsWindowsShellService::SetDefaultBrowser (bool aClaimAllTypes,
308308 bool aForAllUsers) {
309- nsAutoString appHelperPath;
310- if (NS_FAILED (GetHelperPath (appHelperPath))) return NS_ERROR_FAILURE ;
309+ // If running from within a package, don't attempt to set default with
310+ // the helper, as it will not work and will only confuse our package's
311+ // virtualized registry.
312+ nsresult rv = NS_OK ;
313+ if (!widget::WinUtils::HasPackageIdentity ()) {
314+ nsAutoString appHelperPath;
315+ if (NS_FAILED (GetHelperPath (appHelperPath))) return NS_ERROR_FAILURE ;
316+
317+ if (aForAllUsers) {
318+ appHelperPath.AppendLiteral (" /SetAsDefaultAppGlobal" );
319+ } else {
320+ appHelperPath.AppendLiteral (" /SetAsDefaultAppUser" );
321+ }
311322
312- if (aForAllUsers) {
313- appHelperPath.AppendLiteral (" /SetAsDefaultAppGlobal" );
314- } else {
315- appHelperPath.AppendLiteral (" /SetAsDefaultAppUser" );
323+ rv = LaunchHelper (appHelperPath);
316324 }
317325
318- nsresult rv = LaunchHelper (appHelperPath);
319326 if (NS_SUCCEEDED (rv) && IsWin8OrLater ()) {
320327 if (aClaimAllTypes) {
321328 if (IsWin10OrLater ()) {
You can’t perform that action at this time.
0 commit comments