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

(microsoft-windows-terminal) Package installs the pre-release version instead of the stable version #55

Closed
ptanmay143 opened this issue Jun 20, 2020 · 13 comments · Fixed by #56
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@ptanmay143
Copy link
Contributor

Expected Behavior

The chocolatey package microsoft-windows-terminal should install the latest stable version of the terminal from the releases page. You can see the version v1.1.1671.0 is tagged as pre-release.

Current Behavior

Currently, it disregards the GitHub releases tag and install the one on the top, no matter if it is the pre-release version or the stable release version.

Possible Solution

Relying on the tag of the GitHub release for getting the package would be a better option. The link (https://github.com/microsoft/terminal/releases/latest) should always point to the latest stable version (currently v1.0.1401.0) even if the upstream updates the package version.
Secondly, a different chocolatey package microsoft-windows-terminal-beta could be made that would track only the pre-release versions of this terminal.

Steps to Reproduce (for bugs)

I'm not sure how to specify the steps to reproduce. I believe the explanation above is enough but if you think this step is absolutely necessary, please guide me on how would I properly write the steps to reproduce.

Context

As I plan to use the terminal very frequently, I would appreciate if it was running a stable version rather than a pre release version. I hope I am making sense here.

Your Environment

Notes

I would be happy to send a PR if you could guide me how the install scripts are built.

@ptanmay143
Copy link
Contributor Author

Moreover, I had the v1.0.1401.0 already installed and then I ran a chocolatey upgrade. This caused the start menu to have two entries for Microsoft Terminal.
image
I suspected this was due to the pre-release version (also called as Preview in Windows) having a different Appx package name. So I ran Get-AppxPackage and I actually did saw two entries for Windows Terminal.

Name              : Microsoft.WindowsTerminal
Publisher         : CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
Architecture      : X64
ResourceId        :
Version           : 1.0.1401.0
PackageFullName   : Microsoft.WindowsTerminal_1.0.1401.0_x64__8wekyb3d8bbwe
InstallLocation   : C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.0.1401.0_x64__8wekyb3d8bbwe
IsFramework       : False
PackageFamilyName : Microsoft.WindowsTerminal_8wekyb3d8bbwe
PublisherId       : 8wekyb3d8bbwe
IsResourcePackage : False
IsBundle          : False
IsDevelopmentMode : False
NonRemovable      : False
IsPartiallyStaged : False
SignatureKind     : Store
Status            : Ok

Name              : Microsoft.WindowsTerminalPreview
Publisher         : CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
Architecture      : X64
ResourceId        :
Version           : 1.1.1671.0
PackageFullName   : Microsoft.WindowsTerminalPreview_1.1.1671.0_x64__8wekyb3d8bbwe
InstallLocation   : C:\Program Files\WindowsApps\Microsoft.WindowsTerminalPreview_1.1.1671.0_x64__8wekyb3d8bbwe
IsFramework       : False
PackageFamilyName : Microsoft.WindowsTerminalPreview_8wekyb3d8bbwe
PublisherId       : 8wekyb3d8bbwe
IsResourcePackage : False
IsBundle          : False
IsDevelopmentMode : False
NonRemovable      : False
IsPartiallyStaged : False
SignatureKind     : Store
Status            : Ok

This difference in Appx Package name would also render the chocoUninstall.ps1 script (https://github.com/mkevenaar/chocolatey-packages/blob/master/automatic/microsoft-windows-terminal/tools/chocolateyUninstall.ps1) useless since it would not actually remove the preview version from Windows.

@ptanmay143
Copy link
Contributor Author

The link (https://api.github.com/repos/microsoft/terminal/releases) provides a JSON output of all the releases (stable and pre-release both). The boolean key prerelease determines whether a release is a prelease or stable. To get the direct download link to the .msixbundle file of a specific release, one needs to traverse into the assets key array and look for the browser_download_url key.
Just for reference, I'm copying here only the above keys for the two releases in question (1.0.1401.0 and 1.1.1671.0).

[
    {
        [...]
        "tag_name": "v1.1.1671.0",
        [...]
        "prerelease": true,
        [...]
        "assets": [
            {
                [...]
                "browser_download_url": "https://github.com/microsoft/terminal/releases/download/v1.1.1671.0/Microsoft.WindowsTerminal_1.1.1671.0_8wekyb3d8bbwe.msixbundle"
            }
        ],
        [...]
    },
    {
        [...]
        "tag_name": "v1.0.1401.0",
        [...]
        "prerelease": false,
        [...]
        "assets": [
            {
                [...]
                "browser_download_url": "https://github.com/microsoft/terminal/releases/download/v1.0.1401.0/Microsoft.WindowsTerminalPreview_1.0.1402.0_8wekyb3d8bbwe.msixbundle"
            }
        ],
        [...]
    },
[...]
]

@mkevenaar mkevenaar added bug Something isn't working good first issue Good for newcomers labels Jun 26, 2020
@mkevenaar mkevenaar self-assigned this Jun 26, 2020
@mkevenaar
Copy link
Owner

Thank you for creating this issue. I will have a look at it soon.

@mkevenaar
Copy link
Owner

@ptanmay143 I ended up changing the work into a Stream to have a pre-release and a stable stream automatically updating in Chocolatey. They released a pre-release and a stable release at the same time.

You can see my changes in this commit: 8b14c50

@ptanmay143
Copy link
Contributor Author

I tried installing Windows terminal on another system using choco install -y microsoft-windows-terminal but this still installed the preview version. How do I specifically install the stable version?

@mkevenaar
Copy link
Owner

mkevenaar commented Jul 2, 2020

@ptanmay143 They have split the software into two separate parts. Could you run the following in an elevated powershell?

choco uninstall microsoft-windows-terminal -n -y
Get-AppxPackage -Name Microsoft.WindowsTerminalPreview | Remove-AppxPackage
Get-AppxPackage -Name Microsoft.WindowsTerminal| Remove-AppxPackage
choco install microsoft-windows-terminal -y

This will uninstall the package, the two separate packages for Microsoft Windows Terminal and then it should install the latest version of Terminal without a pre-release.

Could you confirm that this is working for you so I can close this case again?

@mkevenaar mkevenaar reopened this Jul 2, 2020
@ptanmay143
Copy link
Contributor Author

The output of choco uninstall microsoft-windows-terminal -n -y:

Chocolatey v0.10.15
Uninstalling the following packages:
microsoft-windows-terminal

microsoft-windows-terminal v1.1.1671.0
 Skipping auto uninstaller - No registry snapshot.
 microsoft-windows-terminal has been successfully uninstalled.

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

The outputs of Get-AppxPackage -Name Microsoft.WindowsTerminalPreview | Remove-AppxPackage and Get-AppxPackage -Name Microsoft.WindowsTerminal | Remove-AppxPackage are both blank.
The output of choco install microsoft-windows-terminal -n -y:

Chocolatey v0.10.15
Installing the following packages:
microsoft-windows-terminal
By installing you accept licenses for the packages.

Progress: Downloading microsoft-windows-terminal 1.1.1671.0... 0%
[...]
Progress: Downloading microsoft-windows-terminal 1.1.1671.0... 99%
Progress: Downloading microsoft-windows-terminal 1.1.1671.0... 100%

microsoft-windows-terminal v1.1.1671.0 [Approved]
microsoft-windows-terminal package files install completed. Performing other installation steps.
 The install of microsoft-windows-terminal was successful.
  Software install location not explicitly set, could be in package or
  default install location if installer.

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

So, this still installs the v1.1.1671.0 which is a pre-release version and another issue is that now there is no start menu entry for Windows Terminal or Preview either. Doing a Get-AppxPackage -Name Microsoft.WindowsTerminal and Get-AppxPackage -Name Microsoft.WindowsTerminalPreview now returns nothing.

@mkevenaar
Copy link
Owner

@ptanmay143 I have pulled that version just now. Can you run the commands again?

This should result in the installation of v1.0.1811.0 which should be the latest available release as of now.

If you want the latest pre-release you'll need to specifically add --pre to the command as shown here:

https://chocolatey.org/packages/microsoft-windows-terminal/1.1.1812.0-beta

@ptanmay143
Copy link
Contributor Author

ptanmay143 commented Jul 2, 2020

choco install microsoft-windows-terminal still installs v1.1.1671. Is there some way I need to update the databases so that chocolatey knows that this version does not exist?
Additional info:

PS C:\Users\ptanmay143> choco outdated
Chocolatey v0.10.15
Outdated Packages
 Output is package name | current version | available version | pinned?
PS C:\Users\ptanmay143> choco list -lo
Chocolatey v0.10.15
[...]
microsoft-windows-terminal 1.1.1671.0
[...]
45 packages installed.
PS C:\Users\ptanmay143> choco upgrade all
Chocolatey v0.10.15
Upgrading the following packages:
all
By upgrading you accept licenses for the packages.
[...]
microsoft-windows-terminal v1.1.1671.0 is newer than the most recent.
 You must be smarter than the average bear...
[...]
Chocolatey upgraded 0/45 packages. 
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
PS C:\Users\ptanmay143> choco search microsoft-windows-terminal
Chocolatey v0.10.15
microsoft-windows-terminal 1.1.1671.0 [Approved]
1 packages found.

@MortenBoysen
Copy link

I also followed these steps:

choco uninstall microsoft-windows-terminal -n -y
Get-AppxPackage -Name Microsoft.WindowsTerminalPreview | Remove-AppxPackage
Get-AppxPackage -Name Microsoft.WindowsTerminal| Remove-AppxPackage
choco install microsoft-windows-terminal -n -y

And it removed both packages. The last step installed the correct version, but I am also lacking a start menu entry. Hence I cannot start the terminal since I do not know where the binary is.

@ptanmay143
Copy link
Contributor Author

I also followed these steps:

choco uninstall microsoft-windows-terminal -n -y
Get-AppxPackage -Name Microsoft.WindowsTerminalPreview | Remove-AppxPackage
Get-AppxPackage -Name Microsoft.WindowsTerminal| Remove-AppxPackage
choco install microsoft-windows-terminal -n -y

And it removed both packages. The last step installed the correct version, but I am also lacking a start menu entry. Hence I cannot start the terminal since I do not know where the binary is.

In the last command, you specified the -n option which skips running the chocoInstall.ps1 script. You could do a choco install microsoft-windows-terminal --force. I'll have to check tomorrow if it installs the correct version in my school laptop.

@MortenBoysen
Copy link

And it removed both packages. The last step installed the correct version, but I am also lacking a start menu entry. Hence I cannot start the terminal since I do not know where the binary is.

In the last command, you specified the -n option which skips running the chocoInstall.ps1 script. You could do a choco install microsoft-windows-terminal --force. I'll have to check tomorrow if it installs the correct version in my school laptop.

Cheers! That fixed the issue and everything seems to work as expected now. No preview installed and the correct version of the Windows Terminal is installed (1.0.1811.0)

@ptanmay143
Copy link
Contributor Author

I can confirm that this does install the correct version on my school computer as well as my personal computer. I'm closing this issue now. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants