Hello,
I'd like to set up a package that restores Firefox as the default browser for all users on a computer.
After some research and testing on one machine, the most effective command seems to be
`C:\Program Files\Mozilla Firefox\uninstall\helper.exe /SetAsDefaultGlobal`.
So I created a package that runs this command with:
`run(r'C:\Program Files\Mozilla Firefox\uninstall\helper.exe /SetAsDefaultGlobal')`.
However, it seems to work on some machines but not others.
After investigating, I suspect it's related to User Account Control (UAC).
I therefore modified the registry before running the command, but it appears that a restart is required for the command to take effect.
My question is: I plan to create two packages: the first disables UAC, and the second restores Firefox as the default browser. How can I ensure a restart occurs between the installation of the two packages?
Thank you
, Matthieu
Firefox is the default browser for all users
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
- Challans Town Hall
- Messages: 15
- Registered: July 7, 2014 - 3:52 PM
Good morning,
Here are the commands to integrate into your setup.py to do this:
For x64 systems:
For x86:
To help you build the script, you may need the functions below:
As well as the example below for concatenating and running the command
Problem observed:
Some Windows updates reset Internet Explorer to default
So, a word of advice: create this package independently of the name, using `tis-firefoxdefaultall`, and place it as a dependency on the main Firefox package
Because this way, to restore Firefox to default, you just need to regenerate a version of tis-firefoxdefaultall which will restore Firefox to default without reinstalling Firefox.
Here are the commands to integrate into your setup.py to do this:
For x64 systems:
Code: Select all
"C:\Program Files (x86)\Mozilla Firefox\uninstall\helper.exe" /SetAsDefaultAppGlobalCode: Select all
"C:\Program Files\Mozilla Firefox\uninstall\helper.exe" /SetAsDefaultAppGlobalCode: Select all
makepath(programfiles32,'Mozilla Firefox','uninstall','helper.exe')Code: Select all
command = r"powershell -NoProfile -NoLogo -NonInteractive -Command import-startlayout -layoutpath screenlayout.bin -mountpath "
path = os.path.normpath('C:\\')
commandsm = ''.join([command,path])
run(commandsm)Some Windows updates reset Internet Explorer to default
So, a word of advice: create this package independently of the name, using `tis-firefoxdefaultall`, and place it as a dependency on the main Firefox package
Because this way, to restore Firefox to default, you just need to regenerate a version of tis-firefoxdefaultall which will restore Firefox to default without reinstalling Firefox.
THANKS,
I'll be back with several tests.
If I understand correctly, this is what I need to write in the package:
Why can't I just do it?
?
I'll be back with several tests.
If I understand correctly, this is what I need to write in the package:
Code: Select all
commande = makepath(programfiles32,'Mozilla Firefox','uninstall','helper.exe')
parametre = '/SetAsDefaultAppGlobal'
commandsm = ' '.join([commande,parametre])
run(commandsm)
Code: Select all
run(r'C:\Program Files (x86)\Mozilla Firefox\uninstall\helper.exe /SetAsDefaultAppGlobal')Has anyone succeeded?
The code
makes me:
CalledProcessErrorOutput: Command 'C:\\Program Files\\Mozilla Firefox\\uninstall\\helper.exe /SetAsDefaultAppGlobal' returned non-zero exit status 1.
Output: 'C:\Program' is not recognized as an internal
or external command, operable program or batch file.
and a simple run
yields: FATAL ERROR: CalledProcessErrorOutput: Command '"C:\\Program Files\\Mozilla Firefox\\uninstall\\helper.exe" /SetAsDefaultAppGlobal' returned non-zero exit status 2.
Output:
Exit code: 3
The code
Code: Select all
commande = makepath(programfiles,'Mozilla Firefox','uninstall','helper.exe')
parametre = '/SetAsDefaultAppGlobal'
commandsm = ' '.join([commande,parametre])
run(commandsm)
CalledProcessErrorOutput: Command 'C:\\Program Files\\Mozilla Firefox\\uninstall\\helper.exe /SetAsDefaultAppGlobal' returned non-zero exit status 1.
Output: 'C:\Program' is not recognized as an internal
or external command, operable program or batch file.
and a simple run
Code: Select all
run_notfatal(r'"C:\Program Files\Mozilla Firefox\uninstall\helper.exe" /SetAsDefaultAppGlobal')Output:
Exit code: 3
Good morning,
While reading: http://kb.mozillazine.org/Default_browser#Windows
Seems more appropriate. Launch it in the session_setup() section of the Firefox package and it should work for all users.
For those interested, Firefox 60 is coming this summer with a set of GPO templates that can be integrated into AD (ADMX files): Alexander
While reading: http://kb.mozillazine.org/Default_browser#Windows
Code: Select all
firefox.exe -silent -setDefaultBrowserFor those interested, Firefox 60 is coming this summer with a set of GPO templates that can be integrated into AD (ADMX files): Alexander
Sorry to be a pain, but the following code:
yields:
FATAL ERROR: CalledProcessErrorOutput: Command '"C:\\Program Files\\Mozilla Firefox\\firefox.exe" -silent -setDefaultBrowser"' returned non-zero exit status 1.
I'm moving the quotation marks and apostrophes around, but nothing is working...
Code: Select all
run(r'"C:\Program Files\Mozilla Firefox\firefox.exe" -silent -setDefaultBrowser"')FATAL ERROR: CalledProcessErrorOutput: Command '"C:\\Program Files\\Mozilla Firefox\\firefox.exe" -silent -setDefaultBrowser"' returned non-zero exit status 1.
I'm moving the quotation marks and apostrophes around, but nothing is working...
The last quotation mark is unnecessary
Ah yes, indeed, but even after correcting it I still have an error...
FATAL ERROR: CalledProcessErrorOutput: Command '"C:\\Program Files\\Mozilla Firefox\\firefox.exe" -silent -setDefaultBrowser' returned non-zero exit status 1.
Code: Select all
run(r'"C:\Program Files\Mozilla Firefox\firefox.exe" -silent -setDefaultBrowser')Good morning,
Would it be possible to install Firefox 32 on the posts?
The call path would then be C:\Program Files (x86\Mozilla Firefox\
I wasn't up to date on the new procedure for setting the default browser in Windows 10:
Worth testing, but it's preferable to use a GPO.
Alexander
Would it be possible to install Firefox 32 on the posts?
The call path would then be C:\Program Files (x86\Mozilla Firefox\
I wasn't up to date on the new procedure for setting the default browser in Windows 10:
- Mozilla Firefox: https://superuser.com/questions/1008391 ... -new-users
- Chrome: https://support.google.com/chrome/a/ans ... 9292?hl=en
Worth testing, but it's preferable to use a GPO.
Alexander
Until yesterday, I was installing a 32-bit Firefox package everywhere, but the latest "lesfourmisduweb" packages uninstalled this 32-bit version and installed the 64-bit one. A folder called "C:\Program Files (x86)\Mozilla Firefox" remains on the computers, but it's almost empty.
And there's no longer a default browser on the computers, so users can no longer open website shortcuts on their desktops...
And there's no longer a default browser on the computers, so users can no longer open website shortcuts on their desktops...
Last edited by gaelds on March 22, 2018 - 2:52 PM, edited 1 time.
