installMacUpdate(onUpdateApplied) {
    const { downloadedFile } = this.postUpdateDownloadInfo;
    const cacheFolder = path.dirname(downloadedFile);

    // Path to the `.app` folder
    const appPath = path.resolve(this.app.getAppPath(), '../../..');
    const appPathParent = path.dirname(appPath);

    this.sendStatusToWindow(UpdaterStatus.InstallingUpdate, {
      downloadedFile,
      cacheFolder,
      appPath,
      appPathParent,
    });

    if (fs.existsSync(`${cacheFolder}/Google Assistant.app`)) {
      cp.execSync(`rm -rf "${cacheFolder}/Google Assistant.app"`);
    }

    // Extract the downloaded archive
    const appExtractionCmd = `ditto -x -k "${downloadedFile}" "${cacheFolder}"`;

    cp.exec(appExtractionCmd, (err, stdout, stderr) => {
      if (err) {
        displayDialogMain({
          type: 'error',
          message: 'Error occurred while extracting archive',
          detail: err.message,
        });

        return;
      }

      // Delete existing `.app` in application directory
      // to avoid problems with moving the updated version
      // to the destination.
      const removeExistingApp = `rm -rf "${appPath}"`;

      // Copy the extracted `.app` to the application directory
      const moveUpdateToApplications = [
        'mv',
        `"${cacheFolder}/Google Assistant.app"`,
        `"${appPathParent}"`,
      ].join(' ');

      // Apply update (remove and move update)
      cp.execSync(`${removeExistingApp} && ${moveUpdateToApplications}`);

      this.sendStatusToWindow(UpdaterStatus.UpdateApplied, null);
      onUpdateApplied();
    });
  }
Installs update on MacOS

@param {() => void} onUpdateApplied
Callback function called after update is installed