Skip to content

Commit 12473d0

Browse files
committed
fix(electron-updater): isSilent is optional
1 parent 9aefa90 commit 12473d0

File tree

6 files changed

+13
-12
lines changed

6 files changed

+13
-12
lines changed

docs/Options.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ Configuration Options
196196
| directories| <code>[MetadataDirectories](#MetadataDirectories)</code> \| <code>null</code> | <a name="Config-directories"></a> |
197197
| electronVersion| <code>string</code> \| <code>null</code> | <a name="Config-electronVersion"></a>The version of electron you are packaging for. Defaults to version of `electron`, `electron-prebuilt` or `electron-prebuilt-compile` dependency. |
198198
| muonVersion| <code>string</code> \| <code>null</code> | <a name="Config-muonVersion"></a>The version of muon you are packaging for. |
199-
| artifactName| <code>string</code> \| <code>null</code> | <a name="Config-artifactName"></a>The [artifact file name pattern](https://github.com/electron-userland/electron-builder/wiki/Options#artifact-file-name-pattern). Defaults to `${productName}-${version}.${ext}` (some target can have another defaults, see corresponding options).<br><br>Currently supported only for `mas`, `pkg`, `dmg` and `nsis`. |
199+
| artifactName| <code>string</code> \| <code>null</code> | <a name="Config-artifactName"></a>The [artifact file name pattern](https://github.com/electron-userland/electron-builder/wiki/Options#artifact-file-name-pattern). Defaults to `${productName}-${version}.${ext}` (some target can have another defaults, see corresponding options). |
200200
| buildVersion| <code>string</code> \| <code>null</code> | <a name="Config-buildVersion"></a>The build version. Maps to the `CFBundleVersion` on macOS, and `FileVersion` metadata property on Windows. Defaults to the `version`. If `TRAVIS_BUILD_NUMBER` or `APPVEYOR_BUILD_NUMBER` or `CIRCLE_BUILD_NUM` or `BUILD_NUMBER` or `bamboo.buildNumber` env defined, it will be used as a build version (`version.build_number`). |
201201
| electronCompile| <code>boolean</code> | <a name="Config-electronCompile"></a>Whether to use [electron-compile](http://github.com/electron/electron-compile) to compile app. Defaults to `true` if `electron-compile` in the dependencies. And `false` if in the `devDependencies` or doesn't specified. |
202202
| detectUpdateChannel = <code>true</code>| <code>boolean</code> | <a name="Config-detectUpdateChannel"></a>Whether to infer update channel from application version prerelease components. e.g. if version `0.12.1-alpha.1`, channel will be set to `alpha`. Otherwise to `latest`. |

docs/api/electron-builder.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ Developer API only. See [[Options]] for user documentation.
553553
| Param | Type |
554554
| --- | --- |
555555
| pattern | <code>string</code> |
556-
| arch | <code>[Arch](electron-builder-core#Arch)</code> \| <code>undefined</code> \| <code>null</code> |
556+
| arch | <code>string</code> \| <code>undefined</code> \| <code>null</code> |
557557
| extra | <code>any</code> |
558558

559559
<a name="module_electron-builder/out/platformPackager.PlatformPackager+generateName"></a>
@@ -885,7 +885,7 @@ Developer API only. See [[Options]] for user documentation.
885885
| Param | Type |
886886
| --- | --- |
887887
| pattern | <code>string</code> |
888-
| arch | <code>[Arch](electron-builder-core#Arch)</code> \| <code>undefined</code> \| <code>null</code> |
888+
| arch | <code>string</code> \| <code>undefined</code> \| <code>null</code> |
889889
| extra | <code>any</code> |
890890

891891
<a name="module_electron-builder/out/platformPackager.PlatformPackager+generateName"></a>
@@ -1240,7 +1240,7 @@ Developer API only. See [[Options]] for user documentation.
12401240
| Param | Type |
12411241
| --- | --- |
12421242
| pattern | <code>string</code> |
1243-
| arch | <code>[Arch](electron-builder-core#Arch)</code> \| <code>undefined</code> \| <code>null</code> |
1243+
| arch | <code>string</code> \| <code>undefined</code> \| <code>null</code> |
12441244
| extra | <code>any</code> |
12451245

12461246
<a name="module_electron-builder/out/platformPackager.PlatformPackager+generateName"></a>
@@ -2349,7 +2349,7 @@ Developer API only. See [[Options]] for user documentation.
23492349
| Param | Type |
23502350
| --- | --- |
23512351
| pattern | <code>string</code> |
2352-
| arch | <code>[Arch](electron-builder-core#Arch)</code> \| <code>undefined</code> \| <code>null</code> |
2352+
| arch | <code>string</code> \| <code>undefined</code> \| <code>null</code> |
23532353
| extra | <code>any</code> |
23542354

23552355
<a name="module_electron-builder/out/platformPackager.PlatformPackager+generateName"></a>

packages/electron-updater/src/AppUpdater.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,9 @@ export abstract class AppUpdater extends EventEmitter {
271271
* **Note:** `autoUpdater.quitAndInstall()` will close all application windows first and only emit `before-quit` event on `app` after that.
272272
* This is different from the normal quit event sequence.
273273
*
274-
* @param isSilent *windows-only* Runs the installer in silent mode.
274+
* @param [isSilent] *windows-only* Runs the installer in silent mode.
275275
*/
276-
abstract quitAndInstall(isSilent: boolean): void
276+
abstract quitAndInstall(isSilent?: boolean): void
277277

278278
async loadUpdateConfig() {
279279
if (this._appUpdateConfigPath == null) {

packages/electron-updater/src/MacUpdater.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { PublishConfiguration, VersionInfo } from "electron-builder-http/out/pub
66
import { createServer, IncomingMessage, ServerResponse } from "http"
77
import { parse as parseUrl } from "url"
88
import { AppUpdater } from "./AppUpdater"
9-
import { DOWNLOAD_PROGRESS, FileInfo } from "./main"
9+
import { DOWNLOAD_PROGRESS, FileInfo, UPDATE_DOWNLOADED } from "./main"
1010
import AutoUpdater = Electron.AutoUpdater
1111

1212
export class MacUpdater extends AppUpdater {
@@ -25,7 +25,7 @@ export class MacUpdater extends AppUpdater {
2525
if (this.logger != null) {
2626
this.logger.info(`New version ${this.versionInfo!.version} has been downloaded`)
2727
}
28-
this.emit("update-downloaded", this.versionInfo)
28+
this.emit(UPDATE_DOWNLOADED, this.versionInfo)
2929
})
3030
}
3131

packages/electron-updater/src/NsisUpdater.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { tmpdir } from "os"
88
import * as path from "path"
99
import "source-map-support/register"
1010
import { AppUpdater } from "./AppUpdater"
11-
import { DOWNLOAD_PROGRESS, FileInfo } from "./main"
11+
import { DOWNLOAD_PROGRESS, FileInfo, UPDATE_DOWNLOADED } from "./main"
1212

1313
export class NsisUpdater extends AppUpdater {
1414
private setupPath: string | null
@@ -72,7 +72,7 @@ export class NsisUpdater extends AppUpdater {
7272

7373
this.setupPath = tempFile
7474
this.addQuitHandler()
75-
this.emit("update-downloaded", this.versionInfo)
75+
this.emit(UPDATE_DOWNLOADED, this.versionInfo)
7676
return tempFile
7777
}
7878

packages/electron-updater/src/main.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ export interface UpdateCheckResult {
108108
}
109109

110110
export const DOWNLOAD_PROGRESS = "download-progress"
111+
export const UPDATE_DOWNLOADED = "update-downloaded"
111112

112113
export type LoginHandler = (authInfo: any, callback: LoginCallback) => void
113114

@@ -128,7 +129,7 @@ export class UpdaterSignal {
128129
}
129130

130131
updateDownloaded(handler: (info: VersionInfo) => void) {
131-
addHandler(this.emitter, "update-downloaded", handler)
132+
addHandler(this.emitter, UPDATE_DOWNLOADED, handler)
132133
}
133134

134135
updateCancelled(handler: (info: VersionInfo) => void) {

0 commit comments

Comments
 (0)