cloudflared icon indicating copy to clipboard operation
cloudflared copied to clipboard

[UX] Windows .msi installer should update existing installation of cloudflared

Open WhaleHub opened this issue 4 years ago • 13 comments

If you run the cloudflared .msi installer on a system which already has an older version of cloudflared installed on it, the installer will exit with the following error message:

cloudflared

The typical behavior of Windows software installers is to update the existing installation of the software instead of manually requiring the user to first uninstall the previous version. It would improve the UX of updating cloudflared if the installer were to simply update an existing installation of the software as well.

WhaleHub avatar Oct 12 '21 11:10 WhaleHub

This makes sense. I think a bit of tinkering around with https://github.com/cloudflare/cloudflared/blob/master/cloudflared.wxs is warranted. I'll get around to it after a bit but feel free if you want to take a stab at it. I can guide you if you want.

sudarshan-reddy avatar Oct 12 '21 11:10 sudarshan-reddy

I'll get around to it after a bit but feel free if you want to take a stab at it. I can guide you if you want.

@sudarshan-reddy Sure thing, what do you need me to do?

ghost avatar Oct 12 '21 12:10 ghost

We probably need https://wixtoolset.org/documentation/manual/v3/howtos/updates/major_upgrade.html

sudarshan-reddy avatar Oct 12 '21 12:10 sudarshan-reddy

@sudarshan-reddy Are there any instructions for compiling the cloudflared installer on Windows for testing purposes?

ghost avatar Oct 13 '21 17:10 ghost

You’ll need to do it on linux with https://github.com/sudarshan-reddy/msitools. This is because our build systems are all in linux.

You can simply run wixl -v cloudflared.wxs to generate the msi

sudarshan-reddy avatar Oct 13 '21 22:10 sudarshan-reddy

You can simply run wixl -v cloudflared.wxs to generate the msi

@sudarshan-reddy After encountering an error message about an unspecified variable, I had a look at Makefile and cfsetup.yaml and was able to successfully compile the .msi by running make cloudflared-msi instead. Judging by the wixl command that it uses, it looks like specifying a Version and Path variable is mandatory when trying to compile the .msi installer for cloudflared. I already had Go installed on my Linux machine for compiling other projects, but that's a build requirement as well.

wixl --define Version=2021.10.1 --define Path=./cloudflared --output cloudflared-2021.10.1-amd64.msi cloudflared.wxs

ghost avatar Oct 14 '21 03:10 ghost

Thanks for calling that out @whalehub. Right on all counts here. Glad you got it up and running.

sudarshan-reddy avatar Oct 14 '21 15:10 sudarshan-reddy

The .msi installer still shows the same error as the first post.

I also tried the cloudlfared update command. It said "successfully updated" but running cloudflared --version still showed the old version. I also tried on a new cmd window, same result.

FKPSC avatar May 31 '22 14:05 FKPSC

This is a problem for us using managed deployment (i.e. InTune) where the installation of hte MSI is managed by a service. Can we please have this bug fixed with proper upgrade installer codes?

It blocks us from deploying this fleet-wide.

XVII avatar Jul 14 '22 22:07 XVII

Sounds like you might just need the following in the cloudflared.wxs -- can run some tests if you need me to.

<MajorUpgrade
  DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will now exit.">

More examples: https://stackoverflow.com/a/3575801/168457

XVII avatar Jul 14 '22 23:07 XVII

@sudarshan-reddy any update on this? It's holding up larger rollout.

XVII avatar Sep 07 '22 01:09 XVII

Hello, I'm facing this issue with winget. From 2023.1.0 to 2023.2.2. Is there any ETA for this issue? Well, Seems like it is not supported install method by Cloudflare anyways.

> winget upgrade Cloudflare.cloudflared
Found cloudflared [Cloudflare.cloudflared] Version 2023.2.1
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Successfully verified installer hash
Starting package install...
Installer failed with exit code: 1638
Installer log is available at: C:\Users\<user>\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir\WinGet-Cloudflare.cloudflared.2023.2.1-2023-02-21-15-21-50.814.log
Another version of this application is already installed.

kimwonj77 avatar Feb 21 '23 06:02 kimwonj77

@kimwonj77 , this is resolved by the PR GH-484. You will need to manually update once the new version is released with the correct versioning/templates.

XVII avatar Feb 21 '23 23:02 XVII