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

PowerToys update restarted PC without prompting! Lost work!! 😡 #16252

Closed
1 task done
willhains opened this issue Feb 11, 2022 · 47 comments
Closed
1 task done

PowerToys update restarted PC without prompting! Lost work!! 😡 #16252

willhains opened this issue Feb 11, 2022 · 47 comments
Assignees
Labels
Area-Setup/Install Refers to installation mechanism Hot Fix Items we will product an out-of-band release for Issue-Bug Something isn't working Priority-1 Bug that is high priority Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release.

Comments

@willhains
Copy link

Microsoft PowerToys version

0.55.2

Running as admin

  • Yes

Area(s) with issue?

General

Steps to reproduce

  1. Click “Update” button in toast prompt to update from 0.55.1 to 0.55.2.
  2. Use computer normally while PowerToys update runs in the background.

✔️ Expected Behavior

If PowerToys update requires the PC to restart, it should prompt and wait for the user to agree to proceed.

❌ Actual Behavior

The PC restarted with no prompt or warning, and I lost a good deal of work.

Other Software

No response

@willhains willhains added Issue-Bug Something isn't working Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Feb 11, 2022
@crutkas
Copy link
Member

crutkas commented Feb 11, 2022

Maybe been the .net runtime requirement caused it since I know that was via windows update. but powertoys itself won’t require an update first we’ve heard of this.

@Z1ni
Copy link

Z1ni commented Feb 11, 2022

This just happened to me too, event viewer confirmed that the reason was the runtime update:

The process C:\WINDOWS\Temp\{33EC02EC-C5BC-4005-8F67-5E51CAAD43D0}\.cr\windowsdesktop-runtime-5.0.14-win-x64.exe (COMPUTER_NAME) has initiated the restart of computer COMPUTER_NAME on behalf of user USER_NAME for the following reason: Application: Installation (Planned)
 Reason Code: 0x80040002
 Shutdown Type: restart

@willhains
Copy link
Author

It has happened to a another colleague at my company as well, but on first install rather than update.

@noenmoen
Copy link

It happened to me too.

@scscgit
Copy link

scscgit commented Feb 13, 2022

If there is any risk of this happening, can we extend the requirement and also demand that it must display "this may require a system reboot" near the Update button, even before it's pressed rather than accepting it if there is a "prompt"? (Especially if this is caused by a transitive dependency like .NET as someone may be behind on updates and we need to be sure there's no possible combination under which the reboot occurs.)

Further, it's a shame that the Awake feature can't fully replace DontSleep app, which unlike PowerToys is capable of blocking system restart attempts (basically forcing the "Waiting for background program to close" window to wait indefinitely without letting it kill any of the applications). This is a perfect example of an issue that PowerToys should try to solve by itself.

@franky920920 franky920920 added the Area-Setup/Install Refers to installation mechanism label Mar 1, 2022
@franky920920
Copy link
Contributor

@crutkas I can see we're using /install /quiet for installing dotnet, should we add /norestart to prevent a restart from dotnet installer?

@jaimecbernardo
Copy link
Collaborator

Ideally, it would be good to have it prompt if a restart is needed and still have quiet work.
Wonder if it just fails if it can't restart on quiet.
Another option would be removing "/quiet". I think just going with "/norestart" for now makes sense.

@jaimecbernardo jaimecbernardo added Priority-1 Bug that is high priority and removed Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Mar 1, 2022
@franky920920 franky920920 self-assigned this Mar 1, 2022
@franky920920 franky920920 added the Status-In progress This issue or work-item is under development label Mar 1, 2022
@TheCakeIsNaOH
Copy link

Another option would be removing "/quiet". I think just going with "/norestart" for now makes sense.

This could break the Chocolatey (and possibly Winget) packages. The Chocolatey package relies on the silent switch to make the entire installation possess silent.

@jaimecbernardo
Copy link
Collaborator

We could leave the /quiet in, just adding the /norestart and seeing how that goes.

@jaimecbernardo jaimecbernardo added Hot Fix Items we will product an out-of-band release for and removed Status-In progress This issue or work-item is under development labels Mar 2, 2022
@af4jm
Copy link

af4jm commented Mar 2, 2022

I had it happen on my personal PC on latest Win11 & on my work PC, which is still Win10

@jaimecbernardo jaimecbernardo added the Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release. label Mar 3, 2022
@af4jm
Copy link

af4jm commented Mar 7, 2022

the runtime update that triggered this is a mess... not only is it causing this issue in PowerTools, since then the Bing Spotlight is nothing but a static image of some wavy blue lines on Windows 11 and that picture of a hiker by a mountain lake on Windows 10... only other thing I've noticed so far is that the Explorer preview pane closed and I had to look up the keyboard shortcut to get it back (the Explorer menus & right-click menus in Win11 are also a disaster, but that's been since the upgrade from 10, not caused by this... e.g. where is the setting to always "Show More Options" on right-click, since I use that context menu all the time and in 2 months of Win11, I've had maybe once or twice where what I needed wasn't hidden)

@dsparkplug
Copy link

dsparkplug commented Mar 8, 2022

Note that this just happened to me when updating to v0.56.2 which presumably already includes the /norestart flag (or is that only set for subsequent installations?).

@franky920920
Copy link
Contributor

franky920920 commented Mar 8, 2022

Note that this just happened to me when updating to v0.56.2 which presumably already includes the /norestart flag (or is that only set for subsequent installations?).

OMG that's too wired.
@dsparkplug Could you attach a full bug report file?
Right-click on the tray icon and click Report Bug. Then drag-and-drop the generated file into the GitHub comment to upload it. This contains the update logs that could help investigate this issue. Thanks!
image

/needinfo

@ghost ghost added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Mar 8, 2022
@dsparkplug
Copy link

The bug report zip contains too many details to post publically. Can I send it privately or just send the required files? Note that the files under the 'UpdateLogs' folder don't contain much. I've attached the latest:
update-log_2022-03-08.txt

@dsparkplug
Copy link

Note that the event log message implies that Power Toys setup initiated the restart rather than the dotnet installer:

The process C:\WINDOWS\Temp\{7AB8B2CF-DADE-4473-BB82-AF4B5EAEDE55}\.cr\powertoyssetup-0.56.2-x64.exe (COMPUTER_NAME) has initiated the restart of computer COMPUTER_NAME on behalf of user USER_NAME for the following reason: Application: Installation (Planned)
 Reason Code: 0x80040002
 Shut-down Type: restart
 Comment: 

Also, the latest dotnet runtimes were already installed prior to running this this update.

@dsparkplug
Copy link

Maybe this line is relevant:

<util:CloseApplication CloseMessage="yes" Target="PowerToys.exe" ElevatedCloseMessage="yes" RebootPrompt="no" TerminateProcess="0" />

@dsparkplug
Copy link

Note also that after the forced reboot the index.html did not exist and the following error message appeared when previewing a file. I needed to reinstall to fix it.

System.IO.FileNotFoundException: Could not find file 'C:\Program Files\PowerToys\modules\FileExplorerPreview\index.html'.
File name: 'C:\Program Files\PowerToys\modules\FileExplorerPreview\index.html'
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at System.IO.Strategies.FileStreamHelpers.ChooseStrategy(FileStream fileStream, String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, Int64 preallocationSize)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at Microsoft.PowerToys.PreviewHandler.Monaco.MonacoPreviewHandlerControl.<>c__DisplayClass6_1`1.<<DoPreview>b__3>d.MoveNext()
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state)

@rmarskell
Copy link

I have the exact same issue as dsparkplug. Same restart without warning after update from 0.56.1 to 0.56.2, same event log message indicating it was powertoyssetup-0.56.2-x64.exe that triggered it, and file preview throws an error and pops up an exception details window that says the index.html could not be found.

@andmillward
Copy link

Wow yeah, exact same problem. No fix or moratorium on updates? Guys set up a pitfall and are just letting people walk into it.

@jaimecbernardo
Copy link
Collaborator

jaimecbernardo commented Mar 24, 2022

The file should no longer be locked when updating from 0.56.2 to the next version.
Looking for a fix to not have an automatic restart for the main installer is still being looked into.
This was a side effect of adopting a wix bootstrapper.

@jaimecbernardo
Copy link
Collaborator

In #17255 we've added a flag so that when we run the installer to update in passive mode it doesn't restart automatically. This will only be applied when >=0.57 tries to update, though.
So, to update from 0.56.2 to 0.57 I recommend downloading the installer and running it manually instead once it's released if this issue might affect you.

@jaimecbernardo jaimecbernardo added Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed Needs-Team-Response An issue author responded so the team needs to follow up labels Mar 24, 2022
@af4jm
Copy link

af4jm commented Apr 9, 2022

just got the update to 0.57.2 and again it auto-rebooted without warning... dunno what version the fix is planned for, but for something this serious, it's ridiculous that it didn't go in the next hotfix, and that after 5 weeks it's still not in the release

PowerToysReport_2022-04-09-11-15-12.zip

@jaimecbernardo
Copy link
Collaborator

Hi @af4jm , From the logs you updated from 0.56.2 to 0.57.2.
Sorry, but the fix is in the way that PowerToys calls the installer to self update and not in the installer itself.
This means the fix is applied when updating from a >=0.57.0 version,
As stated in the previous comment:

In #17255 we've added a flag so that when we run the installer to update in passive mode it doesn't restart automatically. This will only be applied when >=0.57 tries to update, though.

@Waseemilyas
Copy link

This just happened to me too whilst I was also mid graphics driver upgrade. Luckily it didn't corrupt anything but could have ended badly.

There really should be some warning that an unprompted restart could occur when upgrading powertoys.

@crutkas
Copy link
Member

crutkas commented Jun 9, 2022

@Waseemilyas where did you install this from? i know store we haven't pushed the new flags live

@robinscheurwater
Copy link

It happened to me too. v0.59.0.
I installed it from within the app.
Suddenly my PC restarted without notice.
Not sure what to look for in the logs. Here are some entries:

: Applying execute package: VCRedist, action: Install, path: C:\ProgramData\Package Cache..\VCRedist-14.32.31326.exe, arguments: '"C:\ProgramData\Package Cache..\VCRedist-14.32.31326.exe" /install /quiet /norestart'
: Applied execute package: VCRedist, result: 0x0, restart: Required
..
: Session end, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{..}, resume: ARP, restart: Required, disable resume: No
..
: Apply complete, result: 0x0, restart: Required, ba requested restart: No
: Shutting down, exit code: 0xbc2
: Bootstrapper application requested restart at shutdown. Planned to restart already: No.
..
: Exit code: 0xbc2, restarting: Yes
: Restarting computer...

@RC-1290
Copy link

RC-1290 commented Jun 16, 2022

This issue is now marked as closed, but it still happens. Is the issue in the uninstaller of the old version?
In other words; is the update that fixes it supposed to be the last occurrence of the bug? Or is it not actually fixed?

@jaimecbernardo
Copy link
Collaborator

The issue is in the version that's trying to run the update, that doesn't pass "/norestart" to the installer.
So, updating from versions >=0.57 should have this fixed. Updating from earlier versions will still trigger the bug.

@webbertakken
Copy link

Just had a forced reboot on a fresh install of PowerToysSetup-0.61.1-x64.exe through choco, on a Windows 11 machine with all updates to date.

@Aaron-Junker
Copy link
Collaborator

Just had a forced reboot on a fresh install of PowerToysSetup-0.61.1-x64.exe through choco, on a Windows 11 machine with all updates to date.

We don't manage the package on chocolatey. It doesn't pass the /norestart flag to the installer, so it restarts.

@webbertakken
Copy link

Thanks for your quick response. I've requested the change to the maintainers of the package.

See linked issue above ^

@CervEdin
Copy link

CervEdin commented Sep 7, 2022

this just happened on the latest update, seriously not okay

@Aaron-Junker
Copy link
Collaborator

this just happened on the latest update, seriously not okay

How did you install PowerToys? Over WinGet, over our installer, or sonething else?

@CervEdin
Copy link

CervEdin commented Sep 7, 2022

@Aaron-Junker update from either 5.2 or 5.5 (I don't remember) from the PowerToys update prompt

I gather it's been fixed since 🙏

@consoleaf
Copy link

Relying on the outdated version being up to date enough to not randomly, with no prompt, destroy the user's data with a reboot doesn't seem optimal. Just lost hours of work, thanks 😮‍💨. Next time, please at least add a prompt to confirm the reboot

@crutkas
Copy link
Member

crutkas commented Oct 12, 2022

We are working on fully self containing the runtimes. Currently they are what is forcing the restarts. We pass in no restart flags to their installers.

For 0.63 we put two as self contained and working on the third (.NET) now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Setup/Install Refers to installation mechanism Hot Fix Items we will product an out-of-band release for Issue-Bug Something isn't working Priority-1 Bug that is high priority Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

No branches or pull requests