Skip to content

Commit

Permalink
fix(electron-updater): isSilent is optional
Browse files Browse the repository at this point in the history
  • Loading branch information
develar committed Jun 7, 2017
1 parent 9aefa90 commit 12473d0
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docs/Options.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ Configuration Options
| directories| <code>[MetadataDirectories](#MetadataDirectories)</code> \| <code>null</code> | <a name="Config-directories"></a> |
| 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. |
| muonVersion| <code>string</code> \| <code>null</code> | <a name="Config-muonVersion"></a>The version of muon you are packaging for. |
| 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`. |
| 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). |
| 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`). |
| 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. |
| 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`. |
Expand Down
8 changes: 4 additions & 4 deletions docs/api/electron-builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ Developer API only. See [[Options]] for user documentation.
| Param | Type |
| --- | --- |
| pattern | <code>string</code> |
| arch | <code>[Arch](electron-builder-core#Arch)</code> \| <code>undefined</code> \| <code>null</code> |
| arch | <code>string</code> \| <code>undefined</code> \| <code>null</code> |
| extra | <code>any</code> |

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

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

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

<a name="module_electron-builder/out/platformPackager.PlatformPackager+generateName"></a>
Expand Down
4 changes: 2 additions & 2 deletions packages/electron-updater/src/AppUpdater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,9 @@ export abstract class AppUpdater extends EventEmitter {
* **Note:** `autoUpdater.quitAndInstall()` will close all application windows first and only emit `before-quit` event on `app` after that.
* This is different from the normal quit event sequence.
*
* @param isSilent *windows-only* Runs the installer in silent mode.
* @param [isSilent] *windows-only* Runs the installer in silent mode.
*/
abstract quitAndInstall(isSilent: boolean): void
abstract quitAndInstall(isSilent?: boolean): void

async loadUpdateConfig() {
if (this._appUpdateConfigPath == null) {
Expand Down
4 changes: 2 additions & 2 deletions packages/electron-updater/src/MacUpdater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { PublishConfiguration, VersionInfo } from "electron-builder-http/out/pub
import { createServer, IncomingMessage, ServerResponse } from "http"
import { parse as parseUrl } from "url"
import { AppUpdater } from "./AppUpdater"
import { DOWNLOAD_PROGRESS, FileInfo } from "./main"
import { DOWNLOAD_PROGRESS, FileInfo, UPDATE_DOWNLOADED } from "./main"
import AutoUpdater = Electron.AutoUpdater

export class MacUpdater extends AppUpdater {
Expand All @@ -25,7 +25,7 @@ export class MacUpdater extends AppUpdater {
if (this.logger != null) {
this.logger.info(`New version ${this.versionInfo!.version} has been downloaded`)
}
this.emit("update-downloaded", this.versionInfo)
this.emit(UPDATE_DOWNLOADED, this.versionInfo)
})
}

Expand Down
4 changes: 2 additions & 2 deletions packages/electron-updater/src/NsisUpdater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { tmpdir } from "os"
import * as path from "path"
import "source-map-support/register"
import { AppUpdater } from "./AppUpdater"
import { DOWNLOAD_PROGRESS, FileInfo } from "./main"
import { DOWNLOAD_PROGRESS, FileInfo, UPDATE_DOWNLOADED } from "./main"

export class NsisUpdater extends AppUpdater {
private setupPath: string | null
Expand Down Expand Up @@ -72,7 +72,7 @@ export class NsisUpdater extends AppUpdater {

this.setupPath = tempFile
this.addQuitHandler()
this.emit("update-downloaded", this.versionInfo)
this.emit(UPDATE_DOWNLOADED, this.versionInfo)
return tempFile
}

Expand Down
3 changes: 2 additions & 1 deletion packages/electron-updater/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ export interface UpdateCheckResult {
}

export const DOWNLOAD_PROGRESS = "download-progress"
export const UPDATE_DOWNLOADED = "update-downloaded"

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

Expand All @@ -128,7 +129,7 @@ export class UpdaterSignal {
}

updateDownloaded(handler: (info: VersionInfo) => void) {
addHandler(this.emitter, "update-downloaded", handler)
addHandler(this.emitter, UPDATE_DOWNLOADED, handler)
}

updateCancelled(handler: (info: VersionInfo) => void) {
Expand Down

0 comments on commit 12473d0

Please sign in to comment.