Electron updater keeps new updates at user level

30 Views Asked by At

I install my electron app (msi build for Windows) with the following script:

msiexec /i "https://URL_TO_MY_APP_Messenger.msi" MSIINSTALLPERUSER=""

and it was installed under C:\Program Files\Messenger, which is expected since I want the app at system level

But As I can see I have another folder at C:\Users\Ismoil\AppData\Local\messenger-updater looks like that's where electron updater keeps updates with some files in that folder

  • installer.exe
  • pending/Messenger-some-version-number.exe
  • pending/update-info.json

and once the app is updated, I end up seeing 2 apps on my Desktop screen bcs the new updated install is located at user level under C:\Users\Ismoil\AppData\Local\Programs\Messenger

how can I resolve it?

Ideally, I want to control the update folder depending on the MSIINSTALLPERUSER="" (system level) MSIINSTALLPERUSER="1" (user level)

If it is not possible, I want to keep my app only under system level, but looks like electron-updater keeps updates only at user level

enter image description here

1

There are 1 best solutions below

0
Ismoil Shokirov On

Looks like auto-updater doesn't support MSI builds, I think that's the reason why we usually see 2 versions of Messenger in Windows. In our case, auto-updater was working through NSIS .exe installations so far. Partners install the msi build using the script and since auto-updater doesn't support msi, it was just downloading and installing .exe version of the app (at USER level) that creates a duplicate if msi was initially installed at SYSTEM level

Unfortunately, as of 2024 electron-updater stil has no support for auto-updates for MSI, it only supports NSIS (.exe) Since it is not possible to combine MSI and exe for auto updates to be at SYSTEM level, we're going to terminate the support for MSI and keep only NSIS (that supports SYSTEM level only auto-updates)

"nsis": {
  "deleteAppDataOnUninstall": true,
  "perMachine": true // SYSTEM level
},

related Github issue: https://github.com/electron-userland/electron-builder/issues/3322