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

[New Feature]: Add ability to display warning to user before upgrade

Open Masamune3210 opened this issue 2 years ago • 8 comments

Description of the new feature/enhancement

While upgrading programs, all my explorer windows closed with no warning due to WinMerge closing it as part of its upgrade path. Would it be possible to add a warning to programs known to interfere with others as part of their upgrades or installs?

Proposed technical implementation details (optional)

Add a upgrade after user issues command to the tone of "This upgrade might close other programs as part of its upgrade, make sure you save your work first!" with a prompt Y/N before continuing and a flag to the upgrade command to ignore possible upgrade closures to disable the prompt for scripts and people who don't care

Masamune3210 avatar Dec 08 '21 17:12 Masamune3210

We've seen this with programs aborting Windows Terminal and added a key to the manifest schema. This sounds like a similar scenario, but might need to be handled a bit differently.

denelon avatar Dec 08 '21 23:12 denelon

WinMerge closing it as part of its upgrade path

WinMerge uses Inno Setup which does support the Restart Manager. It would perhaps be nice if we could figure out if WinMerge is doing something special or if there is an issue with Inno.

sredna avatar Dec 09 '21 00:12 sredna

All I know is it kills all open explorer windows on install upgrade or uninstall because it adds a properties sheet which requires explorer to be closed. haven't done much research been at work all day

Masamune3210 avatar Dec 09 '21 02:12 Masamune3210

Actually I think it adds a context menu entry rather than a properties sheet

Masamune3210 avatar Dec 09 '21 02:12 Masamune3210

I think it manually closes all open explorer windows as part of its install script, so there might not be much able to be done to mitigate it other than a warning

Masamune3210 avatar Dec 09 '21 02:12 Masamune3210

But does it have custom code to close Explorer or does it use Restart manager?

Manually closing Explorer is broken by design since other applications (anything with a open/save dialog) might also have the shell extension .DLL loaded.

Restart manager is supposed to fix this. You give it a list of files, it closes all apps using said files, you replace/update the files and finally you tell Restart manager to restart the apps. Explorer is somewhat special since it also owns the taskbar and that might be the same process as a File explorer window.

sredna avatar Dec 09 '21 02:12 sredna

I'm not sure, this is all from observation, not taking a look at the scripts or anything. I don't know if it tries to kill all of explorer or not, as I run File Explorer as a separate process from the taskbar for stability reasons

Masamune3210 avatar Dec 09 '21 03:12 Masamune3210

What kind of name were you thinking for the manifest key?

"VolatileInstaller" as a boolean?

We could provide a message like:

"This installer is known to interfere with running applications"

I'm open to suggestions here.

denelon avatar Feb 01 '22 18:02 denelon

The original PR for this has been closed, so this is not truly https://github.com/microsoft/winget-cli/labels/In-PR

Trenly avatar Mar 06 '24 23:03 Trenly