Update testing
Sometimes it might be necessary to test the update flow of the desktop application. This document will attempt to describe how to do so in details.
The desktop applications are published to our GitHub page, which we can’t really do for development purposes. To provide a fairly similar environment, we run a local S3 simulator which lets us simulate a S3 provider environment.
While this is not identical to our scenarios it will still allow us to test the UI and updating process without messing around in a GitHub repo.
Preparation
-
Start the minio docker container using
docker compose up
inscripts/dev
. -
Add a read-only bucket called
update
, by going tohttp://localhost:9001
and login usingminioadmin/minioadmin
, clickCreate bucket
fill in the details. Then clickManage
,Access Rules
and fill in the following details. -
Modify the
package.json
with the followingpublish
settings."publish" : {
"provider": "s3",
"endpoint": "http://127.0.0.1:9000",
"bucket": "update"
}, -
Create
.aws/credentials
inside the Users directory (Windows) with the following content[default]
aws_access_key_id=minioadmin
aws_secret_access_key=minioadmin
Update
- Generate a local build using
npm run publish:win:dev
- Install the build within
dist/nsis-web/Bitwarden-Installer-1.32.0.exe
- Update the version number in
src/package.json
- Publish the new version using
npm run publish:win:dev
- The app should now prompt for an update.
Related: https://www.electron.build/tutorials/test-update-on-s3-locally