diff --git a/.changeset/angry-cycles-kick.md b/.changeset/angry-cycles-kick.md new file mode 100644 index 00000000000..065a34e2e48 --- /dev/null +++ b/.changeset/angry-cycles-kick.md @@ -0,0 +1,5 @@ +--- +"electron-updater": minor +--- + +Handle Linux deb auto update installation on applications having spaces in `artifactName`. diff --git a/packages/electron-updater/src/DebUpdater.ts b/packages/electron-updater/src/DebUpdater.ts index 19705a72ea2..17b60e0663a 100644 --- a/packages/electron-updater/src/DebUpdater.ts +++ b/packages/electron-updater/src/DebUpdater.ts @@ -31,7 +31,10 @@ export class DebUpdater extends BaseUpdater { const sudo = this.wrapSudo() // pkexec doesn't want the command to be wrapped in " quotes const wrapper = /pkexec/i.test(sudo) ? "" : `"` - const cmd = ["dpkg", "-i", options.installerPath, "||", "apt-get", "install", "-f", "-y"] + // application artifact names may include spaces in their name which leads + // to an error when the install command is executed + const installerPath = options.installerPath.replace(/ /g, "\\ ") + const cmd = ["dpkg", "-i", installerPath, "||", "apt-get", "install", "-f", "-y"] this.spawnSyncLog(sudo, [`${wrapper}/bin/bash`, "-c", `'${cmd.join(" ")}'${wrapper}`]) if (options.isForceRunAfter) { this.app.relaunch()