添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Conditionally enable electron-updater based on target (disable for MSI) #4384

Closed
@saifelse

Description

  • Version : 20.18.0
  • electron-updater version : : 2.21.10
  • Target : NSIS, MSI, DMG
  • I'm building an app where I'm targetting both NSIS and MSI (and DMG for macOS). NSIS for individual per-user download, and MSI for per-machine when installed by a customer's IT. The NSIS can auto-update, and the MSI would not. I'm also considering a per-machine NSIS that would auto-update.

    If I install an older version of the app via an MSI installer and then blindly call autoUpdater.checkForUpdatesAndNotify() , the prompt to install the new version still happens, and when I quit the app, it looks like it installs the newer version with the NSIS installer, resulting in there being two installations, the newer one being per-user which is not ideal.

    It seems like I need to conditionally handle what my target is? It seems like I'd like to either expose the target in some way to the runtime, or, possibly more generally be able to define extraMetadata per-target... but as @develar mentioned in #1955 , it looks like this would require multiple CLI invocations?

    Practically speaking, what are the downsides of splitting out a separate CLI invocation for MSI where I use --em ? Right now, I'm using electron-webpack, publish to S3 and perform code signing (and soon to add notarizing).

    Alternatively, @develar mentioned this as a possibility:

    If you use webpack (electron-webpack) and want ability to build app per target — feel free to request.

    Is there a possibility that this would be useful in my scenario?

    Thanks!