electron updater.Class.NsisUpdater
Electron-Builder / electron-updater / NsisUpdater
Extends¶
Constructors¶
new NsisUpdater()¶
new NsisUpdater(
options
?,app
?):NsisUpdater
Parameters¶
• options?: null
| AllPublishOptions
• app?: AppAdapter
Returns¶
Overrides¶
Properties¶
_logger¶
protected
_logger:Logger
=console
Inherited from¶
_verifyUpdateCodeSignature¶
protected
_verifyUpdateCodeSignature:verifyUpdateCodeSignature
allowDowngrade¶
allowDowngrade:
boolean
=false
Whether to allow version downgrade (when a user from the beta channel wants to go back to the stable channel).
Taken in account only if channel differs (pre-release version component in terms of semantic versioning).
Default¶
false
Inherited from¶
allowPrerelease¶
allowPrerelease:
boolean
=false
GitHub provider only. Whether to allow update to pre-release versions. Defaults to true
if application version contains prerelease components (e.g. 0.12.1-alpha.1
, here alpha
is a prerelease component), otherwise false
.
If true
, downgrade will be allowed (allowDowngrade
will be set to true
).
Inherited from¶
app¶
protected
readonly
app:AppAdapter
Inherited from¶
autoDownload¶
autoDownload:
boolean
=true
Whether to automatically download an update when it is found.
Inherited from¶
autoInstallOnAppQuit¶
autoInstallOnAppQuit:
boolean
=true
Whether to automatically install a downloaded update on app quit (if quitAndInstall
was not called before).
Inherited from¶
BaseUpdater
.autoInstallOnAppQuit
autoRunAppAfterInstall¶
autoRunAppAfterInstall:
boolean
=true
windows-only Whether to run the app after finish install when run the installer NOT in silent mode.
Default¶
true
Inherited from¶
BaseUpdater
.autoRunAppAfterInstall
currentVersion¶
readonly
currentVersion:SemVer
The current application version.
Inherited from¶
disableDifferentialDownload¶
disableDifferentialDownload:
boolean
=false
NSIS only Disable differential downloads and always perform full download of installer.
Default¶
false
Inherited from¶
BaseUpdater
.disableDifferentialDownload
disableWebInstaller¶
disableWebInstaller:
boolean
=false
Web installer files might not have signature verification, this switch prevents to load them unless it is needed.
Currently false to prevent breaking the current API, but it should be changed to default true at some point that breaking changes are allowed.
Default¶
false
Inherited from¶
BaseUpdater
.disableWebInstaller
downloadedUpdateHelper¶
protected
downloadedUpdateHelper:null
|DownloadedUpdateHelper
=null
Inherited from¶
BaseUpdater
.downloadedUpdateHelper
forceDevUpdateConfig¶
forceDevUpdateConfig:
boolean
=false
Allows developer to force the updater to work in “dev” mode, looking for “dev-app-update.yml” instead of “app-update.yml”
Dev: path.join(this.app.getAppPath(), "dev-app-update.yml")
Prod: path.join(process.resourcesPath!, "app-update.yml")
Default¶
false
Inherited from¶
BaseUpdater
.forceDevUpdateConfig
fullChangelog¶
fullChangelog:
boolean
=false
GitHub provider only. Get all release notes (from current version to latest), not just the latest.
Default¶
false
Inherited from¶
installDirectory?¶
optional
installDirectory:string
Specify custom install directory path
quitAndInstallCalled¶
protected
quitAndInstallCalled:boolean
=false
Inherited from¶
BaseUpdater
.quitAndInstallCalled
requestHeaders¶
requestHeaders:
null
|OutgoingHttpHeaders
=null
The request headers.
Inherited from¶
signals¶
readonly
signals:UpdaterSignal
For type safety you can use signals, e.g. autoUpdater.signals.updateDownloaded(() => {})
instead of autoUpdater.on('update-available', () => {})
Inherited from¶
stagingUserIdPromise¶
protected
readonly
stagingUserIdPromise:Lazy
<string
>
Inherited from¶
BaseUpdater
.stagingUserIdPromise
updateInfoAndProvider¶
protected
updateInfoAndProvider:null
|UpdateInfoAndProvider
=null
Inherited from¶
BaseUpdater
.updateInfoAndProvider
Accessors¶
channel¶
get
channel():null
|string
Get the update channel. Doesn’t return channel
from the update configuration, only if was previously set.
set
channel(value
):void
Set the update channel. Overrides channel
in the update configuration.
allowDowngrade
will be automatically set to true
. If this behavior is not suitable for you, simple set allowDowngrade
explicitly after.
Parameters¶
• value: null
| string
Returns¶
null
| string
Inherited from¶
logger¶
get
logger():null
|Logger
The logger. You can pass electron-log, winston or another logger with the following interface: { info(), warn(), error() }
.
Set it to null
if you would like to disable a logging feature.
set
logger(value
):void
Parameters¶
• value: null
| Logger
Returns¶
null
| Logger
Inherited from¶
netSession¶
get
netSession():Session
Returns¶
Session
Inherited from¶
verifyUpdateCodeSignature¶
get
verifyUpdateCodeSignature():verifyUpdateCodeSignature
The verifyUpdateCodeSignature. You can pass win-verify-signature or another custom verify function: (publisherName: string[], path: string) => Promise<string | null>
.
The default verify function uses windowsExecutableCodeSignatureVerifier
set
verifyUpdateCodeSignature(value
):void
Parameters¶
• value: verifyUpdateCodeSignature
Returns¶
Methods¶
addAuthHeader()¶
addAuthHeader(
token
):void
Shortcut for explicitly adding auth tokens to request headers
Parameters¶
• token: string
Returns¶
void
Inherited from¶
addListener()¶
addListener<
U
>(event
,listener
):this
Type Parameters¶
• U extends keyof AppUpdaterEvents
Parameters¶
• event: U
• listener: AppUpdaterEvents
[U
]
Returns¶
this
Inherited from¶
addQuitHandler()¶
protected
addQuitHandler():void
Returns¶
void
Inherited from¶
checkForUpdates()¶
checkForUpdates():
Promise
<null
|UpdateCheckResult
>
Asks the server whether there is an update.
Returns¶
Promise
<null
| UpdateCheckResult
>
Inherited from¶
checkForUpdatesAndNotify()¶
checkForUpdatesAndNotify(
downloadNotification
?):Promise
<null
|UpdateCheckResult
>
Parameters¶
• downloadNotification?: DownloadNotification
Returns¶
Promise
<null
| UpdateCheckResult
>
Inherited from¶
BaseUpdater
.checkForUpdatesAndNotify
differentialDownloadInstaller()¶
protected
differentialDownloadInstaller(fileInfo
,downloadUpdateOptions
,installerPath
,provider
,oldInstallerFileName
):Promise
<boolean
>
Parameters¶
• fileInfo: ResolvedUpdateFileInfo
• downloadUpdateOptions: DownloadUpdateOptions
• installerPath: string
• provider: Provider
<any
>
• oldInstallerFileName: string
Returns¶
Promise
<boolean
>
Inherited from¶
BaseUpdater
.differentialDownloadInstaller
dispatchError()¶
protected
dispatchError(e
):void
Parameters¶
• e: Error
Returns¶
void
Inherited from¶
dispatchUpdateDownloaded()¶
protected
dispatchUpdateDownloaded(event
):void
Parameters¶
• event: UpdateDownloadedEvent
Returns¶
void
Inherited from¶
BaseUpdater
.dispatchUpdateDownloaded
doInstall()¶
protected
doInstall(options
):boolean
Parameters¶
• options: InstallOptions
Returns¶
boolean
Overrides¶
downloadUpdate()¶
downloadUpdate(
cancellationToken
):Promise
<string
[]>
Start downloading update manually. You can use this method if autoDownload
option is set to false
.
Parameters¶
• cancellationToken: CancellationToken
= ...
Returns¶
Promise
<string
[]>
Paths to downloaded files.
Inherited from¶
emit()¶
emit<
U
>(event
, …args
):boolean
Type Parameters¶
• U extends keyof AppUpdaterEvents
Parameters¶
• event: U
• …args: Parameters
<AppUpdaterEvents
[U
]>
Returns¶
boolean
Inherited from¶
eventNames()¶
eventNames<
U
>():U
[]
Type Parameters¶
• U extends keyof AppUpdaterEvents
Returns¶
U
[]
Inherited from¶
executeDownload()¶
protected
executeDownload(taskOptions
):Promise
<string
[]>
Parameters¶
• taskOptions: DownloadExecutorTask
Returns¶
Promise
<string
[]>
Inherited from¶
getFeedURL()¶
getFeedURL():
undefined
|null
|string
Returns¶
undefined
| null
| string
Inherited from¶
getMaxListeners()¶
getMaxListeners():
number
Returns¶
number
Inherited from¶
getUpdateInfoAndProvider()¶
protected
getUpdateInfoAndProvider():Promise
<UpdateInfoAndProvider
>
Returns¶
Promise
<UpdateInfoAndProvider
>
Inherited from¶
BaseUpdater
.getUpdateInfoAndProvider
install()¶
install(
isSilent
,isForceRunAfter
):boolean
Parameters¶
• isSilent: boolean
= false
• isForceRunAfter: boolean
= false
Returns¶
boolean
Inherited from¶
isUpdaterActive()¶
isUpdaterActive():
boolean
Returns¶
boolean
Inherited from¶
listenerCount()¶
listenerCount(
type
):number
Parameters¶
• type: keyof AppUpdaterEvents
Returns¶
number
Inherited from¶
listeners()¶
listeners<
U
>(type
):AppUpdaterEvents
[U
][]
Type Parameters¶
• U extends keyof AppUpdaterEvents
Parameters¶
• type: U
Returns¶
AppUpdaterEvents
[U
][]
Inherited from¶
off()¶
off<
U
>(event
,listener
):this
Type Parameters¶
• U extends keyof AppUpdaterEvents
Parameters¶
• event: U
• listener: AppUpdaterEvents
[U
]
Returns¶
this
Inherited from¶
on()¶
on<
U
>(event
,listener
):this
Type Parameters¶
• U extends keyof AppUpdaterEvents
Parameters¶
• event: U
• listener: AppUpdaterEvents
[U
]
Returns¶
this
Inherited from¶
once()¶
once<
U
>(event
,listener
):this
Type Parameters¶
• U extends keyof AppUpdaterEvents
Parameters¶
• event: U
• listener: AppUpdaterEvents
[U
]
Returns¶
this
Inherited from¶
onUpdateAvailable()¶
protected
onUpdateAvailable(updateInfo
):void
Parameters¶
• updateInfo: UpdateInfo
Returns¶
void
Inherited from¶
prependListener()¶
prependListener<
U
>(event
,listener
):this
Type Parameters¶
• U extends keyof AppUpdaterEvents
Parameters¶
• event: U
• listener: AppUpdaterEvents
[U
]
Returns¶
this
Inherited from¶
prependOnceListener()¶
prependOnceListener<
U
>(event
,listener
):this
Type Parameters¶
• U extends keyof AppUpdaterEvents
Parameters¶
• event: U
• listener: AppUpdaterEvents
[U
]
Returns¶
this
Inherited from¶
BaseUpdater
.prependOnceListener
quitAndInstall()¶
quitAndInstall(
isSilent
,isForceRunAfter
):void
Restarts the app and installs the update after it has been downloaded.
It should only be called after update-downloaded
has been emitted.
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.
Parameters¶
• isSilent: boolean
= false
windows-only Runs the installer in silent mode. Defaults to false
.
• isForceRunAfter: boolean
= false
Run the app after finish even on silent install. Not applicable for macOS.
Ignored if isSilent
is set to false
(In this case you can still set autoRunAppAfterInstall
to false
to prevent run the app after finish).
Returns¶
void
Inherited from¶
rawListeners()¶
rawListeners<
U
>(type
):AppUpdaterEvents
[U
][]
Type Parameters¶
• U extends keyof AppUpdaterEvents
Parameters¶
• type: U
Returns¶
AppUpdaterEvents
[U
][]
Inherited from¶
removeAllListeners()¶
removeAllListeners(
event
?):this
Parameters¶
• event?: keyof AppUpdaterEvents
Returns¶
this
Inherited from¶
BaseUpdater
.removeAllListeners
removeListener()¶
removeListener<
U
>(event
,listener
):this
Type Parameters¶
• U extends keyof AppUpdaterEvents
Parameters¶
• event: U
• listener: AppUpdaterEvents
[U
]
Returns¶
this
Inherited from¶
setFeedURL()¶
setFeedURL(
options
):void
Configure update provider. If value is string
, GenericServerOptions will be set with value as url
.
Parameters¶
• options: PublishConfiguration
| AllPublishOptions
If you want to override configuration in the app-update.yml
.
Returns¶
void
Inherited from¶
setMaxListeners()¶
setMaxListeners(
n
):this
Parameters¶
• n: number
Returns¶
this
Inherited from¶
spawnLog()¶
protected
spawnLog(cmd
,args
,env
,stdio
):Promise
<boolean
>
This handles both node 8 and node 10 way of emitting error when spawning a process - node 8: Throws the error - node 10: Emit the error(Need to listen with on)
Parameters¶
• cmd: string
• args: string
[] = []
• env: any
= undefined
• stdio: StdioOptions
= "ignore"
Returns¶
Promise
<boolean
>
Inherited from¶
spawnSyncLog()¶
protected
spawnSyncLog(cmd
,args
,env
):string
Parameters¶
• cmd: string
• args: string
[] = []
• env = {}
Returns¶
string
Inherited from¶
wrapSudo()¶
protected
wrapSudo():string
Returns¶
string