Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install microsoft-windows-terminal #203

Open
ErikLevin opened this issue Aug 17, 2023 · 5 comments
Open

Cannot install microsoft-windows-terminal #203

ErikLevin opened this issue Aug 17, 2023 · 5 comments

Comments

@ErikLevin
Copy link

When installing the microsoft-windows-terminal package it fails with the error message Cannot convert the "System.Object[]" value of type "System.Object[]" to type "System.Version"..

Steps to Reproduce (for bugs)

  1. As admin, run choco install microsoft-windows-terminal -y
  2. It fails with the above error.

Your Environment

@mkevenaar
Copy link
Owner

I have tried to reproduce this issue, and I cannot reproduce this with the environment mentioned above.

If you have some more insights on installed software and appx packages, please add this to this issue.

@pauby
Copy link

pauby commented Sep 6, 2023

I am going to caveat this with 'I haven't reproduced this'.

I know when creating packages that use AppX that if you install an x64 AppX package, it will actually install both x86 and x64.

So if two items are returned as an array, by this line, then Version will not be present. Maybe changing the line to [version]$AppxVer = (Get-AppxPackage -Name $AppxPackageName -AllUsers -PackageTypeFilter Bundle)[0].Version might do the trick.

Again, haven't tested this, maybe it's not applicable here as you are using a -PackageBundleTypeFilter parameter which might always return one item. But I thought I'd mention it.

@ErikLevin
Copy link
Author

@mkevenaar Sorry for taking me a while to get back to this. I can't reproduce it now either. I had problems on one of my machines but not the other. Now it install and uninstall both pass on the problematic machine with no errors.

@opoplawski
Copy link

It get the same error with the following condition:

PS C:\WINDOWS\system32> Get-AppxPackage -Name "Microsoft.WindowsTerminal" -AllUsers


Name                   : Microsoft.WindowsTerminal
Publisher              : CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
Architecture           : X64
ResourceId             :
Version                : 1.17.11461.0
PackageFullName        : Microsoft.WindowsTerminal_1.17.11461.0_x64__8wekyb3d8bbwe
InstallLocation        : C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.17.11461.0_x64__8wekyb3d8bbwe
IsFramework            : False
PackageFamilyName      : Microsoft.WindowsTerminal_8wekyb3d8bbwe
PublisherId            : 8wekyb3d8bbwe
PackageUserInformation : {S-1-5-21-89655523-1570529619-2103694531-2603 [NWRA\orion]: Installed}
IsResourcePackage      : False
IsBundle               : False
IsDevelopmentMode      : False
NonRemovable           : False
IsPartiallyStaged      : False
SignatureKind          : Store
Status                 : Ok

Name                   : Microsoft.WindowsTerminal
Publisher              : CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
Architecture           : X64
ResourceId             :
Version                : 1.18.2681.0
PackageFullName        : Microsoft.WindowsTerminal_1.18.2681.0_x64__8wekyb3d8bbwe
InstallLocation        : C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.18.2681.0_x64__8wekyb3d8bbwe
IsFramework            : False
PackageFamilyName      : Microsoft.WindowsTerminal_8wekyb3d8bbwe
PublisherId            : 8wekyb3d8bbwe
PackageUserInformation : {S-1-5-18 [S-1-5-18]: Staged}
IsResourcePackage      : False
IsBundle               : False
IsDevelopmentMode      : False
NonRemovable           : False
IsPartiallyStaged      : False
SignatureKind          : Store
Status                 : Ok



PS C:\WINDOWS\system32> choco list microsoft-windows-terminal
Chocolatey v2.2.2
microsoft-windows-terminal 1.18.2681
1 packages installed.
PS C:\WINDOWS\system32> choco install microsoft-windows-terminal -y --force --version 1.17.11461.0
Chocolatey v2.2.2
Installing the following packages:
microsoft-windows-terminal
By installing, you accept licenses for the packages.
Progress: Downloading microsoft-windows-terminal 1.17.11461.0... 100%

microsoft-windows-terminal v1.17.11461 (forced) [Approved]
microsoft-windows-terminal package files install completed. Performing other installation steps.
ERROR: Cannot convert the "System.Object[]" value of type "System.Object[]" to type "System.Version".
The install of microsoft-windows-terminal was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\microsoft-windows-terminal\tools\chocolateyInstall.ps1'.
 See log for details.

Chocolatey installed 0/1 packages. 1 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Failures
 - microsoft-windows-terminal (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\microsoft-windows-terminal\tools\chocolateyInstall.ps1'.
 See log for details.

So it does seem to be related to having multiple versions installed as @pauby suggested.

@rklec
Copy link

rklec commented Jun 3, 2024

Duplicate of #228

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants