winget-cli icon indicating copy to clipboard operation
winget-cli copied to clipboard

Inform users a reboot is required after installation

Open lychichem opened this issue 4 years ago • 12 comments

Create issues related to the winget.exe client here

Brief description of your issue

When using winget to install Microsoft.VC++2015-2019Redist-x64, winget reports the installer failed with exit code: 3010

Steps to reproduce

Install Microsoft.VC++2015-2019Redist-x64 with winget install Microsoft.VC++2015-2019Redist-x64

Expected behavior

winget should report the installed successfully.

Actual behavior

winget reports it exit with code 3010. But the package installed. image image

Environment

[winget --info]
Windows Package Manager version: v0.4.11391
Windows: Windows.Desktop version: 10.0.19043.1023 x64 pro zh-CN
Package: Microsoft.DesktopAppInstaller version: 1.11.11391.0

Any other software?

I don't konw which software is using vclibs when winget try to install it. But I strongly believe it means the installer need a system reboot to finish the install. So maybe winget should ask the user to reboot their system to finish the install and report 3010 as successfully.

lychichem avatar May 26 '21 04:05 lychichem

Additional information: The issue happens on a machine with a previous version of VC++2015-2019redist package and a lot of software which may use VC++2015-2019redist installed

lychichem avatar May 26 '21 23:05 lychichem

microsoft/winget-pkgs#14033 will treat 3010 as success. But we need to ask users to manually reboot their system.

lychichem avatar May 27 '21 02:05 lychichem

@lychichem I don't recall another feature on the backlog addressing a generic reboot required. Would you mind a more generic title change? "Inform users a reboot is required after installation". I think we may need a manifest schema change "InstallerSuccessCodes" doesn't seem to capture this scenario well.

I'm not sure if we want something specific just for this scenario, or something more generic or extensible. Testing and validation become much more complicated depending on the choice made. #229 "Suppress reboot on default" might be involved in the solution as well.

denelon avatar May 27 '21 02:05 denelon

@lychichem I don't recall another feature on the backlog addressing a generic reboot required. Would you mind a more generic title change? "Inform users a reboot is required after installation". I think we may need a manifest schema change "InstallerSuccessCodes" doesn't seem to capture this scenario well.

I'm not sure if we want something specific just for this scenario, or something more generic or extensible. Testing and validation become much more complicated depending on the choice made. #229 "Suppress reboot on default" might be involved in the solution as well.

Yes, you're right. This is a specific scene when the package installed is using by other program. I also agree that this will make automatic validation more complicated. Maybe we need three machine to emulate:

  • The package has never installed on this machine,
  • The package is installed but not using by other programs,
  • The package is installed and is used by other programs while winget installs/updates it.

This may also help testing packages with dependencies. In this situation, the three machine should be:

  • The dependency packages are not installed,
  • The dependency package is installed but not used by any package,
  • The dependency package is installed and being used by other programs.

However, if we really keep the last two types of virtual machine for every package, we will certainly cost a lot of storage space and make the system dirty at end.

lychichem avatar May 27 '21 02:05 lychichem

However, if we really keep the last two types of virtual machine for every package, we will certainly cost a lot of storage space and make the system dirty at end.

That sounds like a fun engineering problem to solve. Fortunately, we are able to stand up "clean" virtual machines fairly easily. The interesting parts are figuring out which dependencies or other packages cause these conflicts while trying to install/upgrade/import.

denelon avatar May 27 '21 15:05 denelon

@lychichem we've done some additional work with "Expected Return Codes". I believe 3010 should inform the user a reboot is required. Can you validate?

denelon avatar Dec 01 '21 21:12 denelon

@lychichem this issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment.

ghost avatar Dec 08 '21 22:12 ghost

@lychichem this issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment.

ghost avatar Jan 15 '22 01:01 ghost

@lychichem this issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment.

ghost avatar Jun 07 '22 22:06 ghost

It's not stale, we're just waiting :)

OskarKlintrot avatar Jun 08 '22 06:06 OskarKlintrot

The 14.29.30139.0 Microsoft.VC++2015-2019Redist-x64 manifest currently treats the return code 3010 as success.

https://github.com/microsoft/winget-pkgs/blob/fc8bbeb8603e04e6d14584e04f5c8d7d7c0c1892/manifests/m/Microsoft/VC%2B%2B2015-2019Redist-x64/14.29.30139.0/Microsoft.VC%2B%2B2015-2019Redist-x64.installer.yaml#L13-L14

@ItzLevvie it looks like you were the last to work on the manifest. Would you mind changing the success code to an expected return code? I'd like to make sure this scenario is properly handled.

Ideally, the install would return 3010 if the runtime is in use, and the user would be informed of the need for a reboot via "rebootRequiredToFinish".

https://github.com/microsoft/winget-cli/blob/f14909aba2578b0b8b57cb700ffcdeddb196f878/schemas/JSON/manifests/v1.2.0/manifest.installer.1.2.0.json#L172-L201

denelon avatar Jun 21 '22 16:06 denelon

I've been investigating this condition a bit more deeply. We're going to experiment with a couple of manifests, and if we can confirm the correct behavior, we're going to make this adjustment in the 1.4 client as a permanent solution.

Ideally, the MSI based installers will have 3010 errors are mapped to the correct expected return code, to address for earlier versions of winget, and going forward, the newer versions of the client will honor the mapping in the manifest and automatically map this error for MSI based installers to "rebootRequiredToFinish".

denelon avatar Aug 13 '22 18:08 denelon

The client now informs the user that a reboot is required.

denelon avatar Nov 15 '22 20:11 denelon