@@ -129,155 +129,9 @@ will be available on Unix systems (~/.local/share/pgadmin/),
129
129
on Mac OS X (~/Library/Preferences/pgadmin),
130
130
and on Windows (%APPDATA%/pgadmin).
131
131
132
+ For details on the auto-update system for the desktop application, see
132
133
133
- Auto-Update of pgAdmin 4 Desktop Application
134
- ********************************************
134
+ .. toctree ::
135
+ :maxdepth: 1
135
136
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.
139
-
140
- Supported Platforms
141
- ===================
142
-
143
- - **macOS: ** Fully supported with automatic updates enabled by default
144
- - **Windows: ** Not supported
145
- - **Linux: ** Not supported
146
-
147
- Update Process Overview
148
- =======================
149
-
150
- 1. **Check for Updates: **
151
-
152
- - Automatic check on application startup
153
- - Manual check available via pgAdmin 4 menu > Check for Updates
154
- - Uses Electron's ``autoUpdater `` API to query update server
155
-
156
- 2. **Download Process: **
157
-
158
- - Updates download automatically when detected
159
- - Progress shown via notifications
160
- - Background download prevents interruption of work
161
-
162
- 3. **Installation Flow: **
163
-
164
- - User prompted to Install & Restart or Restart Later when update ready
165
- - Update applied during application restart
166
-
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
-
173
- Technical Architecture
174
- ======================
175
-
176
- 1. **Main Process **
177
-
178
- Handles core update functionality:
179
-
180
- File: runtime/src/js/autoUpdaterHandler.js
181
-
182
- .. code-block :: javascript
183
-
184
- autoUpdater .on (' checking-for-update' , () => {
185
- misc .writeServerLog (' [Auto-Updater]: Checking for update...' );
186
- });
187
-
188
- autoUpdater .on (' update-available' , () => {
189
- setConfigAndRefreshMenu (' update-available' );
190
- misc .writeServerLog (' [Auto-Updater]: Update downloading...' );
191
- pgAdminMainScreen .webContents .send (' notifyAppAutoUpdate' , {update_downloading: true });
192
- });
193
-
194
- 2. **Renderer Process **
195
-
196
- Manages user interface updates:
197
-
198
- File: web/pgadmin/static/js/BrowserComponent.jsx
199
-
200
- .. code-block :: javascript
201
-
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
- });
220
- }
221
-
222
- 3. ** Update Server Communication**
223
-
224
- - Configures update feed URL based on version information
225
- - Handles server response validation
226
- - Manages error conditions
227
-
228
- User Interface Components
229
- ======================== =
230
-
231
- 1. ** Notification Types: **
232
-
233
- - Update available
234
- - Download progress
235
- - Update ready to install
236
- - Error notifications
237
-
238
- 2. ** Menu Integration: **
239
-
240
- - Check for Updates option in pgAdmin 4 menu
241
- - Restart to Update option when update available
242
-
243
- Error Handling
244
- ==============
245
-
246
- The system includes comprehensive error handling:
247
-
248
- 1. ** Network Errors: **
249
-
250
- - Connection timeouts
251
- - Download failures
252
- - Server unavailability
253
-
254
- 2. ** Installation Errors: **
255
-
256
- - Corrupted downloads
257
-
258
- 3. ** Recovery Mechanisms: **
259
-
260
- - Fallback to manual update
261
- - Error reporting to logs
262
-
263
- Security Considerations
264
- =======================
265
-
266
- The update system implements below security measures:
267
-
268
- 1. ** Secure Communication: **
269
-
270
- - Protected update metadata
271
-
272
- Platform- Specific Notes
273
- =======================
274
-
275
- 1. ** macOS: **
276
-
277
- - Uses native update mechanisms
278
- - Requires signed packages
279
-
280
- References
281
- ========= =
282
-
283
- - ` Electron autoUpdater API Documentation <https://www.electronjs.org/docs/latest/api/auto-updater>` _
137
+ auto_update_desktop_app
0 commit comments