()
| 228 | * Configures the auto-updater based on the user's preference |
| 229 | */ |
| 230 | export async function configureAutoUpdater() { |
| 231 | if (isDev()) { |
| 232 | console.log("skipping auto-updater in dev mode"); |
| 233 | return; |
| 234 | } |
| 235 | |
| 236 | // simple lock to prevent multiple auto-update configuration attempts, this should be very rare |
| 237 | if (autoUpdateLock) { |
| 238 | console.log("auto-update configuration already in progress, skipping"); |
| 239 | return; |
| 240 | } |
| 241 | autoUpdateLock = true; |
| 242 | |
| 243 | try { |
| 244 | console.log("Configuring updater"); |
| 245 | const settings = (await RpcApi.GetFullConfigCommand(ElectronWshClient)).settings; |
| 246 | updater = new Updater(settings); |
| 247 | await updater.start(); |
| 248 | } catch (e) { |
| 249 | console.warn("error configuring updater", e.toString()); |
| 250 | } |
| 251 | |
| 252 | autoUpdateLock = false; |
| 253 | } |
no test coverage detected