mattermost / desktop

Mattermost Desktop application for Windows, Mac and Linux
Apache License 2.0
2.01k stars 823 forks source link

[Bug]: Cannot install for all users with Winget #3150

Closed ktooi closed 3 weeks ago

ktooi commented 4 weeks ago

Checks before filing an issue

Mattermost Desktop Version

5.9.0

Operating System

Windows 11 x64

Mattermost Server Version

9.5.6

Steps to reproduce

Here is what Mattermost-desktop looked like before installation. It is not installed in either the user or machine scope.

PS C:\Windows\Temp> Test-Path $ENV:LocalAppData\Programs\mattermost-desktop\Mattermost.exe
False
PS C:\Windows\Temp> Test-Path $ENV:ProgramFiles\mattermost-desktop\Mattermost.exe
False
PS C:\Windows\Temp>

Install Mattermost-desktop into the machine scope using winget.

PS C:\Windows\Temp> winget install -e --id Mattermost.MattermostDesktop --scope machine
Found Mattermost [Mattermost.MattermostDesktop] Version 5.9.0
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://releases.mattermost.com/desktop/5.9.0/mattermost-desktop-5.9.0-win-x64.msi
  ██████████████████████████████  88.9 MB / 88.9 MB
Successfully verified installer hash
Starting package install...
Successfully installed
PS C:\Windows\Temp>

Expected behavior

If “--scope machine” is specified, it is expected to be installed under Program Files.

PS C:\Windows\Temp> Test-Path $ENV:LocalAppData\Programs\mattermost-desktop\Mattermost.exe
False
PS C:\Windows\Temp> Test-Path $ENV:ProgramFiles\mattermost-desktop\Mattermost.exe
True
PS C:\Windows\Temp>

Observed behavior

But in fact, it has been installed in the wrong user scope. This is a post-installation state, confirming that Mattermost-desktop was installed in the wrong user scope.

PS C:\Windows\Temp> Test-Path $ENV:LocalAppData\Programs\mattermost-desktop\Mattermost.exe
True
PS C:\Windows\Temp> Test-Path $ENV:ProgramFiles\mattermost-desktop\Mattermost.exe
False
PS C:\Windows\Temp>

Log Output

No logs.

Additional Information

I checked https://docs.mattermost.com/install/desktop-msi-installer-and-group-policy-install.html#install-for-all-users and found that “ALLUSERS=1” I checked and understood that I needed to specify “ALLUSERS=1”. So I installed with “--custom ALLUSERS=1” and confirmed that it was installed under Program Files as expected.

PS C:\Windows\Temp> Test-Path $ENV:LocalAppData\Programs\mattermost-desktop\Mattermost.exe
False
PS C:\Windows\Temp> Test-Path $ENV:ProgramFiles\mattermost-desktop\Mattermost.exe
False
PS C:\Windows\Temp> winget install -e --id Mattermost.MattermostDesktop --scope machine --custom ALLUSERS=1
Found Mattermost [Mattermost.MattermostDesktop] Version 5.9.0
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://releases.mattermost.com/desktop/5.9.0/mattermost-desktop-5.9.0-win-x64.msi
  ██████████████████████████████  88.9 MB / 88.9 MB
Successfully verified installer hash
Starting package install...
Successfully installed
PS C:\Windows\Temp> Test-Path $ENV:LocalAppData\Programs\mattermost-desktop\Mattermost.exe
False
PS C:\Windows\Temp> Test-Path $ENV:ProgramFiles\mattermost-desktop\Mattermost.exe
True
PS C:\Windows\Temp>

This led me to believe that there was a problem with the Winget manifest. https://github.com/microsoft/winget-pkgs/blob/master/manifests/m/Mattermost/MattermostDesktop/5. 9.0/Mattermost.MattermostDesktop.installer.yaml, I think you are missing the InstallerSwitches specification.

- Architecture: x64
  Scope: user
  InstallerUrl: https://releases.mattermost.com/desktop/5.9.0/mattermost-desktop-5.9.0-win-x64.msi
  InstallerSha256: 2E8592BC18E1AA18A59365547135778FE462A76549ECC4A8FA005452F74BF162
- Architecture: x64
  Scope: machine
  InstallerUrl: https://releases.mattermost.com/desktop/5.9.0/mattermost-desktop-5.9.0-win-x64.msi
  InstallerSha256: 2E8592BC18E1AA18A59365547135778FE462A76549ECC4A8FA005452F74BF162
  InstallerSwitches:  # Added line
    Custom: "ALLUSERS=1"  # Added line
- Architecture: arm64
  Scope: user      
  InstallerUrl: https://releases.mattermost.com/desktop/5.9.0/mattermost-desktop-5.9.0-win-arm64.msi
  InstallerSha256: 2A13566E780CCAED7A944C974AE547E7B045D2A4D25602740D210AECE3F028C8
- Architecture: arm64
  Scope: machine   
  InstallerUrl: https://releases.mattermost.com/desktop/5.9.0/mattermost-desktop-5.9.0-win-arm64.msi
  InstallerSha256: 2A13566E780CCAED7A944C974AE547E7B045D2A4D25602740D210AECE3F028C8
  InstallerSwitches:  # Added line
    Custom: "ALLUSERS=1"  # Added line

I thought about submitting a PR to the winget-pkgs repository, but then I saw the following in the manifest file, so I assumed this file was auto-generated.

# Created with komac v2.5.0

I don't know if this is the right place for this bug report, but I could not find another appropriate place to report it. Please let me know if there is another correct place to report it.

Thanks.

devinbinnie commented 3 weeks ago

@ktooi Thanks for letting us know, I wasn't aware that we were available via winget, as we do not maintain that installation path (similar to how we don't maintain our own snap).

So this should likely be reported to the user that created this, or perhaps a change can be submitted to the repo where this exists. The solution you provided seems to be the way forward.

Closing this ticket as there isn't anything we can do from our end.