Closed Bug 324023 Opened 20 years ago Closed 20 years ago

Command line method of setting the default browser

Categories

(Firefox :: Shell Integration, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: mike, Assigned: robert.strong.bugs)

References

Details

(Keywords: fixed1.8.0.4, fixed1.8.1)

Attachments

(1 file)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20051007 Debian/1.7.12-1 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20051007 Debian/1.7.12-1 I have a build environment for machines which automatically installs an operating system image and applications. As part of this process, where Firefox is installed on a machine I want to be able to silently set is as the default browser for all users on the machine. I can achieve the effect I want by logging into the machine as Administrator, and setting FF to be the default browser through "Set Program Access and Defaults". I cannot find any way to automate this from the command line easily. With IE, I can make it take over as the default browser by the simple expedient of running "shmgrate.exe OCInstallReinstallIE", but I can't find any way to go in the other direction, and make Firefox silently become the machine's default browser. This isn't really a bug, but having an analogous capability added to FF would make network management an awful lot easier for me, and might make it more popular in other business environments. Reproducible: Always Steps to Reproduce:
Per the MS spec on this http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/programmersguide/shell_adv/registeringapps.asp we should be able to do this without being interactive and it appears that at one point we had a -silent flag to accomplish this which is no longer working. The following shows the reg entry we make to provide this functionality via "Set Program Access and Defaults" http://lxr.mozilla.org/seamonkey/source/browser/installer/windows/ab-CD.jst#264
Severity: enhancement → normal
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee: nobody → robert.bugzilla
Simple fix that should be all that is needed. I'm going to think on this for a couple of days before requesting review. Note: nsBrowserContentHandler.js has const dch_contractID = "@mozilla.org/browser/final-clh;1"; but http://lxr.mozilla.org/seamonkey/source/toolkit/components/commandlines/public/nsICommandLineHandler.idl#58 references @mozilla.org/browser/clh-final;1 (e.g. final-clh instead of clh-final).
Comment on attachment 209644 [details] [diff] [review] patch (adds handleFlag -silent to nsBrowserContentHandler.js) Benjamin, it appears that xpfe still handles -silent but toolkit apps don't though we still set reg values on win32 to use -silent for this sanme purpose. Anyways, I set this as the last flag to be checked in nsBrowserContentHandler.js with this patch.
Attachment #209644 - Flags: review?(benjamin)
Attachment #209644 - Flags: review?(benjamin) → review+
Fixed on trunk Mike - this adds back the -silent command line argument for the executable. There is already the -setDefaultBrowser command line argument which sets the default browser and along with the -silent switch you will be able to accomplish in future version of the app what you outlined in comment #0.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Will the use of -silent and -setDefaultBrowser set FF as the default for the machine, or only for the user executing the application? I typically install from the local system account, not from the user account.
(In reply to comment #6) > Will the use of -silent and -setDefaultBrowser set FF as the default for the > machine, or only for the user executing the application? I typically install > from the local system account, not from the user account. It is system wide... for per user on the OS / SP combinations that support it (e.g. XP Pro SP1 and Win2K SP3 I believe) there is bug 256566 which would require the ability to support the per user registry keys.
Attachment #209644 - Flags: branch-1.8.1?(benjamin)
Attachment #209644 - Flags: approval-branch-1.8.1?(benjamin) → approval-branch-1.8.1+
Fixed on MOZILLA_1_8_BRANCH
Keywords: fixed1.8.1
*** Bug 332481 has been marked as a duplicate of this bug. ***
Hi. I see that this has been fixed on MOZILLA_1_8_BRANCH. Forgive my ignorance, but does this mean that it will be applied to future 1.5.0.x builds, or only to future 2.x builds? I have trouble keeping track of those details... THanks.
Comment on attachment 209644 [details] [diff] [review] patch (adds handleFlag -silent to nsBrowserContentHandler.js) It is only fixed on the branch that will become Firefox 2.0 and the trunk for future releases. I'll request approval for 1.5.0.3 but I believe it may be too late for that at this time.
Attachment #209644 - Flags: approval1.8.0.3?
Comment on attachment 209644 [details] [diff] [review] patch (adds handleFlag -silent to nsBrowserContentHandler.js) Will aid deployment of this release. a=timr for drivers
Attachment #209644 - Flags: approval1.8.0.3? → approval1.8.0.3+
Checked in to MOZILLA_1_8_0_BRANCH for Firefox 1.5.0.3
Keywords: fixed1.8.0.3
Actually, this will be available in Firefox 1.5.0.4
*** Bug 304104 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: