brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.57k stars 2.28k forks source link

brave silent setup is not silent #6240

Closed NZ-HIPS closed 3 years ago

NZ-HIPS commented 4 years ago

Description

A silent setup is hardly silent as it results in starting the brave browser at the end of the installation process. This hinders some applications, like unattended deployment, as the synchronous installation process can not proceed until a user closes the window.

Steps to Reproduce

  1. Download a silent installer from https://github.com/brave/brave-browser/releases
  2. (Silently) Install
  3. Observe browser being executed at the end of silent installation

Actual result:

bug

(brave silent setup doesn't return to command line)

Expected result:

Would install, then return to the command line.

Reproduces how often:

Easily reproduced

Brave version (brave://version info)

Brave | 0.72.60 Chromium: 77.0.3865.90 (Official Build) nightly (64-bit) Revision | 58c425ba843df2918d9d4b409331972646c393dd-refs/branch-heads/3865@{#830} OS | Windows 10 OS Version 1809 (Build 17763.1)

Version/Channel Information:

Occurs at least in both the release and nightly channels.

Other Additional Information:

bsclifton commented 4 years ago

@mbacchi we did have a version that doesn't auto-launch (which we used for the Muon upgrade). We don't still package that though, do we?

cascadeth commented 4 years ago

Saw a comment on a community post about requesting an MSI installer. +1'ing that.

runout-at commented 4 years ago

any news on that?

we want to deploy brave with ansible on windows.

HorNet505 commented 4 years ago

google for the "BraveBrowserStandaloneSilentBetaSetup.exe" But yes, a current MSI installer would be great

mbacchi commented 4 years ago

I've opened issue https://github.com/brave/brave-browser/issues/9418 to provide an MSI package for unattended installation. I'll leave this issue open for the moment, to track the initial request.

haavarstein commented 3 years ago

Any updates? Looking forward to the MSI file

kjozwiak commented 3 years ago

CCing @mihaiplesa ☝️

Apfelwurm commented 3 years ago

Hi, i would deploy all my friends machines with Brave in the future if someday a silent installation is possible! This would be really cool!

mherrmann commented 3 years ago

The problem still occurs with Nightly v1.24.17. That is, BraveBrowserStandaloneSilentNightlySetup.exe launches a browser window.

mherrmann commented 3 years ago

There also do not seem to be command-line arguments that can be passed to BraveBrowserStandaloneSilentNightlySetup.exe to prevent the browser window from opening. In particular, /silent, /silent /install and --silent all produce errors.

The reason for this seems to be the following: The silent standalone installer passes its command line arguments on to Brave's auto-update framework Omaha. Specifically: Without any arguments, the installer invokes BraveUpdate.exe /silent /install "appguid={Brave's UID}&...". With arguments, it passes those into the command line instead of /silent /install. Additionally, it passes &silent. So /foo invokes BraveUpdate.exe /foo "appguid=...&silent&...". BraveUpdate.exe is Omaha's binary that installs and uninstalls apps and Omaha. I don't see an easy way how this could be used to suppress the opening of a window. My suspicion is that it's not Omaha that opens the window but Brave's own installer.

People looking for a workaround can follow the instructions here. They happen to work at the moment, but are currently not officially supported. Also, this way of installing Brave does not set up Brave's auto-update mechanism.

bsclifton commented 3 years ago

We have manually worked around this in the past - basically when tagging the installer, we can include the silent attribute. There is a launch after install attribute - maybe @mihaiplesa still has a link to the patch we used. The only use-case we had for this originally was for Muon when migrating to Brave Core (we wanted to install browser without launching; as first launch did the import). I'll dig through notes and see what I can find

Having a proper silent install would be great until we're able to look at MSI (captured with https://github.com/brave/brave-browser/issues/9418)

bsclifton commented 3 years ago

@mherrmann found it - here's a PR (example) that we used to prevent it from launching. It would be great if the silent installer was created using this: https://github.com/brave/omaha/pull/13/files

mherrmann commented 3 years ago

@bsclifton my PRs above fix StandaloneSilentSetup.exe but not SilentSetup.exe. The technique I'm using won't work to fix SilentSetup.exe and I don't see an easy way to fix SilentSetup.exe. I'm wondering if SilentSetup.exe is required at all if StandaloneSilentSetup.exe is available. Can I pose the radical question and ask whether we can simply no longer offer SilentSetup.exe?

Some technical detail: The difference between SilentSetup.exe and StandaloneSilentSetup.exe is that the former is just a small 1 MB online installer that downloads the latest version of Brave from the update server. The reason why my technique won't work is that the update server determines whether the installer launches a browser window. Specifically, the server would have to respond "invoke the internal Brave installer with argument --do-not-launch-chrome". But the update server doesn't know whether the installation is to be performed silently. So it can either never open a browser window (also for normal, non-silent installations), or always. The reason why StandaloneSilentSetup works is that this binary is created by essentially hard-coding a server response. In this hard-coded response, it is possible to supply --do-not-launch-chrome.

I can only think of hacky not-nice workarounds to prevent SilentSetup from opening a browser window. Hence my question whether this installer is really needed :-)

mherrmann commented 3 years ago

Actually, there might be a way to prevent SilentSetup.exe from opening a browser window: It is possible to encode an installdataindex in SilentSetup.exe that is then sent by Omaha to the server. This lets the server return a master_preferences file, which is supposed to support a property "skip_first_run_ui" : true that suppresses the browser window. I'd be happy to look into this approach, but am still wondering whether it is worth the effort.

bsclifton commented 3 years ago

I think removing SilentSetup.exe would be just fine 😄 Most folks wanting a silent install (ex: MSI) want to distribute / install the package themselves so they can avoid multiple machines fetching the same data / eating up network

I think there are only three install types we need to cover:

  1. Stub installers: convenient because the binary being distributed to client never changes. Fetches "whatever the latest is" from server. I'm aware of some integrations which automate the install using this binary - they're initiated by the user and having the UI open after install is fine. Only available on Windows (wish macOS had a similar way to install)
  2. Standalone installer: will go out of date but installs a specific version without reaching out over network. This is critical for cases where we want to bisect when a bug was introduced... we can install specific versions to to see if problem is present / not present to narrow down the range of the bug / regression. This would be a user-initiated install and having the UI open after install is fine.
  3. Silent installer: what enterprises would likely want to use. Needs to also be a standalone installer since enterprise can qualify the bits and distribute internally without any machine making outbound network calls. No UI present (during install or post launch) to help with automation
mihaiplesa commented 3 years ago

Yes, les's look into a proper silent installer until we have the bandwidth to look into MSI (or till next Omaha protocol version comes out).

mherrmann commented 3 years ago

Hey @mihaiplesa, I'm afraid I don't understand your comment in the context of this discussion. @bsclifton and I were talking about getting rid of SilentSetup.exe (1 MB online installer, opens a browser window) because after my PR above the existing StandaloneSilentSetup.exe will be truly silent. Do you agree that it's okay to remove SilentSetup.exe because people can use StandaloneSilentSetup.exe instead?

mihaiplesa commented 3 years ago

Re-reading again now - it makes sense to remove the silent online installer and fix the offline one, thanks.

sachinmarathe commented 3 years ago

Excuse me, but the installation is not silent yet. tried this on Windows 10 by double clicking 1.22.72.exe, as well as using command line. A new page still pops up at the end. furthermore if it is included in the windows 10 installation iso, the resulting brave installation does not work. it does not launch, and needs to be reinstalled.

mherrmann commented 3 years ago

@sachinmarathe I think this fix is first included with 1.25.x nightly snapshots. What you wrote seems to indicate you're using 1.22. Or am I missing something?

sachinmarathe commented 3 years ago

no you are not missing anything. i guess i missed some:) i thought this was merged with the stable version as well. i did try nightly in the meantime. works flawlessly.

mherrmann commented 3 years ago

Happy to hear it's working! :)

cahalpin commented 3 years ago

Will the truly silent install be included in a stable release soon? Wanting to deploy Brave silently across my organization but do not want to use a Nightly release in production environment.

mihaiplesa commented 3 years ago

@cahalpin it will be in the next beta and dev releases and naturally uplifted to stable channel in less that 3 weeks.

cahalpin commented 3 years ago

Great, thanks!

bsclifton commented 3 years ago

Nice work @mherrmann 😄👍

mherrmann commented 3 years ago

Thanks @bsclifton! :smile:

GeetaSarvadnya commented 3 years ago

Verification passed on

Brave | 1.25.66 Chromium: 91.0.4472.70 (Official Build) (64-bit)
-- | --
Revision | fe095368270a32c92959403754bf6fd357dd9953-refs/branch-heads/4472@{#1172}
OS | Windows 10 OS Version 2004 (Build 19041.985)
Windows 10 x64_Installers Test **Clean profile** Ensured stand-alone installers (BraveBrowserStandaloneSetup.exe) are working as expected Ensured stand-alone silent installers (BraveBrowserStandaloneSilentSetup.exe) are working as expected Ensured stub installers (BraveBrowserSetup.exe) are working as expected Ensured test channel stub installers (BraveBrowserSetup-64-r-test.exe) are working as expected **Upgrade profile** - Installed `1.24.x stand-alone installer` and upgraded profile to `1.25.x stand-alone installer` and ensured stand-alone installer is working as expected - Installed `1.24.x stand-alone silent installer` and upgraded profile to `1.25.x stand-alone silent installer` and ensured stand-alone silent installer file is working as expected - Installed `1.24.x stand-alone installer/stub installer` and upgraded profile to `1.25.x stand-alone installer` and ensured stand-alone installer is working as expected - Installed `1.24.x stand-alone installer` and upgraded profile to `1.25.x test channel stub installer` (BraveBrowserSetup-64-r-test.exe) and ensured profile is upgraded to 1.25.x test channel and confirmed test installers are working as expected

Verification PASSED on Win 8.1 x86 using the following build:

Brave | 1.25.68 Chromium: 91.0.4472.77 (Official Build) (64-bit)
--- | --
Revision | 1cecd5c8a856bc2a5adda436e7b84d8d21b339b6-refs/branch-heads/4472@{#1246}
OS | Windows 8.1 (Build 9600.20018)
Win 8.1 x86 verification/results **`Clean Installs`** Went through the following executables and ensured they were working as expected: * https://github.com/brave/brave-browser/releases/download/v1.25.66/BraveBrowserSetup32.exe * downloaded `1.24.86 Chromium: 90.0.4430.212` which is expected * https://github.com/brave/brave-browser/releases/download/v1.25.66/BraveBrowserStandaloneSetup32.exe * https://github.com/brave/brave-browser/releases/download/v1.25.66/BraveBrowserStandaloneSilentSetup32.exe * https://github.com/brave/brave-browser/releases/download/v1.25.66/BraveBrowserStandaloneSilentSetup.exe * ensured that a x64 executable can't be installed on a x86 machine As per https://github.com/brave/brave-browser/issues/6240, also installed `BraveBrowserStandaloneSilentSetup32.exe` using: ``` start /wait /b BraveBrowserStandaloneSilentSetup32.exe ``` **`Upgrades`** * Upgraded `1.24.86 Chromium: 90.0.4430.212` --> `1.25.68 Chromium: 91.0.4472.77` using `BraveBrowserStandaloneSetup32.exe` without any issues * Upgraded `1.24.86 Chromium: 90.0.4430.212` --> `1.25.68 Chromium: 91.0.4472.77` using `BraveBrowserStandaloneSilentSetup32.exe` without any isuses

Verification PASSED on Win 10 x86 using the following build:

Brave   1.25.68 Chromium: 91.0.4472.77 (Official Build) (32-bit)
Revision    1cecd5c8a856bc2a5adda436e7b84d8d21b339b6-refs/branch-heads/4472@{#1246}
OS  Windows 10 OS Version 2009 (Build 19042.870)
Win 10 x86 verification/results **`Clean Installs`** Went through the following executables and ensured they were working as expected: * https://github.com/brave/brave-browser/releases/download/v1.25.68/BraveBrowserSetup32.exe * downloaded `1.24.86 Chromium: 90.0.4430.212` which is expected * https://github.com/brave/brave-browser/releases/download/v1.25.68/BraveBrowserStandaloneSetup32.exe * https://github.com/brave/brave-browser/releases/download/v1.25.68/BraveBrowserStandaloneSilentSetup32.exe * https://github.com/brave/brave-browser/releases/download/v1.25.68/BraveBrowserStandaloneSilentSetup.exe * ensured that a x64 executable can't be installed on a x86 machine As per https://github.com/brave/brave-browser/issues/6240, also installed `BraveBrowserStandaloneSilentSetup32.exe` using: ``` start /wait /b BraveBrowserStandaloneSilentSetup32.exe ``` **`Upgrades`** * Upgraded `1.24.86 Chromium: 90.0.4430.212` --> `1.25.68 Chromium: 91.0.4472.77` using `BraveBrowserStandaloneSetup32.exe` without any issues * Upgraded `1.24.86 Chromium: 90.0.4430.212` --> `1.25.68 Chromium: 91.0.4472.77` using `BraveBrowserStandaloneSilentSetup32.exe` without any isuses

Verification passed on

Brave 1.25.68 Chromium: 91.0.4472.77 (Official Build) (32-bit)
Revision 1cecd5c8a856bc2a5adda436e7b84d8d21b339b6-refs/branch-heads/4472@{#1246}
OS Windows 7 Service Pack 1 (Build 7601.24544)
Went through the following executables and ensured they were working as expected: * https://github.com/brave/brave-browser/releases/download/v1.25.68/BraveBrowserSetup32.exe * downloaded `1.24.86 Chromium: 90.0.4430.212` which is expected * https://github.com/brave/brave-browser/releases/download/v1.25.68/BraveBrowserStandaloneSetup32.exe * https://github.com/brave/brave-browser/releases/download/v1.25.68/BraveBrowserStandaloneSilentSetup32.exe Verified `BraveBrowserStandaloneSilentSetup32.exe` did not launch the browser after installation

Verification passed on

Brave 1.25.68 Chromium: 91.0.4472.77 (Official Build) (64-bit)
Revision 1cecd5c8a856bc2a5adda436e7b84d8d21b339b6-refs/branch-heads/4472@{#1246}
OS Windows 7 Service Pack 1 (Build 7601.24544)
Went through the following executables and ensured they were working as expected: * https://github.com/brave/brave-browser/releases/download/v1.25.68/BraveBrowserSetup.exe * downloaded `1.24.86 Chromium: 90.0.4430.212` which is expected * https://github.com/brave/brave-browser/releases/download/v1.25.68/BraveBrowserStandaloneSetup.exe * https://github.com/brave/brave-browser/releases/download/v1.25.68/BraveBrowserStandaloneSilentSetup.exe Verified `BraveBrowserStandaloneSilentSetup.exe` did not launch the browser after installation
AndreusUltimus commented 3 years ago

As of today and the latest stable build: https://github.com/brave/brave-browser/releases/download/v1.29.77/BraveBrowserStandaloneSilentSetup.exe

the silent installer opens Brave at the end of an otherwise silent install.

Win 10 Pro, Brave already installed.

mherrmann commented 3 years ago

@andrewww I cannot reproduce this behavior. What I did:

  1. Install Brave 1.29.77 with the standalone silent installer. As expected, Brave is installed silently and I can afterwards launch it on my system.
  2. Run the installer again. As expected, Brave does not open. It's still on my system and I can launch it as usual.
ghost commented 2 years ago

Please an msi/msix release of brave, that would be awesome.

Fchen48 commented 1 year ago

2023 and still no MSI available???