Skip to content

Commit 719f4e1

Browse files
committed
Docs updated
1 parent b15599d commit 719f4e1

2 files changed

Lines changed: 43 additions & 27 deletions

File tree

docs/en_US/desktop_deployment.rst

Lines changed: 43 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,12 @@ on Mac OS X (~/Library/Preferences/pgadmin),
130130
and on Windows (%APPDATA%/pgadmin).
131131

132132

133-
Auto-Update Feature for pgAdmin 4 Desktop
134-
*****************************************
133+
Auto-Update of pgAdmin 4 Desktop Application
134+
********************************************
135135

136-
pgAdmin 4's desktop application includes an automated update system built using Electron's ``autoUpdater`` module. This feature enables users to receive and install updates seamlessly, ensuring they always have access to the latest features and security fixes.
136+
pgAdmin 4's desktop application includes an automated update system built using
137+
Electron's ``autoUpdater`` module. This feature enables users to receive and install
138+
updates seamlessly, ensuring they always have access to the latest features and security fixes.
137139

138140
Supported Platforms
139141
===================
@@ -159,43 +161,62 @@ Update Process Overview
159161

160162
3. **Installation Flow:**
161163

162-
- User prompted to restart when update ready
164+
- User prompted to Install & Restart or Restart Later when update ready
163165
- Update applied during application restart
164166

167+
The flow chart for the update process is as follows:
168+
169+
.. image:: images/auto_update_desktop_app.png
170+
:alt: Runtime View Log
171+
:align: center
172+
165173
Technical Architecture
166174
======================
167175

168-
1. **Main Process (runtime/src/js/pgadmin.js)**
176+
1. **Main Process**
169177

170178
Handles core update functionality:
171179

180+
File: runtime/src/js/pgadmin.js
181+
172182
.. code-block:: javascript
173183
174184
autoUpdater.on('checking-for-update', () => {
175-
misc.writeServerLog('checking for updates...');
185+
misc.writeServerLog('[Auto-Updater]: Checking for update...');
176186
});
177187
178188
autoUpdater.on('update-available', () => {
179-
setConfigAndRefreshMenu('update-available');
180-
misc.writeServerLog('Update downloading...');
181-
pgAdminMainScreen.webContents.send('appUpdateNotifier', {update_downloading: true});
189+
setConfigAndRefreshMenu('update-available');
190+
misc.writeServerLog('[Auto-Updater]: Update downloading...');
191+
pgAdminMainScreen.webContents.send('notifyAppAutoUpdate', {update_downloading: true});
182192
});
183193
184-
2. **Renderer Process (web/pgadmin/static/js/BrowserComponent.jsx)**
194+
2. **Renderer Process**
185195

186196
Manages user interface updates:
187197

198+
File: web/pgadmin/static/js/BrowserComponent.jsx
199+
188200
.. code-block:: javascript
189201
190-
if (window.electronUI?.appUpdateNotifier) {
191-
window.electronUI.appUpdateNotifier((data) => {
192-
if (data.update_downloading) {
193-
appUpdateNotifier('Update downloading...', 'info', 10000);
194-
} else if (data.update_downloaded) {
195-
appUpdateNotifier(UPDATE_DOWNLOADED_MESSAGE, 'warning', null,
196-
'Update downloaded', installUpdate, 'update_downloaded');
197-
}
198-
});
202+
if (window.electronUI && typeof window.electronUI.notifyAppAutoUpdate === 'function') {
203+
window.electronUI.notifyAppAutoUpdate((data)=>{
204+
if (data?.check_version_update) {
205+
pgAdmin.Browser.check_version_update(true);
206+
} else if (data.update_downloading) {
207+
appAutoUpdateNotifier('Update downloading...', 'info', null, 10000);
208+
} else if (data.no_update_available) {
209+
appAutoUpdateNotifier('No update available.....', 'info', null, 10000);
210+
} else if (data.update_downloaded) {
211+
const UPDATE_DOWNLOADED_MESSAGE = gettext('An update is ready. Restart the app now to install it, or later to keep using the current version.');
212+
appAutoUpdateNotifier(UPDATE_DOWNLOADED_MESSAGE, 'warning', installUpdate, null, 'Update downloaded', 'update_downloaded');
213+
} else if (data.error) {
214+
appAutoUpdateNotifier(`${data.errMsg}`, 'error');
215+
} else if (data.update_installed) {
216+
const UPDATE_INSTALLED_MESSAGE = gettext('Update installed successfully!');
217+
appAutoUpdateNotifier(UPDATE_INSTALLED_MESSAGE, 'success');
218+
}
219+
});
199220
}
200221
201222
3. **Update Server Communication**
@@ -217,8 +238,7 @@ User Interface Components
217238
2. **Menu Integration:**
218239
219240
- Check for Updates option in pgAdmin 4 menu
220-
- Update status indicators
221-
- Restart to Update option when available
241+
- Restart to Update option when update available
222242
223243
Error Handling
224244
==============
@@ -233,8 +253,6 @@ The system includes comprehensive error handling:
233253
234254
2. **Installation Errors:**
235255
236-
- Insufficient disk space
237-
- Permission issues
238256
- Corrupted downloads
239257
240258
3. **Recovery Mechanisms:**
@@ -245,12 +263,10 @@ The system includes comprehensive error handling:
245263
Security Considerations
246264
=======================
247265
248-
The update system implements several security measures:
266+
The update system implements below security measures:
249267
250268
1. **Secure Communication:**
251-
252-
- HTTPS for update checks
253-
- Encrypted download process
269+
254270
- Protected update metadata
255271
256272
Platform-Specific Notes
192 KB
Loading

0 commit comments

Comments
 (0)