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

[Package Issue]: Oracle.JavaRuntimeEnvironment - PackageVersion: 8.0.3410.10 - upgrades to different architecture #67506

Open
2 tasks done
rvtdadmin opened this issue Jul 25, 2022 · 8 comments
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation.

Comments

@rvtdadmin
Copy link

Please confirm these before moving forward

  • I have searched for my issue and not found a work-in-progress/duplicate/resolved issue.
  • I have not been informed if the issue is resolved in a preview version of the winget client.

Category of the issue

Other

Brief description of your issue

Upgrade issue.

A previous version of Oracle.JavaRuntimeEnvironment (x86) is installed, like PackageVersion: 8.0.3330.2

Winget upgrade Oracle.JavaRuntimeEnvironment is run and it replaces the x86 version with the new version but it installs the x64 version.

Steps to reproduce

With a previous x86 version of Oracle.JavaRuntimeEnvironment installed.

Run

Winget upgrade Oracle.JavaRuntimeEnvironment

Actual behavior

Upgrades the installed x86 version to the current x64 version.

Expected behavior

Upgrade the installed x86 version to the current x86 version

Environment

Windows Package Manager (Preview) v1.3.1611-preview
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.19044.1826
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.18.1611.0

Logs: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir

Screenshots and Logs

No response

@rvtdadmin rvtdadmin added the Issue-Bug It either shouldn't be doing this or needs an investigation. label Jul 25, 2022
@ghost ghost added the Needs-Triage This work item needs to be triaged by a member of the core team. label Jul 25, 2022
@OfficialEsco
Copy link
Contributor

@denelon IIRC WinGet does respect the installed architecture when upgrading right? Just so its not similar to microsoft/winget-cli#2334
so, maybe the issue here is caused by the uninstallPrevious switch which then triggers a normal install process?

I triple checked that the installer urls are correct

Installers:
- Architecture: x64
InstallerUrl: https://javadl.oracle.com/webapps/download/AutoDL?BundleId=246808_424b9da4b48848379167015dcc250d8d
InstallerSha256: 78F9CEBD517A838138BEDC8651E84F6A576B43F9E84F18BB0B2E3B84C7208E02
AppsAndFeaturesEntries:
- DisplayName: Java 8 Update 341 (64-bit)
Publisher: Oracle Corporation
ProductCode: '{26A24AE4-039D-4CA4-87B4-2F64180341F0}'
InstallerType: msi
- Architecture: x86
InstallerUrl: https://javadl.oracle.com/webapps/download/AutoDL?BundleId=246806_424b9da4b48848379167015dcc250d8d
InstallerSha256: 971768B4CF54EEDD2869CD5D3B32253C55AA561EC1806F9FF266FE502CA99C63
AppsAndFeaturesEntries:
- DisplayName: Java 8 Update 341
Publisher: Oracle Corporation
ProductCode: '{26A24AE4-039D-4CA4-87B4-2F32180341F0}'
InstallerType: msi

@denelon
Copy link
Contributor

denelon commented Jul 26, 2022

@OfficialEsco you are correct. I also expect the fact that we're uninstalling the previous version is why we're not maintaining the architecture. I think this is going to need a bug so we can keep track of the installed architecture so when we perform the subsequent install in the upgrade flow, we can preserve the original architecture.

@denelon denelon removed the Needs-Triage This work item needs to be triaged by a member of the core team. label Jul 26, 2022
@rvtdadmin
Copy link
Author

If I change
UpgradeBehavior: install

And also add the supported installer switch to remove old versions
InstallerSwitches: Silent: /s REBOOT=0 SilentWithProgress: /s REBOOT=0 InstallLocation: INSTALLDIR=<INSTALLPATH> Custom: SPONSORS=0 AUTO_UPDATE=0 REMOVEOUTOFDATEJRES=1

In this scenario, the new version is installed before the old version is removed.
The x64 version is still installed even though the previous install was x86.
Same thing happens if I don't put the install switch and use UpgradeBehavior: install it installs the new version and leaves the old version installed, it still installs the x64 even if the previous x86 is left installed.

Thanks for reviewing this.

@OfficialEsco
Copy link
Contributor

OfficialEsco commented Jul 27, 2022

Are you doing winget install -m or upgrade -m?
Try this with the REMOVEOUTOFDATEJRES=1 switch

InstallerSwitches:
Silent: /s REBOOT=0
SilentWithProgress: /s REBOOT=0
InstallLocation: INSTALLDIR=<INSTALLPATH>
Custom: SPONSORS=0 AUTO_UPDATE=0
Upgrade: REMOVEOUTOFDATEJRES=1

Also you should check the logs if the switch is used

@rvtdadmin
Copy link
Author

@OfficialEsco
Yes I am using winget upgrade -m

`C:>winget install Oracle.JavaRuntimeEnvironment -a x86 -v 8.0.3330.2
Found Java 8 [Oracle.JavaRuntimeEnvironment] Version 8.0.3330.2
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://javadl.oracle.com/webapps/download/AutoDL?BundleId=246472_2dee051a5d0647d5be72a7c0abff270e
██████████████████████████████ 72.3 MB / 72.3 MB
Successfully verified installer hash
Starting package install...
Successfully installed

C:>winget upgrade -m "C:\temp\Java"
Found Java 8 [Oracle.JavaRuntimeEnvironment] Version 8.0.3410.10
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://javadl.oracle.com/webapps/download/AutoDL?BundleId=246808_424b9da4b48848379167015dcc250d8d
██████████████████████████████ 83.4 MB / 83.4 MB
Successfully verified installer hash
Starting package install...
Successfully installed`

I tried with the switches you recommended and have the same result, x64 is installed. Additionally, I tried not using REMOVEOUTOFDATEJRES=1 at all and just changed UpgreadeBehavior to "install". This installs x64 and also leaves the previous x86 version.
Here is the log where it appears to be determining the association to x64.
WinGet-2022-07-27-09-12-33.027.log
Screenshot of the result of the winget commands run above.
winget
Here is the installer.yaml used, got the same result if I tried with the switches you recommended which uninstalled the x86 after the x64 was installed.
`# Created with YamlCreate.ps1 v2.1.2 $debug=QUSU.7-2-5

yaml-language-server: $schema=https://aka.ms/winget-manifest.installer.1.1.0.schema.json

PackageIdentifier: Oracle.JavaRuntimeEnvironment
PackageVersion: 8.0.3410.10
Platform:

  • Windows.Desktop
    MinimumOSVersion: 10.0.0.0
    InstallerType: exe
    Scope: machine
    InstallModes:
  • interactive
  • silent
    InstallerSwitches:
    Silent: /s REBOOT=0
    SilentWithProgress: /s REBOOT=0
    InstallLocation: INSTALLDIR=
    Custom: SPONSORS=0 AUTO_UPDATE=0
    UpgradeBehavior: install
    Commands:
  • java
    FileExtensions:
  • class
  • idx
  • jad
  • jar
  • java
  • jsp
    Installers:
  • Architecture: x64
    InstallerUrl: https://javadl.oracle.com/webapps/download/AutoDL?BundleId=246808_424b9da4b48848379167015dcc250d8d
    InstallerSha256: 78F9CEBD517A838138BEDC8651E84F6A576B43F9E84F18BB0B2E3B84C7208E02
    AppsAndFeaturesEntries:
    • DisplayName: Java 8 Update 341 (64-bit)
      Publisher: Oracle Corporation
      ProductCode: '{26A24AE4-039D-4CA4-87B4-2F64180341F0}'
      InstallerType: msi
  • Architecture: x86
    InstallerUrl: https://javadl.oracle.com/webapps/download/AutoDL?BundleId=246806_424b9da4b48848379167015dcc250d8d
    InstallerSha256: 971768B4CF54EEDD2869CD5D3B32253C55AA561EC1806F9FF266FE502CA99C63
    AppsAndFeaturesEntries:
    • DisplayName: Java 8 Update 341
      Publisher: Oracle Corporation
      ProductCode: '{26A24AE4-039D-4CA4-87B4-2F32180341F0}'
      InstallerType: msi
      ManifestType: installer
      ManifestVersion: 1.1.0`

Let me know anything else I can provide. I have not been successful getting the upgrade to install x86 any way I have tried it.
Thank you for looking at this.

@rvtdadmin
Copy link
Author

Is this bug being tracked anywhere? This is still an issue where "winget upgrade Oracle.JavaRuntimeEnvironment" upgrades to a different architecture than is installed.
x86 installed gets updated to x64

@denelon
Copy link
Contributor

denelon commented Sep 6, 2022

This issue is the bug report 😊

We're tracking it here. It's a more generic issue related to upgrades not necessarily honoring the architecture they are installed with. We're still looking into the best way to deal with this class of issues.

@rvtdadmin
Copy link
Author

Thanks for replying. Didn't know if there was a bug report somewhere handling the overall architecture issue that I missed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation.
Projects
None yet
Development

No branches or pull requests

3 participants