bitwarden / clients

Bitwarden client apps (web, browser extension, desktop, and cli).
https://bitwarden.com
Other
9.24k stars 1.24k forks source link

Setting ELECTRON_NO_UPDATER=1 is not working on Mac OS #2565

Open sso-bitwarden opened 2 years ago

sso-bitwarden commented 2 years ago

Steps To Reproduce

  1. Set env variable ELECTRON_NO_UPDATER=1
  2. Confirm it
  3. Start Desktop app

Expected Result

No auto-update

Actual Result

Still being asked to update.

Screenshots or Videos

No response

Additional Context

No response

Operating System

macOS

Operating System Version

High Sierra

Installation method

Direct Download (from bitwarden.com)

Build Version

1.31.3

Hinton commented 2 years ago

@sso-bitwarden how are you setting the environment variable?

The variable needs to be visible for GUI applications which I believe is easiest done using launchctl.

launchctl setenv ELECTRON_NO_UPDATER 1

sso-bitwarden commented 2 years ago

@Hinton

The command doesn't work either. It's still asking to update.

Hinton commented 2 years ago

Weird it seemed to work on my machine. Another thing we could test is https://apple.stackexchange.com/a/413773, which involves setting the environment variable on launch.

Deepblue99 commented 1 year ago

@Hinton, thank you for your help.

I have mac systems running OS 10.12.6 (Sierra) using Bitwarden build 1.31.3. Setting the environment variable to be visible for GUI apps as you suggest works to prevent auto-updating out of functionality. launchctl setenv ELECTRON_NO_UPDATER 1

The problem then becomes, how to get the launchd variable set during boot or login. Apple no longer consults /etc/launchd.conf during boot, which takes away the straight forward approach. A solution I chose of the many offered by the problem solving community on stackoverflow was to use the AppleScript editor to create an app that can be run as a user Login Item.

The one single command required to get the job done is: do shell script "launchctl setenv ELECTRON_NO_UPDATER 1"

Make sure you save the file as an Application not a script (I called it Bitwarden_No_Update.app). I put the app in the Applications folder along side the Bitwarden app and enabled it as a login item in System Preferences/Users & Groups/Login Items. Done, you're good to go.

If you want to confirm that the ELECTRON_NO_UPDATER variable is being defined and set to "1", open terminal and use the command: launchctl getenv ELECTRON_NO_UPDATER