Class: RpmUpdater
Extends
LinuxUpdater
Constructors
Constructor
new RpmUpdater(
options?,app?):RpmUpdater
Parameters
options?
AllPublishOptions | null
app?
AppAdapter
Returns
RpmUpdater
Overrides
LinuxUpdater.constructor
Properties
_isUpdateSupported
protected_isUpdateSupported:VerifyUpdateSupport
Inherited from
LinuxUpdater._isUpdateSupported
_isUserWithinRollout
protected_isUserWithinRollout:VerifyUpdateSupport
Inherited from
LinuxUpdater._isUserWithinRollout
_logger
protected_logger:Logger=console
Inherited from
LinuxUpdater._logger
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
AppImageUpdater.allowDowngrade
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
LinuxUpdater.allowPrerelease
app
protectedreadonlyapp:AppAdapter
Inherited from
LinuxUpdater.app
autoDownload
autoDownload:
boolean=true
Whether to automatically download an update when it is found.
Default
true
Inherited from
autoInstallOnAppQuit
autoInstallOnAppQuit:
boolean=true
Whether to automatically install a downloaded update on app quit (if quitAndInstall was not called before).
Default
true
Inherited from
LinuxUpdater.autoInstallOnAppQuit
autoRunAppAfterInstall
autoRunAppAfterInstall:
boolean=true
Whether to run the app after finish install when run the installer is NOT in silent mode.
Default
true
Inherited from
LinuxUpdater.autoRunAppAfterInstall
currentVersion
readonlycurrentVersion:SemVer
The current application version.
Inherited from
LinuxUpdater.currentVersion
disableDifferentialDownload
disableDifferentialDownload:
boolean=false
NSIS only Disable differential downloads and always perform full download of installer.
Default
false
Inherited from
AppImageUpdater.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
AppImageUpdater.disableWebInstaller
downloadedUpdateHelper
protecteddownloadedUpdateHelper:DownloadedUpdateHelper|null=null
Inherited from
LinuxUpdater.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
AppImageUpdater.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
LinuxUpdater.fullChangelog
previousBlockmapBaseUrlOverride
previousBlockmapBaseUrlOverride:
string|null=null
The base URL of the old block map file.
When null, the updater will use the base URL of the update file to download the update. When set, the updater will use this string as the base URL of the old block map file. Some servers like github cannot download the old block map file from latest release, so you need to compute the old block map file base URL manually.
Default
null
Inherited from
AppImageUpdater.previousBlockmapBaseUrlOverride
quitAndInstallCalled
protectedquitAndInstallCalled:boolean=false
Inherited from
LinuxUpdater.quitAndInstallCalled
requestHeaders
requestHeaders:
OutgoingHttpHeaders|null=null
The request headers.
Inherited from
AppImageUpdater.requestHeaders
signals
readonlysignals:UpdaterSignal
For type safety you can use signals, e.g. autoUpdater.signals.updateDownloaded(() => {}) instead of autoUpdater.on('update-available', () => {})
Inherited from
stagingUserIdPromise
protectedreadonlystagingUserIdPromise:Lazy<string>
Inherited from
AppImageUpdater.stagingUserIdPromise
updateInfoAndProvider
protectedupdateInfoAndProvider:UpdateInfoAndProvider|null=null
Inherited from
AppImageUpdater.updateInfoAndProvider
Accessors
channel
Get Signature
get channel():
string|null
Get the update channel. Doesn't return channel from the update configuration, only if was previously set.
Returns
string | null
Set Signature
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
string | null
Returns
void
Inherited from
LinuxUpdater.channel
installerPath
Get Signature
get
protectedinstallerPath():string|null
Sanitizies the installer path for using with command line tools.
Returns
string | null
Inherited from
LinuxUpdater.installerPath
isUpdateSupported
Get Signature
get isUpdateSupported():
VerifyUpdateSupport
Allows developer to override default logic for determining if an update is supported.
The default logic compares the UpdateInfo minimum system version against the os.release() with semver package
Returns
Set Signature
set isUpdateSupported(
value):void
Parameters
value
Returns
void
Inherited from
LinuxUpdater.isUpdateSupported
isUserWithinRollout
Get Signature
get isUserWithinRollout():
VerifyUpdateSupport
Allows developer to override default logic for determining if the user is below the rollout threshold. The default logic compares the staging percentage with numerical representation of user ID. An override can define custom logic, or bypass it if needed.
Returns
Set Signature
set isUserWithinRollout(
value):void
Parameters
value
Returns
void
Inherited from
LinuxUpdater.isUserWithinRollout
logger
Get Signature
get logger():
Logger|null
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.
Returns
Logger | null
Set Signature
set logger(
value):void
Parameters
value
Logger | null
Returns
void
Inherited from
LinuxUpdater.logger
netSession
Get Signature
get netSession():
Session
Returns
Session
Inherited from
LinuxUpdater.netSession
Methods
addAuthHeader()
addAuthHeader(
token):void
Shortcut for explicitly adding auth tokens to request headers
Parameters
token
string
Returns
void
Inherited from
LinuxUpdater.addAuthHeader
addListener()
addListener<
U>(event,listener):this
Type Parameters
U
U extends keyof AppUpdaterEvents
Parameters
event
U
listener
AppUpdaterEvents[U]
Returns
this
Inherited from
LinuxUpdater.addListener
addQuitHandler()
protectedaddQuitHandler():void
Returns
void
Inherited from
LinuxUpdater.addQuitHandler
checkForUpdates()
checkForUpdates():
Promise<UpdateCheckResult|null>
Asks the server whether there is an update.
Returns
Promise<UpdateCheckResult | null>
null if the updater is disabled, otherwise info about the latest version
Inherited from
LinuxUpdater.checkForUpdates
checkForUpdatesAndNotify()
checkForUpdatesAndNotify(
downloadNotification?):Promise<UpdateCheckResult|null>
Parameters
downloadNotification?
DownloadNotification
Returns
Promise<UpdateCheckResult | null>
Inherited from
LinuxUpdater.checkForUpdatesAndNotify
detectPackageManager()
protecteddetectPackageManager(pms):string
Detects the package manager to use based on the available commands. Allows overriding the default behavior by setting the ELECTRON_BUILDER_LINUX_PACKAGE_MANAGER environment variable. If the environment variable is set, it will be used directly. (This is useful for testing each package manager logic path.) Otherwise, it checks for the presence of the specified package manager commands in the order provided.
Parameters
pms
string[]
An array of package manager commands to check for, in priority order.
Returns
string
The detected package manager command or "unknown" if none are found.
Inherited from
LinuxUpdater.detectPackageManager
determineSudoCommand()
protecteddetermineSudoCommand():string
Returns
string
Inherited from
LinuxUpdater.determineSudoCommand
differentialDownloadInstaller()
protecteddifferentialDownloadInstaller(fileInfo,downloadUpdateOptions,installerPath,provider,oldInstallerFileName):Promise<boolean>
Parameters
fileInfo
downloadUpdateOptions
DownloadUpdateOptions
installerPath
string
provider
Provider<any>
oldInstallerFileName
string
Returns
Promise<boolean>
Inherited from
LinuxUpdater.differentialDownloadInstaller
dispatchError()
protecteddispatchError(e):void
Parameters
e
Error
Returns
void
Inherited from
LinuxUpdater.dispatchError
dispatchUpdateDownloaded()
protecteddispatchUpdateDownloaded(event):void
Parameters
event
Returns
void
Inherited from
LinuxUpdater.dispatchUpdateDownloaded
doInstall()
protecteddoInstall(options):boolean
Parameters
options
InstallOptions
Returns
boolean
Overrides
LinuxUpdater.doInstall
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
LinuxUpdater.downloadUpdate
emit()
emit<
U>(event, ...args):boolean
Type Parameters
U
U extends keyof AppUpdaterEvents
Parameters
event
U
args
...Parameters<AppUpdaterEvents[U]>
Returns
boolean
Inherited from
LinuxUpdater.emit
eventNames()
eventNames<
U>():U[]
Type Parameters
U
U extends keyof AppUpdaterEvents
Returns
U[]
Inherited from
LinuxUpdater.eventNames
executeDownload()
protectedexecuteDownload(taskOptions):Promise<string[]>
Parameters
taskOptions
DownloadExecutorTask
Returns
Promise<string[]>
Inherited from
LinuxUpdater.executeDownload
getFeedURL()
getFeedURL():
string|null|undefined
Returns
string | null | undefined
Inherited from
LinuxUpdater.getFeedURL
getMaxListeners()
getMaxListeners():
number
Returns
number
Inherited from
LinuxUpdater.getMaxListeners
getUpdateInfoAndProvider()
protectedgetUpdateInfoAndProvider():Promise<UpdateInfoAndProvider>
Returns
Promise<UpdateInfoAndProvider>
Inherited from
LinuxUpdater.getUpdateInfoAndProvider
hasCommand()
protectedhasCommand(cmd):boolean
Parameters
cmd
string
Returns
boolean
Inherited from
LinuxUpdater.hasCommand
install()
install(
isSilent?,isForceRunAfter?):boolean
Parameters
isSilent?
boolean = false
isForceRunAfter?
boolean = false
Returns
boolean
Inherited from
LinuxUpdater.install
isRunningAsRoot()
protectedisRunningAsRoot():boolean
Returns true if the current process is running as root.
Returns
boolean
Inherited from
LinuxUpdater.isRunningAsRoot
isUpdaterActive()
isUpdaterActive():
boolean
Returns
boolean
Inherited from
LinuxUpdater.isUpdaterActive
listenerCount()
listenerCount(
type):number
Parameters
type
keyof AppUpdaterEvents
Returns
number
Inherited from
LinuxUpdater.listenerCount
listeners()
listeners<
U>(type):AppUpdaterEvents[U][]
Type Parameters
U
U extends keyof AppUpdaterEvents
Parameters
type
U
Returns
AppUpdaterEvents[U][]
Inherited from
LinuxUpdater.listeners
off()
off<
U>(event,listener):this
Type Parameters
U
U extends keyof AppUpdaterEvents
Parameters
event
U
listener
AppUpdaterEvents[U]
Returns
this
Inherited from
LinuxUpdater.off
on()
on<
U>(event,listener):this
Type Parameters
U
U extends keyof AppUpdaterEvents
Parameters
event
U
listener
AppUpdaterEvents[U]
Returns
this
Inherited from
LinuxUpdater.on
once()
once<
U>(event,listener):this
Type Parameters
U
U extends keyof AppUpdaterEvents
Parameters
event
U
listener
AppUpdaterEvents[U]
Returns
this
Inherited from
LinuxUpdater.once
onUpdateAvailable()
protectedonUpdateAvailable(updateInfo):void
Parameters
updateInfo
Returns
void
Inherited from
LinuxUpdater.onUpdateAvailable
prependListener()
prependListener<
U>(event,listener):this
Type Parameters
U
U extends keyof AppUpdaterEvents
Parameters
event
U
listener
AppUpdaterEvents[U]
Returns
this
Inherited from
LinuxUpdater.prependListener
prependOnceListener()
prependOnceListener<
U>(event,listener):this
Type Parameters
U
U extends keyof AppUpdaterEvents
Parameters
event
U
listener
AppUpdaterEvents[U]
Returns
this
Inherited from
LinuxUpdater.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
LinuxUpdater.quitAndInstall
rawListeners()
rawListeners<
U>(type):AppUpdaterEvents[U][]
Type Parameters
U
U extends keyof AppUpdaterEvents
Parameters
type
U
Returns
AppUpdaterEvents[U][]
Inherited from
LinuxUpdater.rawListeners
removeAllListeners()
removeAllListeners(
event?):this
Parameters
event?
keyof AppUpdaterEvents
Returns
this
Inherited from
LinuxUpdater.removeAllListeners
removeListener()
removeListener<
U>(event,listener):this
Type Parameters
U
U extends keyof AppUpdaterEvents
Parameters
event
U
listener
AppUpdaterEvents[U]
Returns
this
Inherited from
LinuxUpdater.removeListener
runCommandWithSudoIfNeeded()
protectedrunCommandWithSudoIfNeeded(commandWithArgs):string
Parameters
commandWithArgs
string[]
Returns
string
Inherited from
LinuxUpdater.runCommandWithSudoIfNeeded
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
LinuxUpdater.setFeedURL
setMaxListeners()
setMaxListeners(
n):this
Parameters
n
number
Returns
this
Inherited from
LinuxUpdater.setMaxListeners
spawnLog()
protectedspawnLog(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
LinuxUpdater.spawnLog
spawnSyncLog()
protectedspawnSyncLog(cmd,args?,env?):string
Parameters
cmd
string
args?
string[] = []
env?
Returns
string
Inherited from
LinuxUpdater.spawnSyncLog
sudoWithArgs()
protectedsudoWithArgs(installComment):string[]
Parameters
installComment
string
Returns
string[]
Inherited from
LinuxUpdater.sudoWithArgs
installWithCommandRunner()
staticinstallWithCommandRunner(packageManager,installerPath,commandRunner,logger):void
Parameters
packageManager
"rpm" | "zypper" | "dnf" | "yum"
installerPath
string
commandRunner
(commandWithArgs) => void
logger
Returns
void