Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Add a potential approach

Manav Rathi2208d686daa7
diff --git a/desktop/src/main/services/app-update.ts b/desktop/src/main/services/app-update.ts
index 5788b9b27a..9b6c180dc7 100644
--- a/desktop/src/main/services/app-update.ts
+++ b/desktop/src/main/services/app-update.ts
@@ -12,12 +12,36 @@ export const setupAutoUpdater = (mainWindow: BrowserWindow) => {
autoUpdater.logger = electronLog;
autoUpdater.autoDownload = false;
- // Skip checking for updates automatically in dev builds. Installing an
- // update would fail anyway since (at least on macOS), the auto update
- // process requires signed builds.
- //
- // Even though this is skipped on app start, we can still use the "Check for
- // updates..." menu option to trigger the update if we wish in dev builds.
+ /**
+ * [Note: Testing auto updates]
+ *
+ * By default, we skip checking for updates automatically in dev builds.
+ * This is because even if we were to find an update, installing it would
+ * fail because (at least on macOS), the auto update process requires signed
+ * builds.
+ *
+ * Even though this is skipped on app start, we can still use the "Check for
+ * updates..." menu option to trigger the update if we wish in dev builds.
+ *
+ * This can be used to do a test of the update process (up until the actual
+ * installation itself).
+ *
+ * 1. Create a `app/dev-app-update.yml` with:
+ *
+ * provider: generic
+ * url: http://127.0.0.1:7777/
+ *
+ * 2. Start a local webserver in some directory:
+ *
+ * python3 -m http.server 7777
+ *
+ * 3. In this directory, put `latest-mac.yml` and the DMG file that this
+ * YAML file refers to.
+ *
+ * 4. Start the app, and use the "Check for updates..." menu option to
+ * trigger the update flow.
+ */
+ autoUpdater.forceDevUpdateConfig = isDev;
if (isDev) return;
const oneDay = 1 * 24 * 60 * 60 * 1000;